Hello Developers
I have developed an application that takes command-line arguments.
The application has the ability to focus to the already running application if another instance is launched, by sending a message from the launched (new) application to the already open application.
So, the problem is that if the program is running with a command line argument (something that does not open the GUI, it runs in the console) and another instance is launched I don’t know what to do exactly…
The argument is running a function every 30min using a qtimer and does nothing else actually, so, should I have the app connected and ready to receive a signal and when it receive it from the another instance to call the w.show(); (where w is MainWindow wand stop the command line-mode and its functionality (also maybe display a message that the process X has stopped because another instance was launched) ?
I think that this is what I should do but not sure, and I don’t want to do something wrong and have to correct it afterwards… (also by doing my way of thinking, MainWindow w; should be global)
So, what would be your way to do it, or what do you expect to be the behaviour of a program if it had a command-line interface and GUI was called?
Thanks![]()
Bookmarks