summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews
diff options
context:
space:
mode:
authorArnaud Bienner <arnaud.bienner@gmail.com>2015-01-14 22:19:47 +0100
committerArnaud Bienner <arnaud.bienner@gmail.com>2015-01-20 10:30:54 +0100
commitbdcb3f9aab139e31849aec46088dce52ba7673eb (patch)
treeacff0e719a8847f09b4cfc2cf434afceb81a74bd /src/widgets/itemviews
parent2a86bf8ce018cdca3c9e93fb36102ae440d1a114 (diff)
QHeaderView: fix restoring Qt4 state.
When multiple sections were grouped together, sectionItem.size was the total size of grouped sections, not the size of one section. Task-number: QTBUG-40462 Change-Id: I401a1583dd30880ccf5b4c105a237d6563f212e8 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Diffstat (limited to 'src/widgets/itemviews')
-rw-r--r--src/widgets/itemviews/qheaderview.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index aad382ed49..6e8def1407 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -3727,12 +3727,14 @@ bool QHeaderViewPrivate::read(QDataStream &in)
QVector<SectionItem> newSectionItems;
for (int u = 0; u < sectionItemsIn.count(); ++u) {
int count = sectionItemsIn.at(u).tmpDataStreamSectionCount;
+ if (count > 0)
+ sectionItemsIn[u].size /= count;
for (int n = 0; n < count; ++n)
newSectionItems.append(sectionItemsIn[u]);
}
int sectionItemsLengthTotal = 0;
- foreach (const SectionItem& section, sectionItemsIn)
+ foreach (const SectionItem &section, newSectionItems)
sectionItemsLengthTotal += section.size;
if (sectionItemsLengthTotal != lengthIn)
return false;