PDA

View Full Version : QGrapchisSvgItem childItems list empty



Hogwarts
5th April 2011, 15:58
I managed to create a QGraphicsSvgItem to render the contents of SVG file. Now, this file has several elements within it, but when I access the childItems() function that returns a list of this QGraphicsSvgItem's children, the length of this list is 0. This was unexpected. To access all elements of a SVG file(each one of them separately), I must to load each one separately?? I mean, I need to create a QGraphicsSvgItem for each graphic element of the svg file and display them in a interactive QGraphicsView.
Any Idea?
Sorry my English and thanks in advanced!

JohannesMunk
6th April 2011, 12:18
Yes, you need to specifiy which element your item should represent. But you can use a shared QSvgRenderer if I understand the documentation correctly:

http://doc.trolltech.com/latest/qgraphicssvgitem.html#details

Joh