summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-10-28 05:55:55 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-31 00:03:22 (GMT)
commitda113c065991f2e1d25fd507daf79f5aeb691522 (patch)
tree203784284ad21cae94de8952081c54b8ae687693 /src
parent4ccc7ff70918f1fdbe37637aa72e02d5a90a6550 (diff)
downloadQt-da113c065991f2e1d25fd507daf79f5aeb691522.zip
Qt-da113c065991f2e1d25fd507daf79f5aeb691522.tar.gz
Qt-da113c065991f2e1d25fd507daf79f5aeb691522.tar.bz2
QHeaderView - fix minor bug in visualIndexAt
This fixes a minor bug in VisualIndex triggered when calling resizeSection with size 0 (but not hideSection). It is mostly cosmetics - but it is still a bug. This is a backport of SHA 73a5bc2aac7638438dfde260a4246359a06e89ae Change-Id: Ic3e1ce584d8befa501c670c085435248ebaa681b Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/itemviews/qheaderview.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp
index 4fa155a..65a8858 100644
--- a/src/gui/itemviews/qheaderview.cpp
+++ b/src/gui/itemviews/qheaderview.cpp
@@ -3488,8 +3488,8 @@ int QHeaderViewPrivate::headerVisualIndexAt(int position) const
const QHeaderViewPrivate::SectionSpan &currentSection = sectionSpans.at(i);
int next_span_start_section = span_start_section + currentSection.count;
int next_span_position = span_position + currentSection.size;
- if (position == span_position)
- return span_start_section; // spans with no size
+ if (position == span_position && currentSection.size > 0)
+ return span_start_section;
if (position > span_position && position < next_span_position) {
int position_in_span = position - span_position;
return span_start_section + (position_in_span / currentSection.sectionSize());