summaryrefslogtreecommitdiffstats
path: root/tests/auto/qlistview
diff options
context:
space:
mode:
authorAndy Shaw <qt-info@nokia.com>2009-09-04 09:06:08 (GMT)
committerAndy Shaw <qt-info@nokia.com>2009-09-04 09:06:08 (GMT)
commit991b6bc973238a6fd73c4c71e7c642b8cc455df3 (patch)
treea0d04d3c9513bf1d6be10df60068cbc1987bca76 /tests/auto/qlistview
parentd22b55d3159c001dc6b37422cefbec6775996494 (diff)
downloadQt-991b6bc973238a6fd73c4c71e7c642b8cc455df3.zip
Qt-991b6bc973238a6fd73c4c71e7c642b8cc455df3.tar.gz
Qt-991b6bc973238a6fd73c4c71e7c642b8cc455df3.tar.bz2
Fix a regression with QListView::setRowHidden() when a root index is set
When setRowHidden() was called after a root index was set then it would not actually hide the row, if a root index is not set then it worked fine. Task-number: 260879 Reviewed-by: Jan-Arve
Diffstat (limited to 'tests/auto/qlistview')
-rw-r--r--tests/auto/qlistview/tst_qlistview.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp
index b52bef0..27c6a05 100644
--- a/tests/auto/qlistview/tst_qlistview.cpp
+++ b/tests/auto/qlistview/tst_qlistview.cpp
@@ -417,6 +417,18 @@ void tst_QListView::hideRows()
view.setRowHidden(0, false);
QVERIFY(!view.isRowHidden(0));
+ QStandardItemModel sim(0);
+ QStandardItem *root = new QStandardItem("Root row");
+ for (int i=0;i<5;i++)
+ root->appendRow(new QStandardItem(QString("Row %1").arg(i)));
+ sim.appendRow(root);
+ view.setModel(&sim);
+ view.setRootIndex(root->index());
+ QVERIFY(!view.isRowHidden(0));
+ view.setRowHidden(0, true);
+ QVERIFY(view.isRowHidden(0));
+ view.setRowHidden(0, false);
+ QVERIFY(!view.isRowHidden(0));
}