[Qt-interest] High CPU usage with QGraphicsPathItem

Deepak Chandran dchandran1 at yahoo.com
Thu Feb 26 17:46:31 CET 2009


I have noticed that the CPU usage goes high (rises from 0-3% to 30-50%) when I have a few (~ 2-3) QGraphicsPathItem objects drawn on the scene. The paths all contain beziers and their paths have been set using QPathStroker. This is not normal, is it? 

When debugging, I noticed that the path graphics items are constantly being redrawn, which would explain the issue. This is only happening for the path graphics items and not for other graphics items that I have drawn on the scene. The other graphics items are abstract shape items with beziers and other complex shapes as well, but they do not redraw themselves all the time. I tried overriding the boundingRect and sceneBoundingRect methods of QGraphicsPathItem so that they just return QRectF()  just to check whether the bounding rect is the problem. I also did painter->setClipRect( option->exposedRect ) in the paint method. The problem did not go away. 

Any ideas? 


Thanks.



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090226/7388b6f6/attachment.html 


More information about the Qt-interest-old mailing list