summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-03-10 16:47:02 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-20 11:44:09 +0100
commitfcc01e6c3736991db2191c151111f03016d2d80b (patch)
tree6934024b0333968ba7ba8c8177afa5b79f6bc5d0 /src/widgets
parent07ff7fe52c25a1fde5f56b8a63f0d838f243b422 (diff)
QHeaderView - minor fix to setDefaultSectionSize
This fixes a situation where we (wrongly) assume that a section with size 0 is hidden. However a hidden section should be one that we have called hideSection (or setSectionHidden) on. Change-Id: Ic14eded2666022f27434dc55927323a74910549c Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/itemviews/qheaderview.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 4975e72260..e82cd477c5 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -3339,8 +3339,7 @@ void QHeaderViewPrivate::setDefaultSectionSize(int size)
defaultSectionSize = size;
for (int i = 0; i < sectionSpans.count(); ++i) {
QHeaderViewPrivate::SectionSpan &span = sectionSpans[i];
- if (span.size > 0) {
- //we resize it if it is not hidden (ie size > 0)
+ if (sectionHidden.isEmpty() || !sectionHidden.testBit(i)) { // resize on not hidden.
const int newSize = size;
if (newSize != span.size) {
length += newSize - span.size; //the whole length is changed