Details
-
Bug
-
Resolution: Done
-
P4: Low
-
None
-
5.7.0
-
None
Description
https://doc.qt.io/qt-5/qml-qtquick-controls2-popup.html#modal-prop says:
This property holds whether the popup is modal. The default value is false.
It had me questioning what a modal popup was, because I'd set it to true on a Dialog, but was still able to close it by clicking outside of it. It was only after setting closePolicy: Popup.CloseOnEscape that it behaved as expected. The expected behaviour (for me) is what widgets does:
#include <QApplication> #include <QtWidgets> int main(int argc, char *argv[]) { QApplication app(argc, argv); QWidget widget; widget.resize(400, 400); QDialog *d = new QDialog(&widget); d->setModal(true); widget.show(); d->exec(); return app.exec(); }