Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 [PyQt] Hide Dock Icon for QSystemTrayIcon App
I have a Qt program that uses a QSystemTrayIcon. Only the tray icon shows on Windows, but on Mac the generic Python Launcher icon also shows up in the dock. How do I hide this?

Although there are a couple StackExchange posts about this, none of them seem to work for me. I've tried doing something like this to no avail.

I also found some stuff about AppKit, but couldn't figure out how to use the PyObjC package. Besides, it seems like it should be simpler.

For reference, here is the section of code which creates the tray icon. There are no other widgets or windows.

from PySide2.QtGui import QIcon
from PySide2.QtWidgets import QApplication, QAction, QMenu, QSystemTrayIcon,\
from pkg_resources import require, DistributionNotFound, resource_filename

def main():
    app = QApplication(sys.argv)

    # Create the tray
    tray = QSystemTrayIcon(QIcon(resource_filename("application.server",
    menu = QMenu()
    controls = []


    controls.append(QAction("Check Status"))


    controls.append(QAction("Launch client"))

    controls.append(QAction("Stop Server"))

    # Add the menu to the tray

Thank you!

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  [Tkinter] Help setting text/title in dock/panel in tkinter gui FluxApex 2 252 Mar-18-2020, 07:15 PM
Last Post: FluxApex
  [Tkinter] Password Reveal Icon Evil_Patrick 2 332 Nov-29-2019, 02:20 PM
Last Post: Evil_Patrick
  [Tkinter] Window Icon Evil_Patrick 6 1,223 Oct-18-2019, 11:26 AM
Last Post: Evil_Patrick
  Button with Image Icon Friend 2 571 Jul-25-2019, 09:39 AM
Last Post: Friend
  Hide button when clicked frequency 2 1,151 Dec-24-2018, 02:10 PM
Last Post: frequency
  [PYQT5] Crashing when using .hide() and .show() aking76 0 2,571 Sep-18-2018, 02:09 PM
Last Post: aking76
  [PyQt] How is this tray icon throbber done? JackDinn 7 1,378 Mar-05-2018, 02:19 PM
Last Post: JackDinn
Bug [PyQt] Priority problem with PyQt5 QMenu() and QSystemTrayIcon() Alfalfa 1 2,768 May-31-2017, 09:50 PM
Last Post: Alfalfa
  [Tkinter] Hide text in entry box when i click on it. MeeranRizvi 1 5,837 Jan-25-2017, 10:38 AM
Last Post: MeeranRizvi
  Hide command window sparkz_alot 8 10,895 Sep-29-2016, 10:14 AM
Last Post: wavic

Forum Jump:

Users browsing this thread: 1 Guest(s)