From 29d030b24688774730dc17f804bbfaac409371af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Lefebvre?= Date: Wed, 7 May 2025 10:27:48 +0200 Subject: [PATCH] Fix flaky tst_QFocusEvent::checkReason_ActiveWindow on openSUSE tst_QFocusEvent::CheckReason_ActiveWindow is flaky on openSUSE where the childFocusWidgetOne is unable to receive focus after d has been hidden. This is due to some asynchronicity when setActive is being called while d is already active. Remove the call to activateWindow on d as it is already active by calling show. Pick-to: 6.8 6.5 Change-Id: Id01c6704122df42982d65d28ddb94d184d00d9aa Reviewed-by: Axel Spoerl (cherry picked from commit 4db3961ee140867e14f8e1d20173e85060bc6c50) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/other/qfocusevent/tst_qfocusevent.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp index 8297b53ea15..c1b72d4d623 100644 --- a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp +++ b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp @@ -310,8 +310,6 @@ void tst_QFocusEvent::checkReason_ActiveWindow() QDialog* d = new QDialog( testFocusWidget ); d->show(); QVERIFY(QTest::qWaitForWindowExposed(d)); - - d->activateWindow(); // ### CDE QVERIFY(QTest::qWaitForWindowActive(d)); QTRY_VERIFY(childFocusWidgetOne->focusOutEventRecieved);