Qt Creator - 如何为 ubuntu linux 设置应用程序图标?
我看到了原来的问题 qt-creator-how-to-set-application-图标,
但它对我没有帮助,因为我正在 ubuntu 和 Qt 文档 我不清楚..
有谁做过吗? 方法是什么?
提前致谢。
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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 appropriateapps
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.