PDA

View Full Version : How to restart an application



Naami
18th May 2010, 12:36
Hi; :)
How to restart an application.

Thanks.

high_flyer
18th May 2010, 13:20
What do you mean?

Naami
18th May 2010, 14:22
Hi;
I have Qt application and I need to restart their execution.
Thanks;

tbscope
18th May 2010, 15:02
Create a script that waits till the current process finished, then start a new one.
Run the script when you close your program

Naami
19th May 2010, 09:29
Hi;
Thanks;
Resources allowed not free by this method!!

squidge
19th May 2010, 09:57
No, you have to take care of your resources and memory allocations yourself. There's no magic "release all my memory and allocations for me" as it doesn't know what is in use.

Naami
19th May 2010, 16:42
Hi;
I have an application that is based on plugins, after several uses, I just do not unload this plugin (QPluginLoader:: unload ()) which remains blocked.:confused:

piotr.dobrogost
26th February 2011, 21:39
Try this:

Nice.
Posted as answer here (http://stackoverflow.com/questions/5129788/#5129898).

alxobr
29th May 2011, 15:35
Whenever you want to restart the application just call exit(RESTART_CODE) to exit the event loop with RESTART_CODE.

Hi all,

To repeat the loop I would rather call:


qApp->exit(RESTART_CODE);

Or indifferently:


QApplication::instance()->exit(RESTART_CODE);


Otherwise the program appears to be exited immediately.

Cheers,

Alexandre

walter.gallieni
19th January 2015, 13:31
Hi to all, here I am. I'm looking for a easy solution on how to restart an application, I read something, consider I'm a novice, if anyone has a working sample would be great...thanks in advance

walter

wysota
19th January 2015, 21:52
Hi to all, here I am. I'm looking for a easy solution on how to restart an application, I read something, consider I'm a novice, if anyone has a working sample would be great...thanks in advance

You might want to reformulate your question, currently it is very generic. At this moment I'd say that the easiest way to restart an application is to close it and start it up again the same way it was started originally.

neuronet
21st January 2015, 15:47
No, you have to take care of your resources and memory allocations yourself. There's no magic "release all my memory and allocations for me" as it doesn't know what is in use.

Unless you are in PySide/PyQt. :)