SVG file not loading qt 5.6.2 Windows
-
wrote on 28 Jan 2021, 17:18 last edited by dushabest85
QPixmap pix; auto result = pix.load(":/refresh_.svg"); qDebug()<<result; ui->label->setPixmap(QPixmap(":/refresh_.svg"));
Result = false and error QPainter::begin: Paint device returned engine == 0, type: 3
Hello. Why won't the file loading? Help please!
https://yadi.sk/d/UKsI8B-HHFTlfg - project qt
https://yadi.sk/i/QvP2kYJeO4VYZg - file refresh_.svg -
Hi and welcome to devnet,
Did you add "QT += svg" to your .pro file ?
-
wrote on 31 Jan 2021, 05:49 last edited by
Yes. The program works in 5.14 and does not work in 5.6
-
Do you have that issue only with this SVG file or with others as well ?
Check with the examples that comes with the SVG module from 5.6.
-
wrote on 31 Jan 2021, 08:05 last edited by
I have two kinds of svg files. The first file with an additional layer (refresh_.svg) and the second file without an additional layer. I cannot find in the documentation why the file with the additional layer is not loaded.
-
-
wrote on 31 Jan 2021, 10:50 last edited by
The description https://doc.qt.io/archives/qt-5.6/svgrendering.html is the same for 5.6 and 5.14. I read the description but found no difference. However 5.6 does not work and 5.14 does ...
-
Lifetime Qt Championwrote on 31 Jan 2021, 11:00 last edited by Christian Ehrlicher
But there are still a lot of misc changes to this module. Maybe one of them affects your svg file. Don't use such an ancient Qt version. Are you sure the Qt svg plugin is available in the imageformats plugins subdir?
-
wrote on 31 Jan 2021, 11:32 last edited by dushabest85
Yes, svg is available in the catalog. I am using this old version because the program must work Windows XP
-
Then you have to debug by yourself why it won't load.
-
wrote on 31 Jan 2021, 11:48 last edited by
Is the exact reason unknown? Maybe this is a bug in this case...
-
Is the exact reason unknown? Maybe this is a bug in this case...
@dushabest85 I won't dig into ancient QtSvg sources for you to search for an error. You have to do it by your own.
-
wrote on 31 Jan 2021, 12:43 last edited by
Maybe some other person knows the answer? Why is the error QPainter :: begin: Paint device returned engine == 0, type: 3?
-
@dushabest85 I won't dig into ancient QtSvg sources for you to search for an error. You have to do it by your own.
wrote on 31 Jan 2021, 12:57 last edited by@Christian-Ehrlicher Thank you!
1/14