Valmond
Valmond

Reputation: 2969

Images in svg file doesn't show up in Qt

I'm trying to display a svg image with Qt and it works well except that any image (.gif, .bmp, ...) in the svg image doesn't show up (lines, circles, texts works OK).

If I open the svg in firefox the image displays correctly.

I have put qgif4.dll in a folder imageformats and QtSvg4.dll besides the executable but to no avail.

I'm displaying the svg with the help of svgview.h/.cpp and I'm running on a WinXP machine (Qt version 4.7.2).

Any help greatly appreciated!

Upvotes: 2

Views: 987

Answers (1)

cmannett85
cmannett85

Reputation: 22346

If you are loading it via a QIcon, it should work without assistance.

If you are trying to load it using a QPixmap or QImage - you can't. You have to use QSvgRenderer (or the related classes) in the svg module to rasterise the data.

Upvotes: 2

Related Questions