[英]QDialog::exec react after 3 calls
我正在使用自定义对话框,并通过调用显示它:
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){}
调用(事件从QTableView
“单击”)。
这个问题很奇怪。 我需要单击3次按钮才能显示对话框。 第二次单击后,Qt Creator给我这样的警告"QDialog::exec: Recursive call detected"
。
有趣的是,这仅发生一次(在单个应用程序实例中)。 下次点击就像是一种魅力。
我尚未解决此问题,但我做了一些解决方法,它的工作原理如下:
this->numberPick = new NumberPick(this);
this->numberPick->setCell(cell);
this->numberPick->move(point);
this->numberPick->setWindowFlags(Qt::SplashScreen);
this->numberPick->exec();
delete this->numberPick;
但问题仍然悬而未决
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.