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(); }
Attachments
For Gerrit Dashboard: QTBUG-60358 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
192623,1 | Don’t let clicks outside of modal popups close them on desktop | dev | qt/qtquickcontrols2 | Status: ABANDONED | 0 | 0 |
192628,3 | Doc: improve the documentation for Popup’s modal property | 5.9 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |