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>
bb10
Thorbjørn Lund Martsum 2012-03-15 16:38:59 +01:00 committed by Qt by Nokia
parent add629d4f1
commit 07ff7fe52c
1 changed files with 3 additions and 1 deletions

View File

@ -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);