summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtreeview
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-04-16 08:12:18 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-04-16 08:15:23 (GMT)
commitd43d33eb3121519d0025ad433d5c186365c47ef6 (patch)
tree55457fb6c15295de668c545a88c3c377ce3fd0ac /tests/auto/qtreeview
parent3eeb244251fd3bbfa3c3f421f1362986100d7587 (diff)
downloadQt-d43d33eb3121519d0025ad433d5c186365c47ef6.zip
Qt-d43d33eb3121519d0025ad433d5c186365c47ef6.tar.gz
Qt-d43d33eb3121519d0025ad433d5c186365c47ef6.tar.bz2
QTreeView automatic resize can be broken
QTreeView sometimes autoresizes the wrong column Task-number: 210390 Reviewed-by: janarve
Diffstat (limited to 'tests/auto/qtreeview')
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index dfccd9e..a96dbac 100644
--- a/tests/auto/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/qtreeview/tst_qtreeview.cpp
@@ -225,6 +225,7 @@ private slots:
void task238873_avoidAutoReopening();
void task244304_clickOnDecoration();
void task246536_scrollbarsNotWorking();
+ void task250683_wrongSectionSize();
};
class QtTestModel: public QAbstractItemModel
@@ -3279,5 +3280,22 @@ void tst_QTreeView::task246536_scrollbarsNotWorking()
QVERIFY(o.count > 0);
}
+
+void tst_QTreeView::task250683_wrongSectionSize()
+{
+ QDirModel model;
+ QTreeView treeView;
+ treeView.header()->setResizeMode(QHeaderView::ResizeToContents);
+ treeView.setModel(&model);
+ treeView.setColumnHidden(2, true);
+ treeView.setColumnHidden(3, true);
+
+ treeView.show();
+ QTest::qWait(100);
+
+ QCOMPARE(treeView.header()->sectionSize(0) + treeView.header()->sectionSize(1), treeView.viewport()->width());
+}
+
+
QTEST_MAIN(tst_QTreeView)
#include "tst_qtreeview.moc"