Save in QSettings last opened scene: main menu, unit selection, or unit playing, and the parameters to restore them (context, unit name). Restore the scene during the load, and save during finishing the application.
Keep a key /App/ExitClean with values running (set during the load) or clean (set during exiting the application. If during the load the key is running it means at not clean exit was done in the previous session, and restore the game menu scene instead of the saved scene preferences.
Save in QSettings last opened scene: main menu, unit selection, or unit playing, and the parameters to restore them (context, unit name). Restore the scene during the load, and save during finishing the application.
Keep a key
/App/ExitClean
with valuesrunning
(set during the load) orclean
(set during exiting the application. If during the load the key isrunning
it means at not clean exit was done in the previous session, and restore the game menu scene instead of the saved scene preferences.