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>bb10
parent
f9516e4c8e
commit
3bb0c88de8
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue