Problems customizing app icon with QT 5.3 on Mac

I am trying to set an application icon according to the following directions:

http://qt-project.org/doc/qt-5/appicon.html

If I understand correctly, the process should be pretty simple:

  • Create an icon file ( FlySightViewer.icns

    ) using the icon. I followed the instructions here: qaru.site/questions/77375 / ... .

  • Add ICON = FlySightViewer.icns

    to .pro file.

However, when I follow these steps, the icon remains the default Qt application icon. I tried deleting the app folder and creating a folder as I read that they sometimes don't rebuild in the normal process. This doesn't seem to fix the problem.

Looking a little deeper, when I run qmake from Qt Creator, the generated Makefile contains multiple instances FlySightViewer.icns

, including this line:

@$(COPY_FILE) ../flysight-viewer-qt/src/FlySightViewer.icns FlySightViewer.app/Contents/Resources/FlySightViewer.icns

      

The file ../flysight-viewer-qt/src/FlySightViewer.icns

seems to be correct when I expect it to be. However, when I create a project and look into the application, the icon doesn't appear anywhere. The only thing in the folder Resources

is empty.lproj

.

It seems to me that the icon does not look as expected because it is not copied into the app bundle, but I have no idea why this is possible.

Any help would be greatly appreciated. I realize this is a fairly common question, but none of the answers I found here seem to have helped.

Thank you for your time!

+3


source to share


2 answers


Add this line to your .pro file:

QMAKE_INFO_PLIST = Info.plist

      



Then create a .plist and set the icon name there. I won't insert the .plist example because it is quite large, but you can see how to do it by right-clicking a random application and choosing "show package contents".

0


source


With older versions of Qt, I decided to change the icon manually. However, the most recent version of Qt (or macdeployqt) seems to have fixed the problem, so I no longer need to manually install the icon.



0


source







All Articles