From 91f536dd71cd154675264c27273020f4de310ec2 Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
Date: Thu, 28 Apr 2016 14:11:28 +0200
Subject: [PATCH] tst_QMdiArea::subWindowActivated2(): Add activateWindow().

The widget is hidden, reshown and tested for active window, which
is flaky. Add a call to activateWindow() which increases
the chances of it becoming the active window should another window
appear.

Change-Id: Ibbecdbc43e2ac9638aec497c47fffaaffa1855af
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
---
 tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
index aa86e02465c..57be110c15c 100644
--- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
+++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
@@ -497,6 +497,7 @@ void tst_QMdiArea::subWindowActivated2()
     spy.clear();
 
     mdiArea.show();
+    mdiArea.activateWindow();
     QVERIFY(QTest::qWaitForWindowActive(&mdiArea));
     QTRY_COMPARE(spy.count(), 1);
     QVERIFY(mdiArea.currentSubWindow());
-- 
GitLab