diff options
author | Thorbjørn Lund Martsum <tmartsum@gmail.com> | 2012-02-03 20:02:46 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-10 00:27:44 +0100 |
commit | 73a5bc2aac7638438dfde260a4246359a06e89ae (patch) | |
tree | 09bf7162ee468db9dd07ab1b500ad75c32c9c90c /src/widgets/itemviews | |
parent | 2b42987d0ad46e0d51088bf7787316d9e66a1f81 (diff) |
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 <stephen.kelly@kdab.com>
Diffstat (limited to 'src/widgets/itemviews')
-rw-r--r-- | src/widgets/itemviews/qheaderview.cpp | 4 |
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 ¤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()); |