SVG图标不显示在Qt4发布构建在Windows中 [英] SVG icons not showing up in Qt4 release build in windows

查看:570
本文介绍了SVG图标不显示在Qt4发布构建在Windows中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有SVG图标的Qt4应用程序,使用mingw编译(在Windows中),链接到Qt共享库。

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

运行应用程序时,SVG图标显示在调试和发布构建在linux,但在Windows SVG图标只显示在调试生成,但不是在发行版。

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.

所有SVG图标列在 project.qrc project.pro 具有 RESOURCES = project.qrc 。应用程序使用QtSvg4.dll(版本4.7.0)。

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。

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

解决方案更新:在应用程序目录中,创建/ imageformats /目录,并将qsvg4.dll放入其中,而不是应用程序目录本身,或创建 qt.conf 文件中。有关部署插件的详情,请参阅

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.

推荐答案

很可能你必须包括你的qt dir的插件。这涉及到为您的应用程序本地的qt.conf文件(请参阅此处: http ://doc.qt.io/qt-4.8/qt-conf.html ,更确切地说是[Paths]部分),并复制c:\Qt\4.xx\plugins\imageformats * .dll到您的可分发目录。

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:\Qt\4.x.x\plugins\imageformats*.dll to your distributable's directory.

这篇关于SVG图标不显示在Qt4发布构建在Windows中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆