PDA

View Full Version : Rendering SVG on a paint event



Luc4
30th March 2010, 13:09
Hi! I'm trying to paint a SVG in a QGraphicsItem in the paint event. I did it this way:

QSvgRenderer svg(QString("SCD_shadow.svg"), this);
svg.render(painter);
Unfortunately nothing is rendered. I also tried with a specific rect, but still nothing is rendered. Any idea why? I tried to build a QSvgWidget and it works fine.
Thanks for any advice!

Lykurg
30th March 2010, 13:44
Make sure your path is valid!

Luc4
31st March 2010, 10:42
Seems it was some kind of problem with separators with different OSes. The code on SVG is ok. Sorry for the question. Thanks!