Reputation: 1657
Is there a way of opening a QDialog window-modal with exec()? open() returns immediately, and exec() shows the dialog application-modal instead of window-modal. How to take the best of both methods?
Upvotes: 2
Views: 5563
Reputation: 10067
In Qt there exist window-modality.
For example, showing a dialog this way, from inside a QWidget-derived class, will make the dialog window-modal to its parent:
QDialog d(this);
//...
d.setWindowModality(Qt::WindowModal);
d.exec();
being this
a QWidget
, set as the QDialog
parent.
Upvotes: 4