tst_QAbstractItemView: Wrap qWaitForWindowActive in QVERIFY

Return value of qWaitForWindowActive should be checked as it is marked
Q_REQUIRED_RESULT.

One of the calls was failing, so remove it and wait for the next condition
instead.

Amends d0dffdfc01.

Change-Id: I0c0b2bf11504730477158a5e1fb3018f359a6fb9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
bb10
Kari Oikarinen 2018-02-28 12:57:51 +02:00
parent 1875db1849
commit 233046d39c
1 changed files with 3 additions and 4 deletions

View File

@ -2502,7 +2502,7 @@ void tst_QAbstractItemView::checkFocusAfterActivationChanges()
view->setItemDelegate(&delegate);
w.show();
QTest::qWaitForWindowActive(&w);
QVERIFY(QTest::qWaitForWindowActive(&w));
QVERIFY(le->hasFocus());
view->setFocus();
@ -2513,12 +2513,11 @@ void tst_QAbstractItemView::checkFocusAfterActivationChanges()
QVERIFY(delegate.openedEditor->hasFocus());
QApplication::setActiveWindow(&otherTopLevel);
QTest::qWaitForWindowActive(&otherTopLevel);
otherTopLevel.setFocus();
QVERIFY(!delegate.openedEditor);
QTRY_VERIFY(!delegate.openedEditor);
QApplication::setActiveWindow(&w);
QTest::qWaitForWindowActive(&w);
QVERIFY(QTest::qWaitForWindowActive(&w));
QVERIFY(view->hasFocus());
}