I am currently looking for a way to check if the application was launched from console or from the GUI (currently Finder in MacOS).

The reason is that in the GUI case it should show the user interface, in the non gui version is should just run as console application.
I would launch QApplication but this automatically adds an icon to the dock and slows down application start.
So I want to start a QCoreApplication in console mode.

Finder seems to launch an applications with argc=2 and argv[1]=0 but i am not sure if this something to rely on.
I don't care about writing some mac specific code - but would prefer a pure Qt solution for that.

Has anybody a good idea?