Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-23451

onPropertyChanged signal not raised for "Item" properties if target object is being destroyed

    XMLWordPrintable

Details

    • b06108350b1390b51886474628e03e2e84640548

    Description

      On destruction of the dynamic object the property that points to it is correctly set to null.
      This value change however does not trigger the onDynamicObjectChanged handler as I would have expected.

      import QtQuick 1.1
      
      Rectangle {
        id: root
        width: 400
        height: 300
      
        property Item dynamicObject: null
      
        onDynamicObjectChanged: { console.log("dynamicObject changed to: " + dynamicObject) }
      
        Timer {
          interval: 1000
          running: true
          repeat: true
          triggeredOnStart: true
          onTriggered: { console.log("current value of dynamicObject: "+ dynamicObject) }
        }
      
        Component {
          id: dynamicComponent
          Text {
            anchors.centerIn: parent
            text: "I'm so dynamic that I'm going to exist for one second only"
          }
        }
      
        Component.onCompleted: {
          dynamicObject = dynamicComponent.createObject(root)
          dynamicObject.destroy(1000)
        }
      }
      

      Attachments

        For Gerrit Dashboard: QTBUG-23451
        # Subject Branch Project Status CR V

        Activity

          People

            chriadam Christopher Adams (closed Nokia identity) (Inactive)
            njeisecke Nils Jeisecke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes