[PyQt] QGraphisView performance

Nahuel Defossé nahueldefosse at yahoo.com.ar
Sat Nov 22 05:35:31 GMT 2008


Hi,
I'm trying to display a map on a QGraphicsView widget having some scrolling 
and zooming. I need very basic interaction, add points, remove points, maybe 
a contextual menu. The issue I'm experiencing is that zooming and scrolling 
when on high zoom values is SLOW. 
For zooming I use view.setMatrix(QtGui.QMatrix().scale(factor, factor)) where 
factor > 1)
At first I tried to show directly the map I converted from a DFX file, a big 
SVG, using QtSvg.QGraphicsSvgItem but it was big and I knew it was gonna take 
a lot of CPU, it did. Then I tried with a pixmap, PNG 150k, which works 
better when no zoom is applied but starts to sorely degrade as the zoom 
factor raises.
I don't understand which is the best approach to achieve acceptable 
performance when you have to show big areas on this kind of canvas.
I'd highly appreciate any hints
Thanks
Nahuel


More information about the PyQt mailing list