TheQuake
3rd January 2015, 20:39
Hello! I posted my issue on stackoverflow: http://stackoverflow.com/questions/27736976/qt-start-new-application-and-quit?noredirect=1#comment43893521_27736976
I have no idea how to run other application in background from main application. Every time main application is quitting, applications started by it are closed too.
I have tried to use Q_DESTRUCTOR_FUNCTION to run process after main() is processing, without result. I also tried a lot of function:
void closeApp()
{
QProcess test;
if(test.startDetached("cmd.exe &"))
qDebug() << "Running";
QProcess::execute("cmd.exe");
system("start cmd.exe &");
system("cmd.exe &");
execl("start cmd.exe", "ls", "-r", "-t", "-l", (char *) 0);
system("cmd.exe");
FILE* pd = popen("cmd.exe &", "r");
}
Q_DESTRUCTOR_FUNCTION(closeApp)
Is it possible to launch and keep process by running from main application?
edit: ok, the problem was debugger .. outside it all works great with simple QProcess::startDetached("xxx");
I have no idea how to run other application in background from main application. Every time main application is quitting, applications started by it are closed too.
I have tried to use Q_DESTRUCTOR_FUNCTION to run process after main() is processing, without result. I also tried a lot of function:
void closeApp()
{
QProcess test;
if(test.startDetached("cmd.exe &"))
qDebug() << "Running";
QProcess::execute("cmd.exe");
system("start cmd.exe &");
system("cmd.exe &");
execl("start cmd.exe", "ls", "-r", "-t", "-l", (char *) 0);
system("cmd.exe");
FILE* pd = popen("cmd.exe &", "r");
}
Q_DESTRUCTOR_FUNCTION(closeApp)
Is it possible to launch and keep process by running from main application?
edit: ok, the problem was debugger .. outside it all works great with simple QProcess::startDetached("xxx");