图标在其他计算机上消失

编程入门 行业动态 更新时间:2024-10-24 21:33:31
本文介绍了图标在其他计算机上消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用Qt Creator创建了一个程序,并使用发布模式进行编译。 我已经添加了所有必要的DLL,一切在我的电脑上运行良好。

I've created a program with Qt Creator and compiled it with the release mode. I've added all the necessary DLLs and everything runs fine on my computer.

问题是,当我从其他计算机启动程序时

The problem is that when I start the program from an other computer all the icons that I've included are not displayed, whereas everything looks fine on my computer.

这是从哪里来的?

编辑:图标加载到qrc文件...

The icons are loaded in a qrc file...

推荐答案

Qt对文件格式的支持插件。为了确保您的应用程序在非开发计算机上部署时能够正常工作,您必须确保您已部署了相关的插件。

Most of Qt's support for file formats relies on plugins. To ensure that your application works as expected when deploying it on non-development machines, you will have to make sure that you have also deployed the relevant plugins. If you haven't, the loading of files (ICO icons in this case) will simply fail silently.

在这种情况下,重要的插件是qico4.dll(如果没有,则加载文件(在这种情况下为ICO图标)你在Windows上)。

The plugin of importance in this case is qico4.dll (if you're on Windows).

官方Qt文档包含有关 Qt部署 Windows 和 Mc 。向下滚动到Qt插件的相关信息。

The official Qt documentation contains all the relevant information on Qt deployment for both Windows and Mac. Scroll down to the relevant information on Qt plugins.

作为一个快速解决方案,您可以创建一个名为 imageformats 包含您的可执行文件的文件夹的子目录,您复制qico4.dll到其中。

As a quick solution you could create a directory named imageformats as a subdirectory of the folder containing your executable, into which you copy the qico4.dll.

(注意:用户 @smerlin 表示这必须 plugins / imageformats 相对于可执行文件目录我似乎记得我的应用程序不需要额外的 plugins 目录,但我会更新我的答案,如果我发现这是真的情况下)。

(Note: user @smerlin says this has to be plugins/imageformats relative to your executable directory. I seem to recall that my applications did not require the extra plugins directory, but I'll update my answer should I find that this is indeed the case).

更多推荐

图标在其他计算机上消失

本文发布于:2023-11-11 18:00:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1579168.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图标   其他计算机

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!