关于Qt非模式对话框
各位:
请问下面的代码是打开一个非模式对话框,为什么打开时可以显示非模式对话框上的按钮控件,但是没有显示非模式对话框的窗体?
是不是我打开非模式对话框有误?请大家给出意见,谢谢!
connect(menuBT, SIGNAL(clicked()), this, SLOT(OnBnClickedBtMenu()));
void MainWin::OnBnClickedBtMenu()
{
MainMenu *mainMenu = new MainMenu(this);
mainMenu->setWindowModality(Qt::NonModal);
mainMenu->show();
}
非模式对话框类的构造函数中设置:
setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
QPushButton *bt = new QPushButton(tr("Setting"), this);
bt->setGeometry(0,0,180,200);
connect(bt, SIGNAL(clicked()), this, SLOT(exitMainMenu()));