summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-06-17 18:10:08 +0200
committerMarc Mutz <marc.mutz@qt.io>2023-01-23 20:35:24 +0200
commit225b9e40d7a1983f4129fb5b4e8e5285d78ce3d3 (patch)
tree8d7cdeb57420f3b7bb81410bb4490aeb07619936
parent8a882a9e478481b0b86bf7a290d6e8621ef5664b (diff)
QQuickAbstractDialog: treat closing as rejection
QDialog treats the closing of the dialog via the [X] button as rejection. QQuickAbstractDialog just recorded the change in its m_visible member, but failed to emit rejected(), which caused users of the dialog to wait indefinitely for a result. Fix by emitting rejected() when the user closes the dialog via [X]. Fixes: QTBUG-101973 Change-Id: I5a66a69aec33f6a05279f20880e70cf633102a8d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
-rw-r--r--src/dialogs/qquickabstractdialog.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/dialogs/qquickabstractdialog.cpp b/src/dialogs/qquickabstractdialog.cpp
index 9c2e08625..3d2db3861 100644
--- a/src/dialogs/qquickabstractdialog.cpp
+++ b/src/dialogs/qquickabstractdialog.cpp
@@ -267,6 +267,8 @@ void QQuickAbstractDialog::reject()
void QQuickAbstractDialog::visibleChanged(bool v)
{
+ if (m_visible && !v) // closed by user
+ emit rejected(); // treat as rejected
m_visible = v;
qCDebug(lcWindow) << "visible" << v;
emit visibilityChanged();