summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2009-10-20 14:55:22 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2009-10-20 14:55:22 (GMT)
commit70dacb37c85941d5c9fa9d4e37661378d91aa339 (patch)
tree3226776b460c27a853ccfda8cba8c8e8f2928275 /tests
parent101bcfd2ac0cb6d7fed6cd2e7a54012ff34afe70 (diff)
parent6f5d69a0400229b0637242c2457b8cb88090785f (diff)
downloadQt-70dacb37c85941d5c9fa9d4e37661378d91aa339.zip
Qt-70dacb37c85941d5c9fa9d4e37661378d91aa339.tar.gz
Qt-70dacb37c85941d5c9fa9d4e37661378d91aa339.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-widget-team into 4.6
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qlistview/tst_qlistview.cpp30
1 files changed, 21 insertions, 9 deletions
diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp
index ed02317..6e211ae 100644
--- a/tests/auto/qlistview/tst_qlistview.cpp
+++ b/tests/auto/qlistview/tst_qlistview.cpp
@@ -117,7 +117,8 @@ private slots:
void shiftSelectionWithNonUniformItemSizes();
void clickOnViewportClearsSelection();
void task262152_setModelColumnNavigate();
- void taskQTBUG_2233_scrollHiddenRows();
+ void taskQTBUG_2233_scrollHiddenItems_data();
+ void taskQTBUG_2233_scrollHiddenItems();
};
// Testing get/set functions
@@ -1781,18 +1782,27 @@ void tst_QListView::task262152_setModelColumnNavigate()
view.setModelColumn(1);
view.show();
- QTest::qWait(30);
+ QTest::qWait(100);
QTest::keyClick(&view, Qt::Key_Down);
- QTest::qWait(10);
+ QTest::qWait(100);
QCOMPARE(view.currentIndex(), model.index(1,1));
QTest::keyClick(&view, Qt::Key_Down);
- QTest::qWait(10);
+ QTest::qWait(100);
QCOMPARE(view.currentIndex(), model.index(2,1));
}
-void tst_QListView::taskQTBUG_2233_scrollHiddenRows()
+void tst_QListView::taskQTBUG_2233_scrollHiddenItems_data()
{
+ QTest::addColumn<int>("flow");
+
+ QTest::newRow("TopToBottom") << static_cast<int>(QListView::TopToBottom);
+ QTest::newRow("LeftToRight") << static_cast<int>(QListView::LeftToRight);
+}
+
+void tst_QListView::taskQTBUG_2233_scrollHiddenItems()
+{
+ QFETCH(int, flow);
const int rowCount = 200;
QListView view;
@@ -1804,14 +1814,16 @@ void tst_QListView::taskQTBUG_2233_scrollHiddenRows()
model.setStringList(list);
view.setModel(&model);
view.setViewMode(QListView::ListMode);
- view.setFlow(QListView::TopToBottom);
for (int i = 0; i < rowCount / 2; ++i)
view.setRowHidden(2 * i, true);
- view.resize(250, 130);
+ view.setFlow(static_cast<QListView::Flow>(flow));
+ view.resize(130, 130);
for (int i = 0; i < 10; ++i) {
- view.verticalScrollBar()->setValue(i);
- QModelIndex index = view.indexAt(QPoint(20,0));
+ (view.flow() == QListView::TopToBottom
+ ? view.verticalScrollBar()
+ : view.horizontalScrollBar())->setValue(i);
+ QModelIndex index = view.indexAt(QPoint(0,0));
QVERIFY(index.isValid());
QCOMPARE(index.row(), 2 * i + 1);
}