Fix flaky tst_QMdiArea::currentSubWindow()

tst_QMdiArea::currentSubWindow() is flaky and fails when the
dummyTopLevel window is not marked as active before verification.

Verify that the dummyTopLevel is active, before checking what is the
active topLevel window.

Fix the flakiness of tst_QMdiArea::currentSubWindow() on Ubuntu 24.

Pick-to: 6.9 6.8 6.5
Change-Id: If5b85713d0bfec40e2722c471f7c3ba5ac73171c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
This commit is contained in:
Frédéric Lefebvre 2025-05-05 13:02:31 +02:00
parent 71842cfb89
commit 6c7f61f081

View File

@ -1002,6 +1002,7 @@ void tst_QMdiArea::currentSubWindow()
QLineEdit dummyTopLevel;
dummyTopLevel.show();
QVERIFY(QTest::qWaitForWindowExposed(&dummyTopLevel));
QVERIFY(QTest::qWaitForWindowActive(&dummyTopLevel));
// Move focus to another top-level and check that we still
// have an active window.