summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/itemviews')
-rw-r--r--src/widgets/itemviews/qheaderview.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 33c8da4f69..85d9ff0ce6 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -3496,8 +3496,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());