在Mac上设置图标与Qt [英] Setting icon on a Mac with Qt

查看:962
本文介绍了在Mac上设置图标与Qt的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如Qt-Documentation中所述,我使用icon-composer创建了我的图标文件。然后我在我的.pro文件中插入了以下行。

  ICON = 3D_Modell.icns 

编译时遇到以下错误:

 没有规则制作目标`../3D',需要由3D_Modell.app/Contents/Resources/3D_Modell.icns

Contents / Resources文件夹在哪里?
在哪里我放的icns文件。我已将其放入我的项目和所有cpp和h文件所在的文件夹。

解决方案

说明建议您可以添加手动创建图标:



  1. 为您的应用程序创建一个Info.plist文件(使用
    PropertyListEditor ,在Developer / Applications中找到)。

  2. 将.icns记录与Info.plist文件中的CFBundleIconFile记录
    (再次使用PropertyListEditor)相关联。

  3. 将Info.plist文件复制到应用程序包的Contents目录中。

  4. 将.icns文件复制到应用程序包的Contents / Resources目录中。


要从查找程序访问您的应用程序包,请右键单击您的应用程序,然后从上下文菜单中选择显示包内容。这将打开一个新的查找窗口,您可以从中导航到 / Contents / Resources /




$ b

编辑:



PropertyListEditor实用程序位于 Developer / Applications / Utilities / 。您可以使用它来打开您的应用程序包,并编辑plist(位于包的 / Contents / 文件夹中)。在编辑器中 CFBundleIconFile 项目有助于调用图标文件,但如果选择视图>显示原始键/可以看到实际的属性名称。




As described in the Qt-Documentation I have created my icon file with the icon-composer. Then I have inserted in my .pro-file the following line.

ICON = 3D_Modell.icns

While compiling I get the following error:

No rule to make target `../3D', needed by `3D_Modell.app/Contents/Resources/3D_Modell.icns'

Where is the Contents/Resources folder? Where exactly do I put the icns-file. I have put it into the folder where my project and all cpp and h files lie.

解决方案

The instructions suggest you can add the icon manually:

  1. Create an Info.plist file for your application (using the PropertyListEditor, found in Developer/Applications).
  2. Associate your .icns record with the CFBundleIconFile record in the Info.plist file (again, using the PropertyListEditor).
  3. Copy the Info.plist file into your application bundle's Contents directory.
  4. Copy the .icns file into your application bundle's Contents/Resources directory.

To get access to your application bundle from the finder, right-click on your application and select 'show package contents' from the context menu. This will open a new finder window from which you can navigate to /Contents/Resources/.

Hope this helps.

EDIT:

The PropertyListEditor utility is in Developer/Applications/Utilities/. You can use it to "open" your application bundle, and edit the plist (located in the bundle's /Contents/ folder). The CFBundleIconFile item is helpfully called Icon File in the editor, but if you select View > Show Raw Keys/Values you can see the actual property names.

这篇关于在Mac上设置图标与Qt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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