Fix tst_QColumnView::scrollTo()

The test relies on active focus, so activate the test window in
the beginning of the test to avoid undesired focus widget changes
by QApplication::setActiveWindow() during the test.

Task-number: QTBUG-36395
Change-Id: I6febec7d552224b1754aaf57520ed6d435d29563
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
J-P Nurmi 2014-03-19 15:59:52 +01:00 committed by The Qt Project
parent b66950b342
commit 3a4b8cbc3d

View File

@ -411,7 +411,10 @@ void tst_QColumnView::scrollTo()
ColumnView view(&topLevel);
view.resize(200, 200);
topLevel.show();
topLevel.activateWindow();
centerOnScreen(&topLevel);
QVERIFY(QTest::qWaitForWindowActive(&topLevel));
view.scrollTo(QModelIndex(), QAbstractItemView::EnsureVisible);
QCOMPARE(view.HorizontalOffset(), 0);