summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-03-15 16:38:59 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-20 11:44:09 +0100
commit07ff7fe52c25a1fde5f56b8a63f0d838f243b422 (patch)
tree2dead56d17bfce1543b41fd2f9171b4d228c8c88 /src
parentadd629d4f16a536fc56d55727195e3247b621a54 (diff)
QHeaderView - minor fix to createSectionSpan
I am unsure if this is only theoretic - but if/when we have added sections here - we must ensure that we recalculate startpositions. Change-Id: I70bf55209f1a1a885cb49748b65218879bc68776 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src')
-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 425eb4cd95..4975e72260 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -3172,8 +3172,10 @@ void QHeaderViewPrivate::resizeSections(QHeaderView::ResizeMode globalMode, bool
void QHeaderViewPrivate::createSectionSpan(int start, int end, int size, QHeaderView::ResizeMode mode)
{
int sizePerSection = size / (end - start + 1);
- if (end >= sectionSpans.count())
+ if (end >= sectionSpans.count()) {
sectionSpans.resize(end + 1);
+ sectionStartposRecalc = true;
+ }
SectionSpan *sectiondata = sectionSpans.data();
for (int i = start; i <= end; ++i) {
length += (sizePerSection - sectiondata[i].size);