[Interest] Force QPainter color draw for SVG files?

wargand at gmx.de wargand at gmx.de
Mon Apr 16 00:57:02 CEST 2012


SVG is xml. Just load it into a QDomDocument and change the colour. 
If the SVG does not change too much, you could even do a search and
replace of the color values. There are many ways to achieve what you
want, forcing the QPainter to use a certain colour when rendering a SVG
image... I am not so sure about that.

Btw... SVG isn't the most resource friendly format. 

Guido


On Sun, Apr 15, 2012 at 02:45:37PM +0200, jaume dominguez faus wrote:

> Hi list.
>
> I guess the answer is "No". But maybe.... is it possible to force
> QPainter to paint only in, say "red", when I'm rendering a SVG
> that is black?  Imagine that you have a set of symbols in SVG
> files similar to a font characters, and you want to paint them in
> different colors when they are selected. Is it possible to do it
> without making the "selected version" of each SVG file?
>
> Thanks.
> ____________________________________________________________________
> Interest mailing list Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list