summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2017-10-28 13:20:53 +0200
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2017-11-06 18:18:09 +0000
commitb4f4c384d9ee7cf93cc3db289a7d4275ac10a618 (patch)
tree7e0e63a5526ba1388fbb195f31944c7bad2af117 /tests
parent0445065645daab1dd9c328e52313646dcfcc80c2 (diff)
QHeaderView: Honor maximumSectionSize property during resizeSections()
Resizing a QTreeeView section with double click or resizeColumnToContents() does not respect the maximumSectionSize when the resize mode is Interactive or Fixed. Since the documentation of maximumSectionSize states that it should honor this property for those cases either the documentation or implementation is incorrect. This patch fixes the latter. Task-number: QTBUG-64036 Change-Id: Ic14c8e444d50b9c50a117efed19d0bca7ec1cf82 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
index b13e7b2f33..fa543ae2c3 100644
--- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
@@ -3006,6 +3006,7 @@ void tst_QHeaderView::stretchAndRestoreLastSection()
tv.setModel(&m);
tv.showMaximized();
+ const int minimumSectionSize = 20;
const int defaultSectionSize = 30;
const int someOtherSectionSize = 40;
const int biggerSizeThanAnySection = 50;
@@ -3013,6 +3014,9 @@ void tst_QHeaderView::stretchAndRestoreLastSection()
QVERIFY(QTest::qWaitForWindowExposed(&tv));
QHeaderView &header = *tv.horizontalHeader();
+ // set minimum size before resizeSections() is called
+ // which is done inside setStretchLastSection
+ header.setMinimumSectionSize(minimumSectionSize);
header.setDefaultSectionSize(defaultSectionSize);
header.resizeSection(9, someOtherSectionSize);
header.setStretchLastSection(true);