Solved QPixmap not read svg
-
@Mikeeeeee said in QPixmap not read svg:
./images/logo.svg
this is a relative path. You should at least check whether pixmap is null or not: https://doc.qt.io/qt-5/qpixmap.html#isNull
Also, check whether you have the SVG plug-in: plugins/imageformats/libqsvg.so -
@jsulm but this work:
pixmap = QPixmap("./images/logo.png")
And I use Windows 10, Windows haven't .so. In conda I haven't file libqsvg. Hwot me need to do?
-
@Mikeeeeee said in QPixmap not read svg:
Hwot me need to do?
Search for *svg* in your PyQt set-up...
-
I have only SVGExporter.py in pyqtgraph
-
@Mikeeeeee So, no qsvg.dll? If so, then that's the reason why you can't load SVG images.
-
What should I do? How can I add the desired library to the сonda?
-
@Mikeeeeee Maybe you need to install the SVG plug-in? I never used conda, so check whether this plug-in requires an additional package to be installed.
-
-
@Mikeeeeee wrong way to load svg because you may lose resolution. You never scale a svg picture.
QPixmap * pixmap = new QPixmap( QSize( 200, 200 ) );
pixmap->fill( Qt::transparent );
paint pixmap with svg engine. -
@Mikeeeeee said in QPixmap not read svg:
What is the correct name of this plugin?
I already gave it you before: qsvg.dll
-
I reinstall conda and after its work