aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-06-20 09:45:33 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-07-06 17:11:04 +0000
commit54eef38350800452b6ef5c893292e0df6dad390b (patch)
tree74835daf9d15eb5ddb3c132bb7558884cddd2175 /tests
parenta69d6c30867069eb0000ef225e9d10190c00308f (diff)
QQuickAbstractDialog: emit rejected() on mere close()
Like QDialog, there should be only two ways to close a QQuickAbstractDialog: by accepting or rejecting. Closing a dialog with the [X] button or hitting Esc should reject. This is natural, and what QDialog has been implementing since decades, but QQuickAbstractDialog only emitted rejected() on a manual reject(). To implement, move the emission of accepted() and rejected() to close() instead of done(), and swap the calls to close() and setResult() in done() so the correct result() is available when close() is called. [ChangeLog][Important Behavior Changes] QtQuick dialogs now emit rejected() on a mere close(), too. [ChangeLog][QtQuickDialogs][QQuickAbstractDialog] Now emits rejected() on a mere close(), too. The code in 5.15 is too different, so I made a separate fix. Fixes: QTBUG-101973 Change-Id: I90d1a78ee95b72eecae35005e191312c939cecf3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 83a306f7d84e3fb58ed8576546f61cbb2cb20f9a) Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quickdialogs/qquickfiledialogimpl/tst_qquickfiledialogimpl.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/tests/auto/quickdialogs/qquickfiledialogimpl/tst_qquickfiledialogimpl.cpp b/tests/auto/quickdialogs/qquickfiledialogimpl/tst_qquickfiledialogimpl.cpp
index 6f7e7218e0..616dce7ce8 100644
--- a/tests/auto/quickdialogs/qquickfiledialogimpl/tst_qquickfiledialogimpl.cpp
+++ b/tests/auto/quickdialogs/qquickfiledialogimpl/tst_qquickfiledialogimpl.cpp
@@ -705,7 +705,6 @@ void tst_QQuickFileDialogImpl::closingDialogCancels()
// Close the dialog.
CLOSE_QUICK_DIALOG();
QCOMPARE(accepted.size(), 0);
- QEXPECT_FAIL("", "QTBUG-101973", Continue);
QCOMPARE(rejected.size(), 1);
}