summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-10-20 13:52:38 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-10-20 13:52:38 (GMT)
commit77f055ab9474ec4d3311884c293af7ee4a2a7cb3 (patch)
tree9b2b239608c01da1715f6a9e85668eda83c519f7 /tests
parente64b5fa1312f42fa6377e28c11f8aa3a3413280f (diff)
downloadQt-77f055ab9474ec4d3311884c293af7ee4a2a7cb3.zip
Qt-77f055ab9474ec4d3311884c293af7ee4a2a7cb3.tar.gz
Qt-77f055ab9474ec4d3311884c293af7ee4a2a7cb3.tar.bz2
Fixed QTreeView trying to animate when parent item has no child
We now check that the item has children before animating. Reviewed-by: Alexis
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index 91b2cc5..da58725 100644
--- a/tests/auto/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/qtreeview/tst_qtreeview.cpp
@@ -172,6 +172,7 @@ private slots:
void expandAndCollapse_data();
void expandAndCollapse();
void expandAndCollapseAll();
+ void expandWithNoChildren();
void keyboardNavigation();
void headerSections();
void moveCursor_data();
@@ -1548,6 +1549,19 @@ void tst_QTreeView::expandAndCollapseAll()
// QCOMPARE(collapsedSpy.count(), count);
}
+void tst_QTreeView::expandWithNoChildren()
+{
+ QTreeView tree;
+ QStandardItemModel model(1,1);
+ tree.setModel(&model);
+ tree.setAnimated(true);
+ tree.doItemsLayout();
+ //this test should not output warnings
+ tree.expand(model.index(0,0));
+}
+
+
+
void tst_QTreeView::keyboardNavigation()
{
const int rows = 10;