Ensure that this widget has focus before sending a keypress.

This doesn't fix the bug, but confirms that it is CI flakyness.

Task-number: QTBUG-21098

Change-Id: Ic37a7574af88205371f4b2c24113d12b1386835c
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
This commit is contained in:
Stephen Kelly 2012-04-19 15:56:26 +02:00 committed by Qt by Nokia
parent b780196a95
commit 384eec86e5

View File

@ -1667,6 +1667,8 @@ void tst_QListWidget::QTBUG14363_completerWithAnyKeyPressedEditTriggers()
listWidget.show();
listWidget.setCurrentItem(item);
QTest::qWaitForWindowShown(&listWidget);
listWidget.setFocus();
QCOMPARE(qApp->focusWidget(), &listWidget);
QTest::keyClick(listWidget.viewport(), Qt::Key_C);