diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-11-04 18:43:00 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-11-08 16:54:12 +0000 |
commit | 8713f22372b7aa63ecafbe87214b8994203fac5f (patch) | |
tree | 469f4ada05dd6d540fdba308dd4d669d8e32f388 /src/widgets/itemviews/qheaderview.cpp | |
parent | 63967313f57add6517cdc50b8a77fa319a2b7df0 (diff) |
QHeaderView: Fix updating hidden sections during initializeSections()
QHeaderView::initializeSections() was calling updateHiddenSections()
with wrong parameters which lead to an inconsistency in the hidden
section handling.
updateHiddenSections() needs the first and last index which got removed.
Therefore we must pass the new section count for logicalFirst.
Fixes: QTBUG-55461
Change-Id: Ica06125cf19bdd500f55fd9cd59ace1795f3703f
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/widgets/itemviews/qheaderview.cpp')
-rw-r--r-- | src/widgets/itemviews/qheaderview.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index b7de69d63a..e9091ca1a2 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -2321,9 +2321,10 @@ void QHeaderView::initializeSections() if (stretchLastSection()) // we've already gotten the size hint d->maybeRestorePrevLastSectionAndStretchLast(); - //make sure we update the hidden sections + // make sure we update the hidden sections + // simulate remove from newCount to oldCount if (newCount < oldCount) - d->updateHiddenSections(0, newCount-1); + d->updateHiddenSections(newCount, oldCount); } } |