summaryrefslogtreecommitdiffstats
path: root/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2018-04-03 10:21:24 +0300
committerKari Oikarinen <kari.oikarinen@qt.io>2018-04-06 07:19:19 +0000
commitfd87c8da82b4bf52d395a5f9a2687e4eb7a22221 (patch)
tree91dc20aaad65e0f56548a23bb445a2861cb2a509 /tests/auto/other/qfocusevent/tst_qfocusevent.cpp
parenta1b1dd3b84bc53eab7e93245f89e25d7c2f3330e (diff)
tests/auto/other: Avoid unconditional qWait()s
There is no need to qWait() before a QTRY_VERIFY. qWait() will also intermittently handle events while waiting, so calling it in a loop isn't necessary. Change-Id: Ica7fbf18c03e673213dd9b72f31f71937cdcb145 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.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
index 70e696e703..37521a64aa 100644
--- a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
+++ b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
@@ -196,7 +196,6 @@ void tst_QFocusEvent::checkReason_BackTab()
// Now test the backtab key
QTest::keyClick( childFocusWidgetOne, Qt::Key_Backtab );
- QTest::qWait(200);
QTRY_VERIFY(childFocusWidgetOne->focusOutEventRecieved);
QVERIFY(childFocusWidgetTwo->focusInEventRecieved);
@@ -217,7 +216,6 @@ void tst_QFocusEvent::checkReason_Popup()
QMenu* popupMenu = new QMenu( testFocusWidget );
popupMenu->addMenu( "Test" );
popupMenu->popup( QPoint(0,0) );
- QTest::qWait(50);
QTRY_VERIFY(childFocusWidgetOne->focusOutEventLostFocus);
@@ -308,7 +306,7 @@ void tst_QFocusEvent::checkReason_focusWidget()
window1.show();
edit1.setFocus();
- QTest::qWait(100);
+ QTRY_VERIFY(edit1.hasFocus());
edit2.setFocus();
QVERIFY(frame1.focusWidget() != 0);
@@ -344,7 +342,6 @@ void tst_QFocusEvent::checkReason_ActiveWindow()
QVERIFY( !childFocusWidgetOne->hasFocus() );
d->hide();
- QTest::qWait(100);
if (!QGuiApplication::platformName().compare(QLatin1String("offscreen"), Qt::CaseInsensitive)
|| !QGuiApplication::platformName().compare(QLatin1String("minimal"), Qt::CaseInsensitive)) {