summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2009-12-01 09:55:03 (GMT)
committerGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2009-12-01 09:56:09 (GMT)
commitf63fdc09fcaf5258694e9c2f21a5cd22c6677a17 (patch)
tree5ad226776cbf5fdf2b29c88591be1779c613bb3c
parent4bb7bacccff707a693de6d50c7ce886126b68c25 (diff)
downloadQt-f63fdc09fcaf5258694e9c2f21a5cd22c6677a17.zip
Qt-f63fdc09fcaf5258694e9c2f21a5cd22c6677a17.tar.gz
Qt-f63fdc09fcaf5258694e9c2f21a5cd22c6677a17.tar.bz2
Extended tst_QListView::indexAt to test viewport bounds.
Reviewed-by: Olivier
-rw-r--r--tests/auto/qlistview/tst_qlistview.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp
index 602da61..24a553f 100644
--- a/tests/auto/qlistview/tst_qlistview.cpp
+++ b/tests/auto/qlistview/tst_qlistview.cpp
@@ -586,7 +586,15 @@ void tst_QListView::indexAt()
index = view.indexAt(QPoint(20,2 * sz.height()));
QVERIFY(!index.isValid());
-
+ // Check when peeking out of the viewport bounds
+ index = view.indexAt(QPoint(view.viewport()->rect().width(), 0));
+ QVERIFY(!index.isValid());
+ index = view.indexAt(QPoint(-1, 0));
+ QVERIFY(!index.isValid());
+ index = view.indexAt(QPoint(20, view.viewport()->rect().height()));
+ QVERIFY(!index.isValid());
+ index = view.indexAt(QPoint(20, -1));
+ QVERIFY(!index.isValid());
model.rCount = 30;
QListViewShowEventListener view2;