Qt Creator - 如何为 ubuntu linux 设置应用程序图标?

发布于 2024-10-06 00:46:32 字数 342 浏览 4 评论 0原文

我看到了原来的问题 qt-creator-how-to-set-application-图标

但它对我没有帮助,因为我正在 ubuntuQt 文档 我不清楚..

有谁做过吗? 方法是什么?

提前致谢。

I have seen the original question qt-creator-how-to-set-application-icon

but it did not help me because i am building an app in ubuntu and the Qt`s Documentation
is not clear for me..

Is there anynone, who has done it?
Whats the method?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

指尖上得阳光 2024-10-13 00:46:32

Linux 没有任何读取嵌入式资源的标准,因此无法将图标嵌入到应用程序二进制文件本身中并将其显示在菜单和启动器中。您必须将图标安装在相应的pixmaps 目录中,并在相应的apps 目录中安装指向您的应用程序和相应图标的.desktop 文件。

您引用的 Qt 文档引用了 图标主题规范,它描述了文件应该在哪里被安装。查找最后的安装应用程序图标以获取需要完成的操作的摘要。

您必须在构建系统(qmake 或 cmake 或您使用的系统)的“安装”目标中安装这些文件,并可能在此基础上创建一个 Debian 软件包。 Qt Creator 不太可能帮助您解决这些问题。

Linux does not have any standard for reading embedded resources, so there is no way to embed the icon in the application binary itself and have it display in the menu and launcher. You will have to install your icon in the appropriate pixmaps directory and a .desktop file in appropriate apps directory pointing to your application and respective icon.

The Qt documentation you quoted refers to icon theme specification, which describes where the files should be installed. Look for the Installing Application Icons towards the end for summary of what needs to be done.

You will have to install the files in the "install" target of your build system (qmake or cmake or what you use) and possibly create a Debian package on top of that. The Qt Creator is unlikely to help you with these.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文