Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Restart the game
Qt 6.11 is out! See what's new in the release blog

Restart the game

Scheduled Pinned Locked Moved Game Development
3 Posts 3 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    domix24
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Code_ReaQtor
      wrote on last edited by
      #2

      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);@

      Please visit my open-source projects at https://github.com/Code-ReaQtor.

      1 Reply Last reply
      0
      • podsvirovP Offline
        podsvirovP Offline
        podsvirov
        wrote on last edited by
        #3

        Corrected game: "here":http://pastebin.com/VM2RhLaF

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved