PDA

View Full Version : Restart app does not work



guidupas
22nd July 2014, 15:36
Hello!

I am trying to restart my app using the code:


QStringList args = QApplication::arguments();
args.removeFirst();
QProcess::startDetached(QApplication::applicationF ilePath(), args);
QCoreApplication::quit();

or


QProcess::startDetached(qApp->arguments()[0], qApp->arguments());
qApp->quit();


It works fine when I run it in Qt, but when I build it, generate the .pkg and install it does not restart and when I reopen the app it gives a message that the app was finished during windows reopen.

I am using OSX 10.9

Thanks very much.

ChrisW67
25th July 2014, 21:12
What platform? Have you read the platform specific parts of the docs for arguments() and startDetached()?
Does startDetached() return true or false?
Is applicationFilePath() returning what you expect?
Is the first element of arguments() the program name you expect?