Qt 模态与非模态

模态对话框(Modal Dialog)与非模态对话框(Modeless Dialog)

模态窗体

在该窗体没有被关闭之前,用户不能与同一个应用程序的其他窗口进行交互,与切换,知道该对话框窗体关闭。

QDialog *dialog = new QDialog(this);
dialog->setModal(true);
dialog->show();

非模态窗体

当被打开时,用户即可选择和该对话框交互,也能与同个应用程序的其他窗体交互。

QDialog *dialog = new QDialog(this);
dialog->show();

猜你喜欢

转载自blog.csdn.net/qq_32312307/article/details/115339723