Details
-
Suggestion
-
Resolution: Done
-
P1: Critical
-
4.7.0
-
None
Description
Currently, the layout of QStaticText will be recalculated every time a integral piece of it is changed. There's potentially a lot of wasted cpu here in the initialization phases.
What we should rather do is invalidate the layout when integral parts are changed, and then recalculate it when needed, in QPainter::drawStaticText(). To allow people to shuffle the weight of the class over into less performance sensitive stages than the first paint event, add a function to explicitly ask for a new layout. This could be called prepare() or something similar (check what else is in Qt which is like this.) In addition, the current prepare() goes away, and is replaced by things such as setTransform() and setFont().