SVG icons not showing up in Qt4 release build in windows

I have a Qt4 application with SVG icons, compiled with mingw (in windows), linked to Qt shared libraries.

When application is run, SVG icons show up in debug and release builds in linux, however in windows SVG icons show up only in debug build but not in release build.

All SVG icons are listed in project.qrc , and project.pro has RESOURCES = project.qrc . Application uses QtSvg4.dll (version 4.7.0).

Qt 4.7.0, Qt Creator 2.0.1, mingw/g++ 4.4.0.

Solution update: In application directory, create /imageformats/ directory and put qsvg4.dll there instead of application directory itself, or create a qt.conf file with appropriate path. More information in deploying plugins.


Most likely you will have to include the plugins from your qt dir. This involves making a qt.conf file that is local to your app (see here: http://doc.qt.io/qt-4.8/qt-conf.html , more specifically the [Paths] section), and copy c:Qt4.xxpluginsimageformats*.dll to your distributable's directory.


Based on what you've said, you're doing all that's needed for it to work, so a proper answer is likely to require some more information. See if these links are of any use to you:

http://lists.trolltech.com/qt-interest/2008-10/msg00655.html

http://www.qtcentre.org/archive/index.php/t-9036.html

In particular, make sure that the SVG plugin is getting loaded with:

QImageReader::supportedImageFromats()


For my (Qt 4.6.3) application, I solved this by putting the plug-in dll (qsvgicon4.dll) in a directory called iconengines within the application directory.

Tried other solutions - such as deploying plugin to directory (within app directory) named imageformats with and without an appropriate qt.conf, but no joy.

Note: I previously ran the application with Qt 4.7.0 dlls and had no problems on the same Win7 target machine.

链接地址: http://www.djcxy.com/p/49084.html

上一篇: 如何告诉CPAN(Perl)使用meta创建的包

下一篇: 在Qt4版本中没有显示SVG图标