diff options
author | Sami Nurmenniemi <sami.nurmenniemi@qt.io> | 2017-04-06 10:09:11 +0300 |
---|---|---|
committer | Sami Nurmenniemi <sami.nurmenniemi@qt.io> | 2017-04-07 08:11:54 +0000 |
commit | c7e7a785c6e3bec422fe5b62361e5417240c0ada (patch) | |
tree | a0d89d813b8bb88ec58b7b1b28c4b7e536f53c26 /tests/auto/other/qfocusevent/tst_qfocusevent.cpp | |
parent | bbb67ca32cebad312f02e916dff54e591b92af24 (diff) |
tst_QFocusEvent: Fix checkReason_ActivateWindow for offscreen and minimal platforms
Widgets in platforms offscreen and minimal don't get focus back
automatically after hiding focused window. Extra activateWindow
is needed.
Task-number: QTBUG-59966
Change-Id: Iaf3d4e60483c4b2600472af199f7a7cd51b3fa6e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/other/qfocusevent/tst_qfocusevent.cpp')
-rw-r--r-- | tests/auto/other/qfocusevent/tst_qfocusevent.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp index 5137ba0c57..5bf39b3953 100644 --- a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp +++ b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp @@ -340,6 +340,14 @@ void tst_QFocusEvent::checkReason_ActiveWindow() #if defined(Q_OS_IRIX) QEXPECT_FAIL("", "IRIX requires explicit activateWindow(), so this test does not make any sense.", Abort); #endif + + if (!QGuiApplication::platformName().compare(QLatin1String("offscreen"), Qt::CaseInsensitive) + || !QGuiApplication::platformName().compare(QLatin1String("minimal"), Qt::CaseInsensitive)) { + // Activate window of testFocusWidget, focus in that window goes to childFocusWidgetOne + QWARN("Platforms offscreen and minimal require explicit activateWindow()"); + testFocusWidget->activateWindow(); + } + QTRY_VERIFY(childFocusWidgetOne->focusInEventRecieved); QVERIFY(childFocusWidgetOne->focusInEventGotFocus); |