From 3bb0c88de8894fc05ad1558b96ae05ceeff64b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lund=20Martsum?= Date: Wed, 14 Dec 2011 21:26:49 +0100 Subject: 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 --- src/widgets/itemviews/qheaderview.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/widgets') 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); -- cgit v1.2.3