Results 1 to 6 of 6

Thread: Qt 5.02 - How to add a MacOS Dock Icon?

  1. #1
    Join Date
    Apr 2013
    Posts
    4
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Qt 5.02 - How to add a MacOS Dock Icon?

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Qt 5.02 - How to add a MacOS Dock Icon?

    Have you rerun qmake?

  3. #3
    Join Date
    Apr 2013
    Posts
    4
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 5.02 - How to add a MacOS Dock Icon?

    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
    Qt Code:
    1. #ifdef Q_OS_MAC
    2. this->setWindowIcon(QIcon("://images/mac/highres.icns"));
    3. #endif
    To copy to clipboard, switch view to plain text mode 

    Both didn't work???

    I also added the below snippet to my .pro file
    Qt Code:
    1. macx {
    2. ICON = images/mac/highres.icns
    3. }
    To copy to clipboard, switch view to plain text mode 
    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.
    Last edited by relipse; 23rd April 2013 at 08:17. Reason: i tried qmake

  4. #4
    Join Date
    Apr 2013
    Posts
    4
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 5.02 - How to add a MacOS Dock Icon?

    Is this a Qt 5.02 bug?
    Here is my makefile
    https://pastee.org/kpdzr

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,722
    Thanks
    13
    Thanked 1,606 Times in 1,533 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qt 5.02 - How to add a MacOS Dock Icon?

    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?
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
    If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.

  6. #6
    Join Date
    Apr 2013
    Posts
    4
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Thumbs up Re: Qt 5.02 - How to add a MacOS Dock Icon?

    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

Similar Threads

  1. MAC DOCK display number in icon
    By migel in forum Newbie
    Replies: 0
    Last Post: 6th September 2011, 09:58
  2. Replies: 0
    Last Post: 17th March 2010, 13:25
  3. forcing dock windows to dock?
    By eric_vi in forum Qt Programming
    Replies: 3
    Last Post: 9th August 2009, 15:32
  4. Couple of questions: main window icon + toolbar icon
    By bpackard in forum Qt Programming
    Replies: 0
    Last Post: 20th March 2008, 19:03
  5. Mac application and the Dock Icon
    By sekelsenmat in forum Qt Programming
    Replies: 3
    Last Post: 26th September 2007, 10:23

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.