Destroying dynamically created Dialogs



  • Hello.
    Right now I can't find anything equivalent to Qt::WA_DeleteOnClose from the Widget world for Qt Quick based Windows and Dialog.
    I have this Dialog:

    import QtQuick 2.5
    import QtQuick.Dialogs 1.2
    import QtQuick.Controls 1.4
    Dialog {
        id: dialog
    
        contentItem: Button {
            anchors.fill: parent
            text: "OK"
            onClicked: {
                dialog.destroy()
            }
        }
    }
    

    And I'm creating it dynamically with:

    var component = Qt.createComponent("MyDialog.qml")
    var obj = component.createObject()
    

    Besides calls to the destroy() method when the user clicks the Ok button what about the user clicking the top right X button? Will the memory be released?

    Thank you


Log in to reply
 

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