Skip to content

Commit

Permalink
tst_qfocusevent activateWindow for Win 10
Browse files Browse the repository at this point in the history
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 <simon.hausmann@qt.io>
(cherry picked from commit b091472)
  • Loading branch information
Joni Jäntti committed Aug 15, 2017
1 parent 116e79c commit bdc8cda
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/auto/other/qfocusevent/tst_qfocusevent.cpp
Expand Up @@ -41,6 +41,7 @@
#include <qevent.h>
#include <qlineedit.h>
#include <QBoxLayout>
#include <QSysInfo>

QT_FORWARD_DECLARE_CLASS(QWidget)

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit bdc8cda

Please sign in to comment.