PDA

View Full Version : Accessing elements of a svg file



Hogwarts
21st February 2011, 16:29
There is any way of knowing all the elements of a svg file? What I need is given a svg file, know all the elements that it has (its identifiers), with the same hierarchical structure as these are, of course using any of the classes in the module QtSvg. Most importantly, edit these identifiers. Known once the structure, I want to form the tree of of the hierarchy.
Sorry my English and any help is welcome.
Thanks in advanced.

ChrisW67
21st February 2011, 22:49
An SVG file is just plain XML. There are XML manipulating tools in the QtXml (http://doc.qt.nokia.com/latest/qtxml.html) module. Either treat the SVG file as a whole using the QDomDocument or read it in a stream-like fashion using QXmlSimpleReader or QXmlReader

Hogwarts
22nd February 2011, 15:00
I already had found that solution, but I can't use any class of QtXml module. What I need is given a QGraphicsSvgItem object, access to all properties of this object, likewise, access the properties of the childs elements that are inside it.