Results 1 to 4 of 4

Thread: Mac application and the Dock Icon

  1. #1
    Join Date
    Oct 2006
    Posts
    6
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Mac application and the Dock Icon

    Hi,

    I am writing a Mac application with Qt, which creates a system tray icon, and the user can configure everything from there. So there is no need for the Dock icon. How can I disable it?

    Also, I noticed that when I right click my Dock icon, I see some options, including quit software, but then I click this one. Nothing happens. Also, the Dock icon has a default icon.

    If I were to use a Dock icon in this software (something I am considering), how would I control what to do when the user clicks the context menu?

    How can I add new items to the Dock context menu?

    and finally, how can I change the icon on the Dock?

    I searched qt docs, but haven't found much about this.

    Thank you very much,

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Mac application and the Dock Icon

    Have a look at this: http://doc.trolltech.com/qq/qq18-macfeatures.html
    There is a section about implementing dock menus there.

  3. #3
    Join Date
    Oct 2006
    Posts
    6
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Mac application and the Dock Icon

    Hi,

    I used qt_mac_set_dock_menu but that adds new items to the Dock context menu, it doesn't make the already existing items (automatically added by Mac OS X) start working.

    There are about 5 standard items added by Mac OS: Quit, Hide, Show in Finder, Open at startup and Remove from Dock

    The last four seam to be automatically handled by the OS, but my problem is that when the user presses "Quit", the application doesn't quit, althougth I think it would be nice if it would.

    Any ideas how to make the Quit button on the Dock work?

    thanks,

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Mac application and the Dock Icon

    You probably have to reimplement some event handler and handle it there. But you have to dive into the docs (both Qt and Carbon/whatever) to see what the event is.

  5. The following user says thank you to wysota for this useful post:

    sekelsenmat (3rd October 2007)

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.