From: Thorbjørn Lund Martsum Date: Thu, 15 Mar 2012 15:38:59 +0000 (+0100) Subject: QHeaderView - minor fix to createSectionSpan X-Git-Tag: qt-v5.0.0-alpha1~194 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07ff7fe52c25a1fde5f56b8a63f0d838f243b422;p=profile%2Fivi%2Fqtbase.git 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 --- diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index 425eb4c..4975e72 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);