From 73a5bc2aac7638438dfde260a4246359a06e89ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lund=20Martsum?= Date: Fri, 3 Feb 2012 20:02:46 +0100 Subject: QHeaderView - 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 - however hopefully there will soon be a minor refactoring and there is really no need to make strange code to keep a semantic bug. However it is also doubtful to make a semantic change while refactoring. Change-Id: Ide153e421fd7a634062cb74867f4a49da4bf9cd6 Reviewed-by: Stephen Kelly --- src/widgets/itemviews/qheaderview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets') 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 ¤tSection = 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()); -- cgit v1.2.3