summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qheaderview.cpp
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-01-18 15:34:06 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-30 06:29:42 +0100
commit125016ad241125176e5bebab94eebcf50fac20bc (patch)
tree9d0b37b2462fcf544acb65ef1679d84a8309acbc /src/widgets/itemviews/qheaderview.cpp
parent5635823e17db3395d9b0fa8cfcc72f82fea583f4 (diff)
QHeaderView - length returns wrong value fix
setSectionHidden called with (logindex, true) will sometimes prevent a (correct) call to resizeSection(logicalIndex, 0). This seems a bit odd - 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. Task-number: QTBUG-14242 Change-Id: Ia1d2f6db3213792b250a6a37942b56554261cd3a Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src/widgets/itemviews/qheaderview.cpp')
-rw-r--r--src/widgets/itemviews/qheaderview.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 660570bb80..af83fb90ce 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -517,6 +517,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;
}