Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.6.1
-
None
-
011d3aa2bdf49127169f0726b78e13e8e9bcd73e
Description
1. create a graphics widget tree
2. show it -> polish is called
current result:
for every polished widget in the hierarchy, the font changed event is sent.
expected result:
font change event is called only when the font is really changed.
in the QGraphicsWidget the polish event calls.
case QEvent::Polish:
polishEvent();
d->polished = true;
d->updateFont(d->font);
break;
this update font is propagated all the children with:
case QEvent::FontChange:
update();
updateGeometry();
break;
even though the font is not even changed. The updateGeometry() will cause the sizeHint cache clearing, which is expensive operation.
See the attached simple application. The font is stored every time the font change event is received. At the end, the current font is compared to the ones that was "changed" on the fly. The result: they all are the same.
Tested with Qt4.6tp1.