I used the idea from faltzip and read the cmdlineargs with QCoreApplication::arguments(). So I could use the 1st cmdlinearg as a switch to start the app with show or hide.