我正在使用自定义对话框,并通过调用来显示它:
this->numberPick.move(point);
this->numberPick.setWindowFlags(Qt::SplashScreen);
this->numberPick.setParent(this);
this->numberPick.setModal(true);
this->numberPick.exec();
void MainWindow::on_boardView_clicked(const QModelIndex &index){}
所有这些代码都在(事件“单击” from QTableView
)中调用。
这个问题很奇怪。我需要单击我的按钮 3 次才能显示对话框。第二次点击后 Qt Creator 给了我这样的警告"QDialog::exec: Recursive call detected"
。
有趣的是,这只发生一次(在单个应用程序实例中)。下一次点击就像一个魅力。