[Qt-interest] QGraphicsView with QGraphicsSvgItem works slowly

franki franki at franki.eu.org
Sat Sep 24 11:05:58 CEST 2011


Hi,

I have QGraphicsView with QGraphicsScene and there is background image which 
is much larger than view, so image is scrolled by applying QTransform to it. 
When on this background image there are other QGraphicsItems (mostly 
QGraphicsPixmapItem, more or less 10 objects visible) scrolling goes 
smoothly. But when I implemented QGraphicsSvgItem instead of pixmap's 
scrolling goes with hitches (not smoothly) I tested this on my Nokia N8, and 
as long as I remember I have 4.7.2 libraries installed on the phone, but 
recently IDE has updated itself to 4.7.3 (I'm using Linux), so at first I 
thought - some problem with library version?
But then I tested this on Qt Simulator and I can see that solution with svg 
objects uses up to 100% of cpu on my laptop (when compiled with 4.7.3), 
wheres with pixmaps it takes a few percent at most.
So my question is: Is this what I should expect with svg objects, I mean much 
more cpu usage, or is there some problem with my code or something else? I've 
tried QSvgRenderer one for all objects or one object - one renderer, but 
there is no difference in preformance.

best regards
Marek



More information about the Qt-interest-old mailing list