summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2011-12-14 21:26:49 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-15 15:39:24 +0100
commit3bb0c88de8894fc05ad1558b96ae05ceeff64b78 (patch)
tree7b27fa0f7d9ff74f2a91d7d353023c4837ed7199 /src/widgets
parentf9516e4c8e90995a01ab3b5b892c98ca9c4880fd (diff)
QHeaderView - no big update work if updates are disabled
There is no reason to find out where to update the headerview if updates aren't enabled. Another approch I considered to skip the whole calculation and just call update. I seriosly doubt that this calculation and update of a particular QHeaderView rect will normally(*) be faster than just updating everything. However to be safe I have done the conservative fix. (*) Normally but with many/fragmented spans in the headerview. Change-Id: Ia812a747ee825653db0345cdc34f9d2f7155ea01 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/itemviews/qheaderview.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 8ecbdeb8bd..76529fcda3 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -887,6 +887,11 @@ void QHeaderView::resizeSection(int logical, int size)
if (size != oldSize)
d->createSectionSpan(visual, visual, size, d->headerSectionResizeMode(visual));
+ if (!updatesEnabled()) {
+ emit sectionResized(logical, oldSize, size);
+ return;
+ }
+
int w = d->viewport->width();
int h = d->viewport->height();
int pos = sectionViewportPosition(logical);