From 12c2a3d85256abcc5a69f05a7504e01e72f24593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lund=20Martsum?= Date: Sun, 12 Feb 2012 21:11:04 +0100 Subject: QHeaderView - fix setOffsetToSectionPosition a bit It might be silly to have sections with size 0 without using hideSection. Nevertheless we should still use the principle of least surprise. It does not make sense that hiding a row 'far' away should affect the semantics of setOffsetToSectionPosition on lower indexes. Change-Id: Iaf847eba2ea4d28fc7bcfe3a27d62f432f6f61e0 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 c457f16a2c..ed71c5a918 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -3390,11 +3390,11 @@ int QHeaderViewPrivate::viewSectionSizeHint(int logical) const int QHeaderViewPrivate::adjustedVisualIndex(int visualIndex) const { - if (hiddenSectionSize.count() > 0) { + if (!sectionHidden.isEmpty()) { int adjustedVisualIndex = visualIndex; int currentVisualIndex = 0; for (int i = 0; i < sectionSpans.count(); ++i) { - if (sectionSpans.at(i).size == 0) + if (sectionHidden.testBit(i)) ++adjustedVisualIndex; else ++currentVisualIndex; -- cgit v1.2.3