QT / C ++ on MAC - application icon not installed

A strange problem that I am struggling with. In the same folder as in my QT project "* .pro" file, I have Resource / myIcon.png.

I am trying to set this as an icon for my embedded OSX application. I read the documentation and it suggests putting "ICON =" in the .pro file. I did this, but for some reason the icon is copied through the resource folder inside my application content, but the .pfile icon field remains empty. Even when I change it manually to "resources / myIcon.png", it will not work.

What am I doing wrong?

+3
source share
3 answers

Do not set the full path in the application set for the icon file in Info.plist. Just set the file name. Mac OS knows how to look for AppName.app/Contents/Resources in it.

And yes, it should be an ICNS file, as far as I know. You can use the Icon Composer utility, which is part of the Mac OS development tools to create .icns from .png.

+3
source

Manually remove the generated application package. Run QMake followed by Rebuild All is not enough!

+7
source

Do you mean the icon that appears in the dock? I added the .ico file to the application resource file and then set it as my icon with the following call

 QApplication::qApp()->setWindowIcon(QIcon(<resource path>)); 
+1
source

All Articles