Stabilize tst_QAbstractItemView::task200665_itemEntered()

It seems that sometimes QCursor::setPos() will not get the opportunity
to run the event loop before scrolling the list view unless we do it
explicitly.

Task-number: QTBUG-35060
Change-Id: Ic635bd8d1a4e3dbcadf9605e88197df6a0f69fc7
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
This commit is contained in:
Gabriel de Dietrich 2014-01-15 14:13:53 +01:00 committed by The Qt Project
parent 0e69230d02
commit a813fcf470

View File

@ -1286,6 +1286,7 @@ void tst_QAbstractItemView::task200665_itemEntered()
QVERIFY(QTest::qWaitForWindowExposed(&view));
QRect rect = view.visualRect(model.index(0,0));
QCursor::setPos( view.viewport()->mapToGlobal(rect.center()) );
QCoreApplication::processEvents();
QSignalSpy spy(&view, SIGNAL(entered(QModelIndex)));
view.verticalScrollBar()->setValue(view.verticalScrollBar()->maximum());