From bdc8cda5a5423f88e3109c12a9c438c5db670009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joni=20J=C3=A4ntti?= Date: Tue, 11 Jul 2017 09:19:36 +0300 Subject: tst_qfocusevent activateWindow for Win 10 This workaround was created to make tst_qfocusevent test pass on Windows 10 x64 Creators Update. Task-number: QTBUG-61467 Change-Id: I63eb149ae850174fb5de99761a6001e000a151a2 Reviewed-by: Simon Hausmann (cherry picked from commit b091472f44546446b82efe7c9e69de570deeda8d) --- tests/auto/other/qfocusevent/tst_qfocusevent.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp index 7cb6e67cbb..c7955ffed2 100644 --- a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp +++ b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp @@ -41,6 +41,7 @@ #include #include #include +#include QT_FORWARD_DECLARE_CLASS(QWidget) @@ -353,6 +354,14 @@ void tst_QFocusEvent::checkReason_ActiveWindow() QTRY_VERIFY(childFocusWidgetOne->focusOutEventRecieved); QVERIFY(childFocusWidgetOne->focusOutEventLostFocus); +#if defined(Q_OS_WIN) + if (QSysInfo::kernelVersion() == "10.0.15063") { + // Activate window of testFocusWidget, focus in that window goes to childFocusWidgetOne + QWARN("Windows 10 Creators Update (10.0.15063) requires explicit activateWindow()"); + testFocusWidget->activateWindow(); + } +#endif + QVERIFY( !childFocusWidgetOne->focusInEventRecieved ); QVERIFY( childFocusWidgetOne->focusOutEventRecieved ); QCOMPARE( childFocusWidgetOne->focusOutEventReason, (int)Qt::ActiveWindowFocusReason); -- cgit v1.2.3