1
我想设置此QT UI为“模式少”,我试过setModal(false),但不幸的是它不起作用。意义:它编译和运行,但我仍然不能让孩子的UI和父母并行工作。我正在使用QT 4.8。在Visual Studio 2010中这里是我的代码:qt setmodal无法正常工作
realtimedlg::realtimedlg(QWidget *parent)
{
ui.setupUi(this);
parentWnd = parent;
init();
timer1.start(100, this);
this->setModal(false); // this does not do anything!
}
我做到了,但我的realtimedlg显示很短的时间,然后消失! – Samer 2014-09-29 19:40:08
这是因为你在堆栈上创建它,你应该从堆中创建。 – 2014-09-29 19:41:28
@Samer,请检查最新的答案。 – 2014-09-29 19:46:40