Hide Python launch icon for new QApplication ()

I have a Threaded program that runs in the background that creates one QApplication () for each thread, and every time I get a new Python Launcher icon on the dock.

Is there a way to run QApplication () without creating a dock icon on OSX?

Thanks!

+4
source share
2 answers

There are ways to remove / disable the dock icon. See This Question: How to hide the dock icon

I am using this Python code (after creating the QApplication instance):

 def hideMacDockIcon(): import AppKit # https://developer.apple.com/library/mac/#documentation/AppKit/Reference/NSRunningApplication_Class/Reference/Reference.html NSApplicationActivationPolicyRegular = 0 NSApplicationActivationPolicyAccessory = 1 NSApplicationActivationPolicyProhibited = 2 AppKit.NSApp.setActivationPolicy_(NSApplicationActivationPolicyProhibited) 
+4
source

The answer here is: Run the GUI process on Mac OS X without a dock icon

Place the following lines before creating QApplication:

 import AppKit info = AppKit.NSBundle.mainBundle().infoDictionary() info["LSBackgroundOnly"] = "1" 
+4
source

All Articles