diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2021-03-01 08:20:45 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2021-03-11 11:59:02 +0100 |
commit | ea310c1d0f4d9bb66c118407cc9e70e6e2a2d724 (patch) | |
tree | f523b796aab922ad86d21992e8397b4eb2150822 /tests/auto/widgets | |
parent | 30245c8515bdac93971520b78bd867eadb813ec2 (diff) |
Fix tst_QDialog::keepPositionOnClose on Wayland
The test assumed that dialog.move() would actually move
the dialog box to the requested location, which is an invalid
assumption on Wayland.
Since the objective of the test is not to check if move() works
this way, but to check whether the dialog box shows up in the
same location when it is re-shown, we actually fetch the pos
after showing it the first time, rather than assume this is the
same as the requested one.
Task-number: QTBUG-91418
Change-Id: Ifa21fa08429f198988f90d7ee328e4f35a4764c2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r-- | tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp index 53c33255bf..6a59edca10 100644 --- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp +++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp @@ -552,10 +552,11 @@ void tst_QDialog::keepPositionOnClose() dialog.setWindowTitle(QTest::currentTestFunction()); const QRect availableGeometry = QGuiApplication::primaryScreen()->availableGeometry(); dialog.resize(availableGeometry.size() / 4); - const QPoint pos = availableGeometry.topLeft() + QPoint(100, 100); + QPoint pos = availableGeometry.topLeft() + QPoint(100, 100); dialog.move(pos); dialog.show(); QVERIFY(QTest::qWaitForWindowExposed(&dialog)); + pos = dialog.pos(); dialog.close(); dialog.windowHandle()->destroy(); // Emulate a click on close by destroying the window. QTest::qWait(50); |