diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-02-01 21:00:55 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-02-01 21:00:55 +0100 |
commit | dcd5cb973622d059818dba1a2c7b9a7b7601a14c (patch) | |
tree | fbda1c8c6d36cae42b084f7298cf5b1904e21e9f /tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp | |
parent | f299b565b5904e39a47b6133643448e46810f0ed (diff) | |
parent | ff68e5d667cc62141f177d01f747a62c95f08d3e (diff) |
Merge remote-tracking branch 'gerrit/dev' into HEAD
Diffstat (limited to 'tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp')
-rw-r--r-- | tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp index e5e9b87df4..29e4bbfe29 100644 --- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp @@ -151,6 +151,7 @@ private slots: void taskQTBUG_7232_AllowUserToControlSingleStep(); void taskQTBUG_51086_skippingIndexesInSelectedIndexes(); void expandingListItems(); + void taskQTBUG_47694_indexOutOfBoundBatchLayout(); }; // Testing get/set functions @@ -1488,7 +1489,7 @@ void tst_QListView::task203585_selectAll() //we make sure that "select all" doesn't select the hidden items QListView view; view.setSelectionMode(QAbstractItemView::ExtendedSelection); - view.setModel(new QStringListModel( QStringList() << "foo")); + view.setModel(new QStringListModel(QStringList() << "foo", &view)); view.setRowHidden(0, true); view.selectAll(); QVERIFY(view.selectionModel()->selectedIndexes().isEmpty()); @@ -2510,5 +2511,18 @@ void tst_QListView::expandingListItems() QVERIFY(w.visualRect(item1->index()).width() < w.visualRect(item2->index()).width()); } +void tst_QListView::taskQTBUG_47694_indexOutOfBoundBatchLayout() +{ + QListView view; + view.setLayoutMode(QListView::Batched); + int batchSize = view.batchSize(); + + QStandardItemModel model(batchSize + 1, 1); + + view.setModel(&model); + + view.scrollTo(model.index(batchSize - 1, 0)); +} + QTEST_MAIN(tst_QListView) #include "tst_qlistview.moc" |