From 4ccc7ff70918f1fdbe37637aa72e02d5a90a6550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lund=20Martsum?= Date: Sun, 28 Oct 2012 06:23:08 +0100 Subject: QHeaderView - length returns wrong value fix setSectionHidden called with (logindex, true) will sometimes not do a (correct) call to resizeSection(logicalIndex, 0) at once. However it does execute d->doDelayedResizeSections(). Therefore the section is going to be hidden later. However it is a problem that the length meanwhile is wrong. (That is a value that is not the sum of the sections) This is fixed by execute updates before returning the length. This is a backport of SHA 125016ad241125176e5bebab94eebcf50fac20bc Task-number: QTBUG-14242 Change-Id: Ia1d2f6db3213792b250a6a37942b56554261cd3a Reviewed-by: Stephen Kelly --- src/gui/itemviews/qheaderview.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui/itemviews') diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index 3c9ff8bd83..4fa155a02c 100644 --- a/src/gui/itemviews/qheaderview.cpp +++ b/src/gui/itemviews/qheaderview.cpp @@ -509,6 +509,8 @@ void QHeaderView::setOffsetToLastSection() int QHeaderView::length() const { Q_D(const QHeaderView); + d->executePostedLayout(); + d->executePostedResize(); //Q_ASSERT(d->headerLength() == d->length); return d->length; } -- cgit v1.2.3