summaryrefslogtreecommitdiffstats
path: root/src
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 /src
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 'src')
-rw-r--r--src/widgets/itemviews/qheaderview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 213cc96b03..3af191b06c 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -3364,7 +3364,7 @@ void QHeaderViewPrivate::resizeSections(QHeaderView::ResizeMode globalMode, bool
// because it isn't stretch, determine its width and remove that from lengthToStretch
int sectionSize = 0;
if (resizeMode == QHeaderView::Interactive || resizeMode == QHeaderView::Fixed) {
- sectionSize = headerSectionSize(i);
+ sectionSize = qBound(q->minimumSectionSize(), headerSectionSize(i), q->maximumSectionSize());
} else { // resizeMode == QHeaderView::ResizeToContents
int logicalIndex = q->logicalIndex(i);
sectionSize = qMax(viewSectionSizeHint(logicalIndex),