October 25, 2010

hasnain hasnain
Lab Rat
11 posts

Restart App

 

i want to restart a qt mobile app.
any ideas how it can be done.
please help

2 replies

October 25, 2010

rohanpm rohanpm
Lab Rat
5 posts

Try one of these options:

  • from within the app, use QProcess::startDetached to start another instance of the app, then exit (the parent) immediately
  • run the app from a kind of wrapper which restarts the app every time it exits, unless it signals somehow that it really wants to exit (e.g. exiting with a certain magic exit code, or touching some known file)

October 26, 2010

lyuts lyuts
Lab Rat
164 posts

rohanpm wrote:
  • from within the app, use QProcess::startDetached to start another instance of the app, then exit (the parent) immediately

I would suggest an improvement for that:

  • fork.
  • in parent: terminate the app.
  • in child: make a delay, so your app gets enough time to terminate and use QProcess as offered above.

 Signature 

I’m a rebel in the S.D.G.

 
  ‹‹ [Moved] Beginner for program N8 v3      QML - screen orientation ››

You must log in to post a reply. Not a member yet? Register here!