qtsvgqpixmap

QPixmap and SVG


How would you suggest to handle svg with QPixmap?

The construct QPixmap(":/myfile.svg"); then call of scaled() does not work. The QPixmap gets pixelised.

Thx.


Solution

  • You should use SVGRenderer to render it onto a QImage. From there you can convert to a QPixmap with QPixmap::convertFromImage.