PDA

View Full Version : Qt 5.02 - How to add a MacOS Dock Icon?



relipse
21st April 2013, 04:36
I am trying to put in MacOS icon for the Dock, I added ICON = resources/images/mac/highres.icns but I get this error --> :-1: error: No rule to make target `../cworklog-qt-client/resources/images/mac/highres.icns', needed by `cworklog.app/Contents/Resources/highres.icns'. Stop.

Lykurg
21st April 2013, 08:11
Have you rerun qmake?

relipse
23rd April 2013, 08:00
Yes, I went to Build -> Run qmake and it still didn't change the icon
Here is my icon in the resources.qrc
://images/mac/highres.icns

In two of the constructors I tried


#ifdef Q_OS_MAC
this->setWindowIcon(QIcon("://images/mac/highres.icns"));
#endif


Both didn't work???

I also added the below snippet to my .pro file


macx {
ICON = images/mac/highres.icns
}

I reran qmake again but still no icon

I also took out the macx{ } parenthesis and ran qmake but to no avail

What else do I do? Someone please help me.

relipse
24th April 2013, 00:15
Is this a Qt 5.02 bug?
Here is my makefile
https://pastee.org/kpdzr

ChrisW67
24th April 2013, 02:53
Seems straightforward enough in the docs.

Which icon is not appearing? The dock icon during application launch, or the icon after the application has launched?

What warnings are being issued during the build, especially during the qrc run?
Why "://images/mac/highres.icns" and not ":/images/mac/highres.icns"? Is this the issue?

relipse
24th April 2013, 06:31
Ok, I feel so stupid, there is a reason I posted this in the newbie forum.
The whole time I was compiling under "debug" mode
When I changed to "release" mode it worked fine
great looking icon

Thanks for all your help and no need for this->setWindowIcon(QIcon(":/images/mac/highres.icns"));

To answer your question i was just trying out stuff
Jim