diff options
author | Liang Qi <liang.qi@qt.io> | 2017-05-31 08:11:36 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-05-31 08:11:37 +0200 |
commit | 7ee80242de2744790e5c35662c14594981f8586d (patch) | |
tree | 69eaa80e6f7ecb5906f2ce125beeecec3965886b /src/widgets/itemviews | |
parent | fa3940cc4b5580070f465d1f64a23a69bc925367 (diff) | |
parent | f6b36eaafec24b4c67efff621d380a4ca4257d0b (diff) |
Merge remote-tracking branch 'origin/5.9.0' into 5.9
Change-Id: I2d7a3f3a80e6287e135e55b650f74f9a540332bc
Diffstat (limited to 'src/widgets/itemviews')
-rw-r--r-- | src/widgets/itemviews/qheaderview.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index e0e993ce77..76f80c680e 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -3876,9 +3876,11 @@ bool QHeaderViewPrivate::read(QDataStream &in) const int currentCount = (orient == Qt::Horizontal ? model->columnCount(root) : model->rowCount(root)); if (newSectionItems.count() < currentCount) { // we have sections not in the saved state, give them default settings - for (int i = newSectionItems.count(); i < currentCount; ++i) { - visualIndicesIn.append(i); - logicalIndicesIn.append(i); + if (!visualIndicesIn.isEmpty() && !logicalIndicesIn.isEmpty()) { + for (int i = newSectionItems.count(); i < currentCount; ++i) { + visualIndicesIn.append(i); + logicalIndicesIn.append(i); + } } const int insertCount = currentCount - newSectionItems.count(); const int insertLength = defaultSectionSizeIn * insertCount; |