summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-10-27 20:31:34 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-31 01:03:22 +0100
commit46d033ea478d472c9dda8b0b8a0890299d6cd823 (patch)
treeeb40e23e6d967cc517eac8b36d9fb96162871660 /src/gui/itemviews
parent236ed9a2a70510a0abb4ad89ba03959c685bd397 (diff)
QHeaderView - no big update work if updates are disabled
This is not a major boost, but still a nice optimization that can speed up hideSection and resizeSection with about 40% if updates are disabled. It is backport of SHA 3bb0c88de8894fc05ad1558b96ae05ceeff64b78 and a5201007f255a07f7ba07981745eeaec41a14a34 Change-Id: I33b83940003c391e5dae549353a6beb27928f92a Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r--src/gui/itemviews/qheaderview.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp
index c28656ad96..3c9ff8bd83 100644
--- a/src/gui/itemviews/qheaderview.cpp
+++ b/src/gui/itemviews/qheaderview.cpp
@@ -887,6 +887,13 @@ void QHeaderView::resizeSection(int logical, int size)
if (size != oldSize)
d->createSectionSpan(visual, visual, size, d->headerSectionResizeMode(visual));
+ if (!updatesEnabled()) {
+ if (d->hasAutoResizeSections())
+ d->doDelayedResizeSections();
+ emit sectionResized(logical, oldSize, size);
+ return;
+ }
+
int w = d->viewport->width();
int h = d->viewport->height();
int pos = sectionViewportPosition(logical);