summaryrefslogtreecommitdiffstats
path: root/tests/auto/qheaderview
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-04-17 14:33:00 +0200
committerThierry Bastian <thierry.bastian@nokia.com>2009-04-17 14:35:00 +0200
commitcd8ff7d5879c3f2a9738c6416aced6d2efb7d9d9 (patch)
tree411034ad4d9d9e3080626cedec7c2ccbcf79dca2 /tests/auto/qheaderview
parent0b67aaab0235289c90407a4994e7b23b5b865252 (diff)
Display error with QTableView with custom default row height
QHeaderView can sometimes display holes when using default row height Task-number: 248050 Reviewed-by: ogoffart
Diffstat (limited to 'tests/auto/qheaderview')
-rw-r--r--tests/auto/qheaderview/tst_qheaderview.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/qheaderview/tst_qheaderview.cpp b/tests/auto/qheaderview/tst_qheaderview.cpp
index 0867e48a2b..6478854def 100644
--- a/tests/auto/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/qheaderview/tst_qheaderview.cpp
@@ -187,6 +187,7 @@ private slots:
void emptySectionSpan();
void task236450_hidden_data();
void task236450_hidden();
+ void task248050_hideRow();
protected:
QHeaderView *view;
@@ -1919,5 +1920,28 @@ void tst_QHeaderView::task236450_hidden()
}
+void tst_QHeaderView::task248050_hideRow()
+{
+ //this is the sequence of events that make the task fail
+ protected_QHeaderView header(Qt::Vertical);
+ QStandardItemModel model(0, 1);
+ header.setStretchLastSection(false);
+ header.setDefaultSectionSize(17);
+ header.setModel(&model);
+ header.doItemsLayout();
+
+ model.setRowCount(3);
+
+ QCOMPARE(header.sectionPosition(2), 17*2);
+
+ header.hideSection(1);
+ QCOMPARE(header.sectionPosition(2), 17);
+
+ QTest::qWait(100);
+ //the size of the section shouldn't have changed
+ QCOMPARE(header.sectionPosition(2), 17);
+}
+
+
QTEST_MAIN(tst_QHeaderView)
#include "tst_qheaderview.moc"