Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. About ending the program and backing to the first page
Forum Updated to NodeBB v4.3 + New Features

About ending the program and backing to the first page

Scheduled Pinned Locked Moved Unsolved Qt for Python
5 Posts 3 Posters 387 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.
  • J Offline
    J Offline
    jack_8390
    wrote on last edited by
    #1

    Hi! At the end of my program, I want to make the program back to the first page and make it ready for the next players, how can I do it?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      How are you handling your pages currently ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • J Offline
        J Offline
        jack_8390
        wrote on last edited by
        #3

        At the last page, I set the function to back to the first page, but the previous contents are not cleared in the next trial

        JonBJ 1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Then the most simple is to add a reset function to that widget that you will call before showing it again and does all the required cleanup.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • J jack_8390

            At the last page, I set the function to back to the first page, but the previous contents are not cleared in the next trial

            JonBJ Online
            JonBJ Online
            JonB
            wrote on last edited by JonB
            #5

            @jack_8390
            As @SGaist has said. You still have said mothing about what your "pages" actually are or how the user moves between them.

            If your process is for each user to step through sequential pages to perform their actions/turns and then return to the start of these pages totally afresh for the next user you might consider Qt's QWizard Class, which supports stepping forward (and optionally, but not necessarily, backward) through a bunch of QWizardPage pages. This supports restarting where it resets any previously entered information on the pages so that they start afresh if that is what you want. Otherwise you need to write your own code to reset existing content as @SGaist has said. Or destroying existing used pages and recreating them anew to get them back to their original state.

            1 Reply Last reply
            1

            • Login

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