このエラーを理解しようとしています。Qt Creator で作成した簡単なアプリケーションがあります。
ボタンが 3 つあり、そのうちの 2 つが有効になっていません。次に、最初のボタンを押すと、それらを表示したいのですが、ボタンを押すと、「プログラムが動作しなくなりました」というWindowsエラーが発生します。プログラムがコンパイルされ、他のすべてが実行されます。
QPushButton *dealButton = new QPushButton(tr("Deal cards"));
dealButton->show();
QPushButton *hitButton = new QPushButton(tr("HIT"));
hitButton->show();
hitButton->setEnabled(false);
QPushButton *standButton = new QPushButton(tr("STAND"));
standButton->show();
standButton->setEnabled(false);
...
connect(dealButton, SIGNAL(clicked()), this, SLOT(dealCards()));
...
void MainWindow::dealCards()
{
hitButton->setEnabled(true);
standButton->setEnabled(true);
}
それがコードです。