summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/itemviews')
-rw-r--r--src/widgets/itemviews/qheaderview.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index c90a61d4ff..edef2e9bf8 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -2168,15 +2168,19 @@ void QHeaderViewPrivate::_q_sectionsAboutToBeChanged()
sectionItems[visual].size = lastSectionSize;
}
for (int i = 0; i < sectionItems.size(); ++i) {
- const auto &s = sectionItems.at(i);
+ auto s = sectionItems.at(i);
// only add if the section is not default and not visually moved
if (s.size == defaultSectionSize && !s.isHidden && s.resizeMode == globalResizeMode)
continue;
+ const int logical = logicalIndex(i);
+ if (s.isHidden)
+ s.size = hiddenSectionSize.value(logical);
+
// ### note that we are using column or row 0
layoutChangePersistentSections.append({orientation == Qt::Horizontal
- ? model->index(0, logicalIndex(i), root)
- : model->index(logicalIndex(i), 0, root),
+ ? model->index(0, logical, root)
+ : model->index(logical, 0, root),
s});
if (layoutChangePersistentSections.size() > 1000)