Run application in background and show icon in menubar and pop up menu in finder(mac os)
-
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 -
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.
-
Thanks, thats already half the solution :-). I guess the other thing will be difficult in Qt.
Tom
-
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