PDA

View Full Version : rendering svg using QGraphicsSVGItem slows doen the performance



sanjayshelke
31st August 2009, 08:46
Hi,

I have created application using graphicaview architecture. I can create several different items on the view.
Items can be movable, focusable. But when i create svg item by using QGraphicsSvgItem, performance of the application slows down.
This happens specially with the large svg files.

Any idea how to imrove the performance.

regards,
~Sanjay

wysota
31st August 2009, 09:13
Yes - don't use SVG files.

sanjayshelke
31st August 2009, 11:07
Thanks.

But we also need to scale the items. So if we use the images like .png, that will be at the cost of quality.

where as scaling the svg preserve the quality of the image.

wysota
31st August 2009, 11:17
Well... you can't have both speed and agility, unfortunately. The only thing you can do is to enable caching for your svg items. Use QGraphicsItem::DeviceCoordinateCache.

Amargedon
1st September 2009, 06:52
If you have a videocard; use a QGLWidget as viewport in you're GraphicsView (setViewport()) and not a normal QWidget.