I have a QApplication
in which I have a custom QDialog
. The dialog offers the users a set of options and then launches a process via QProcess
. While the process launched still runs, the app if closed has to still run. To achieve this, I re-implemented the closeEvent
of QWidget
and accept()
ed or ignore()
ed the event based on whether a process is launched or not.
In the closeEvent()
function, I am hiding my QDialog
. With this, for the user the application is closed (it will however run in the task manager). I expect the user to relaunch the application by running the program again. At this point I need to figure out that another instance is already running and that instance to should come to the foreground.
Can anyone help me with how I can achieve this?