From 0d8795fcb45411809dce3de5918e5d3125411b14 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 31 Jul 2012 13:14:49 +0200 Subject: fix window activation in tst_qmdiArea::subWindowActivated2 QApplication::setActiveWindow doesn't activate the native window but marks the widget as active inside Qt. We need to use QWidget::activateWindow instead. See docs. Also moved the activation call further down because on Windows a minimized window cannot be activated using the activation-by-focus fake we're currently using. Change-Id: I752f6ada1f463931fa9cfb3c35f42dbec0207bfa Reviewed-by: Friedemann Kleint --- tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp index 11636b660b..0a66571894 100644 --- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp +++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp @@ -529,8 +529,8 @@ void tst_QMdiArea::subWindowActivated2() // For this test, the QMdiArea widget must be active after minimizing and // showing it again. QMdiArea has no active sub window if it is inactive itself. - qApp->setActiveWindow(&mdiArea); mdiArea.showNormal(); + mdiArea.activateWindow(); QVERIFY(QTest::qWaitForWindowActive(&mdiArea)); QTRY_COMPARE(spy.count(), 1); QCOMPARE(mdiArea.activeSubWindow(), activeSubWindow); -- cgit v1.2.3