Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Run application in background and show icon in menubar and pop up menu in finder(mac os)

Run application in background and show icon in menubar and pop up menu in finder(mac os)

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 5.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tomjanssens
    wrote on last edited by
    #1

    Hello,

    How can I run a QT application in the background on mac os x and show an icon in in the menu bar and the pop up menu in finder (file explorer for windows). When clicking the icon in the menu bar or the pop up menu the main application window must open.

    Cheers
    Tom

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      You can hide your windows by calling slot hide() on each of them.

      To put an icon into the right side of the menubar, create a "QSystemTrayIcon":http://doc.qt.nokia.com/stable/qsystemtrayicon.html, add a menu to it (with setContextMenu(), just like a regular QMenu) and call slot show() to make it visible. When you click on the tray icon, your menu is shown.

      Connect one of the menu items to a slot, that calls raise() on the desired window (cf. this "wiki article":http://developer.qt.nokia.com/wiki/Restore_Mac_Application_Window_after_Cmd-H).

      The system tray icon also works on windows, it adds an icon to the collection usually found on the bottom right corner of the screen.

      I don't have any solution for the finder problem.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tomjanssens
        wrote on last edited by
        #3

        Thanks, thats already half the solution :-). I guess the other thing will be difficult in Qt.

        Tom

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          You always can add platform specific code (even Objective-C) to your project. So I think it's not undoable, though difficult, yes.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tomjanssens
            wrote on last edited by
            #5

            It seems that the Mac os X Finder can show system services. Anybody knows if I can use the QT system framework for this:

            http://doc.qt.nokia.com/qtmobility-1.0-tp/service-frameworks.html

            Cheers
            Tom

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved