I have a tool to run main application - both are QApplications
.
in the tool I start main app as QProcess::startDetached("myapp.exe", QStringList() << "-arg1" << "-arg2", "C:/myFolder/");
then the tool finishes its work and the main app is still working.
I can start the tool again, and send commands via QSharedMemory
.
But if main app has opened modal dialog, it cannot handle new commands.
I need to determine from the tool that main app is busy with modal dialog and return some kind of error.
could anyone please tell me what is the simplest way to do it.
I have two ideas, but they really don't know if any of them will work:
use
QApplication::activeModalWidget()
, but how to getQApplication*
of main app from the tool?put information that the main app is busy in shared memory, and the tool'll check it before closing itself. - I'm not sure that the main app'll be able to save something in shared memory while it's busy with modal dialog.