Showing Qml Message Diaglog while closing qml application (solved)



  • Hello,

    I want to show a qml message dialog and let user choose "saving some thing" while exit qml application . I try to show the message diaglog at Component.onDestruction or ApplicationWindow.onClosing.

    With: Component.onDestruction: no message dialog was shown.

    With: ApplicationWindow.onClosing: the message diaglog show but the application window disappeared

    Could you please help me ?

    Thank you!


  • Moderators

    Hi,

    IMO Component.onDestruction wont be useful here.

    bq. With: ApplicationWindow.onClosing: the message diaglog show but the application window disappeared

    Did you set close.accepted = false before calling the MessageDialog in onClosing handler?



  • Hi p3c0,

    I forgot this. Thanks to your guide, I can do it.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.