I had a HUGE performance issue and wasn't sure what was causing it, I eventually narrowed it down to a QPainterPath boundingRect() issue.
I had a QGraphicsItem subclasses line which drew its line with a QPainterPath. So in the subclassed class's boundingRect() function I called mypath.boundingRect(). Turns out that thats a really slow call!.
Saving the results to a QRectF had a drastic impact on performance.
Why doesn't it internally cache the bounding rect if its computation is complex?
Bookmarks