you might have an issue in your game code, where you handle to the onMessageBoxFinished dialog of nativeUtils, and then call Qt.exit().
Do you check if the dialog was opened from the back-button handling? I
In the sample games, we do set a bool property to true or check if this is the active scene. This code is copied from the Flappy Bird demo for example:
// nativeUtils should only be connected, when this is the active scene
target: window.activeScene === menuScene ? nativeUtils : null
Thanks you’re right – I’m missing that target condition.
I think I inherited this oversimplification from Multi-Level-Multi-Scene demo 😀
// menu scene
// listen to the button signals of the scene and change the state according to it
onSelectLevelPressed: gameWindow.state = "selectLevel"
onCreditsPressed: gameWindow.state = "credits"
// the menu scene is our start scene, so if back is pressed there we ask the user if he wants to quit the application
nativeUtils.displayMessageBox("Really quit the game?", "", 2);
// listen to the return value of the MessageBox
Yes it is not there, because it is the only place in this application where a messageBox is shown. We added it to the sample & the wizard now and it will be available with the next update, thanks for pointing it out!