Restart the game
-
Hi everyone who can help me
I've coded not so far ago and I need to restart the program(reload the program settings) if the signal gameWon is emitted, how I can do that?
the code was here -> "CLICK HERE":http://pastebin.com/M1S2XEWt
-
If you mean restarting the whole application, you may try to read this "thread":http://www.qtcentre.org/threads/30792-How-to-restart-an-application
or you may try this code:
@int main(int argc, char *argv[])
{
const int RESTART_CODE = 1000;do { QApplication app(argc, argv); MainWindow main_window(app); } while( app.exec() == RESTART_CODE); return return_from_event_loop_code;
}@
then, to restart the application, call:
@qApp->exit(1000);@ -
Corrected game: "here":http://pastebin.com/VM2RhLaF