Make QDialog modal to operating system
问题 Is it possible that if a QDialog instance is exec() uted, the entire operating system is blocked until the user closes the dialog? In the following minimal example the dialog blocks only its parent widget but not the OS elements outside of the Qt application. rootwindow.h #ifndef ROOTWINDOW_H #define ROOTWINDOW_H #include <QApplication> #include <QMainWindow> #include <QtDebug> #include <QDialog> #include <QPushButton> #include <QMessageBox> #include <QBoxLayout> class RootWindow : public