3

Following up on this answer to this question, I would like a clear, step-by-step set of instructions on how to set the application icon for a Qt application on OS X sufficient for distribution of the application via an installer and/or through the App Store.

The instructions should include how to set the four sizes of the icon, as referenced in the linked answer, above.

Please bear in mind that I have no experience in distributing OS X applications, building installers for OS X applications, or setting the icon that appears in the Finder bar for OS X applications. Rather, I am an experienced C++ programmer (mostly on Windows and Linux).

I especially seek a clear, step-by-step set of instructions.

Community
  • 1
  • 1
Dan Nissenbaum
  • 13,558
  • 21
  • 105
  • 181
  • Regarding icons: Mac OS X uses the icns format, which can be created with Icon Composer in the XCode Developer Tools package (it's at the Mac Dev Center.) I don't know about the rest of the process, so I'll leave it up to someone else for that answer. (I am not an expert on Mac OS X development.) – John Chadwick Jan 09 '14 at 18:17
  • Note regarding downvote: "Real" programmers don't ask questions about such irrelevant details as real-life difficulties involved with professional programming. – Dan Nissenbaum Jan 09 '14 at 18:45

2 Answers2

3

You can automate icon creation by placing the following files in an icon.iconset directory:

icon_128x128.png
icon_128x128@2x.png
icon_16x16.png
icon_16x16@2x.png
icon_256x256.png
icon_256x256@2x.png
icon_32x32.png
icon_32x32@2x.png
icon_512x512.png
icon_512x512@2x.png

Then run the following command:

iconutil -c icns icon.iconset

It'll create the icons.icns that you'll reference with the ICON qmake variable.

Martin Delille
  • 11,360
  • 15
  • 65
  • 132
2

First of all I'd like to mention that Icon Composer for XCode won't work here because it's not possible to create icns file with resolution 1024x1024 px.

To generate icns file I used iConvert Icons. The major drawback is that it's not free. To generate icns file all you need is png image with resolution 1024x1024 or more. The process is really simple so I won't cover it.

After that you'll have to include your icon in your project. To do that insert path to your icon in your Qt application's .pro file:

macx-clang {
    ICON = osx.icns
}
lesyk
  • 3,979
  • 3
  • 25
  • 39
Maxim Makhun
  • 2,197
  • 1
  • 22
  • 26