how to restart the MainWindow?
Hi everybody,
You know in main function of a default GUI application, a new object of kind MainWindow be created.
Code:
int main(int argc, char *argv[])
{
// make a new MainWindow object :
MainWindow w;
w.show();
return a.exec();
}
I am looking for a way to restart the the MainWindow, "controlled inside of MainWindow object".
for a example if I click on a bottun on ui, the window would restart and start from the begining...
Can you help me?
Re: how to restart the MainWindow?
You could have MainWindow on the heap, have the buttons terminating the event loop and then delete and recreate the MainWindow object inside your main function, but I'm not sure why you would want to.
The purpose of this is ?
Re: how to restart the MainWindow?
Quote:
Originally Posted by
fatjuicymole
You could have MainWindow on the heap, have the buttons terminating the event loop and then delete and recreate the MainWindow object inside your main function,
Thanks !
Would you explain more? (if possible with simple code)
Quote:
but I'm not sure why you would want to.
The purpose of this is ?
I want to restart it, because there are several processes iin my application that I think they slacken the program.