From 6cab0bed1d9563628423943cbdae97e1703eacf1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thorbj=C3=B8rn=20Lund=20Martsum?= Date: Thu, 15 Dec 2011 08:11:16 +0100 Subject: [PATCH] QHeaderView - Do not try to remove non-existing section The end parameter passed to removeSectionsFromSpans is off by one. removeSectionsFromSpans can currently handle/ignore it, but it is still wrong. Change-Id: I9148bd106504a37a5c8fd72928ab84c669eebcdb Reviewed-by: Stephen Kelly --- src/widgets/itemviews/qheaderview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index 83c4fd0..33c8da4 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -1940,7 +1940,7 @@ void QHeaderView::initializeSections(int start, int end) if (end + 1 < d->sectionCount) { int newCount = end + 1; - d->removeSectionsFromSpans(newCount, d->sectionCount); + d->removeSectionsFromSpans(newCount, d->sectionCount - 1); if (!d->hiddenSectionSize.isEmpty()) { if (d->sectionCount - newCount > d->hiddenSectionSize.count()) { for (int i = end + 1; i < d->sectionCount; ++i) -- 2.7.4