diff options
author | Thorbjørn Lund Martsum <tmartsum@gmail.com> | 2012-10-27 18:31:34 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-31 00:03:22 (GMT) |
commit | 46d033ea478d472c9dda8b0b8a0890299d6cd823 (patch) | |
tree | eb40e23e6d967cc517eac8b36d9fb96162871660 /src | |
parent | 236ed9a2a70510a0abb4ad89ba03959c685bd397 (diff) | |
download | Qt-46d033ea478d472c9dda8b0b8a0890299d6cd823.zip Qt-46d033ea478d472c9dda8b0b8a0890299d6cd823.tar.gz Qt-46d033ea478d472c9dda8b0b8a0890299d6cd823.tar.bz2 |
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')
-rw-r--r-- | src/gui/itemviews/qheaderview.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index c28656a..3c9ff8b 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); |