Packaging Qt apps for Mac OS X

From MyLabWiki
Revision as of 01:06, 22 February 2011 by Alex (Talk | contribs)

Jump to: navigation, search

Once you got tired of reading and trying to comprehend Deploying an Application on Mac OS X in the Qt documentation, you realize at the bottom of the page that all you have to do is:

  1. Build your application in release mode
  2. Execute "macdeployqt" (see -h for options)

This will bundle all the Qt libraries into the - this will be approximately 40 MB. I guess one could still do the manual process for small applications that do not need all the Qt libraries. Or maybe the unnecessary libraries can be removed again manually?


To create a .dmg we can either use the -dmg option to macdeployqt or use the Mac Disk Utility as describe here or here (without the encryption part).

Application and package icon

  1. Create icons with size: 16x16, 32x32, 128x128, 256x256 and 512x512
  2. Paste them into Icon Composer
  3. Save .icns file
    • Note: Icon Composer can also create .ico file but these use different sizes
  4. Put the .icns file in
  5. Edit

See the result:

Ok, this didn't work even though it is the same procedure as described here: → try again, and also look at

Strangely enough, I could paste .icns files from other applications onto qthid so maybe it was my .icns file? Try the procedure with other icns files.

During runtime the dock icon can be changed by calling QWidget::setWindowIcon() on the main window[1].

Including addition data



  1. Qt is Mac OS X Native

Bundle Programming Guide