-1
我試圖找出這個錯誤。我有一個使用Qt Creator進行的簡單應用程序。SLOT問題/ C++
我有三個按鈕,其中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);
}
那就是代碼。
謝謝你的工作! – Henry 2011-05-28 12:48:39