From b120ff4f1a479c35b3e5bbcbc3c72cc18ee4879c Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 18 Aug 2009 10:31:31 +0200 Subject: tst_QTableView::task259308_scrollVerticalHeaderSwappedSections fails. The QTableView scrolled down after the sections swap. Setting the current index to the topmost visual element fixes the issue. Reviewed-by: Thierry --- tests/auto/qtableview/tst_qtableview.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index 2f41d77..e650dc8 100644 --- a/tests/auto/qtableview/tst_qtableview.cpp +++ b/tests/auto/qtableview/tst_qtableview.cpp @@ -3270,6 +3270,7 @@ void tst_QTableView::task259308_scrollVerticalHeaderSwappedSections() tv.setModel(&model); tv.show(); tv.verticalHeader()->swapSections(0, model.rowCount() - 1); + tv.setCurrentIndex(model.index(model.rowCount() - 1, 0)); QTest::qWait(60); QTest::keyClick(&tv, Qt::Key_PageUp); // PageUp won't scroll when at top -- cgit v0.12