System tray & Mac menu bar applications in PyQt


#1

System tray applications (or menu bar applications) can be useful for making common functions or information available in a small number of clicks. For full desktop applications they're a useful shortcut to control apps without opening up the whole window.


This is a companion discussion topic for the original entry at https://www.pymadethis.com/article/system-tray-mac-menubar-applications-pyqt5/

#2

Thanks for the great article.
Can you tell how to add the functionality to quit the app?


#3

You can quit the application by calling app.quit() — to add a menu option for this, create a new QAction and then connect the triggered signal to the quit slot e.g. action.triggered.connect(app.quit)


#4

When running this application on mac, the application icon appear on the mac dock. Any idea on how to get rid of it and have juste the tray icon visible for the application ?