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 <simon.hausmann@qt.io>bb10
parent
d61ac601d8
commit
b091472f44
|
|
@ -36,6 +36,7 @@
|
|||
#include <qevent.h>
|
||||
#include <qlineedit.h>
|
||||
#include <QBoxLayout>
|
||||
#include <QSysInfo>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QWidget)
|
||||
|
||||
|
|
@ -329,6 +330,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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue