About ending the program and backing to the first page
-
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?
-
Hi,
How are you handling your pages currently ?
-
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
-
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.
-
@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.
5/5