[Qt-interest] Change Svg attribute

Jason H scorp1us at yahoo.com
Thu Apr 1 14:19:42 CEST 2010


I suggest loading it as a QByteArray/QString and replacing the color or whatever using QString's or QByteArray's ::replace(), then load that.





----- Original Message ----
From: Guido Seifert <Wargand at gmx.de>
To: qt-interest at trolltech.com
Sent: Thu, April 1, 2010 5:07:40 AM
Subject: Re: [Qt-interest] Change Svg attribute



No example, but I did it. What does _NOT_ work, is loading the svg file into a QDomDocument, somehow it gets corrupted this way.
(http://bugreports.qt.nokia.com/browse/QTBUG-7178)
Too bad, this would allow to use all the Qt xml magic on an svg file.

What you can do is a simple search and replace of your attributes.
Not very efficient or elegant, but for many cases good enough. When you create
your svg file, make sure your attributes have names. Makes it much more easy to identify the attribute you want to change.


Regards,
Guido


> Hello,
> 
> Someone have already try to change an attribute in an svg file by using 
> qt (perhaps QtSvgRenderer) ?
> If somebody have an example , i take it.

-- 
NEU: GMX DSL für 19,99 EUR/mtl. und ohne Mindest-Laufzeit!
http://portal.gmx.net/de/go/dsl02
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest



      




More information about the Qt-interest-old mailing list