XMLWordPrintable

Details

    Description

      Consider the following script:

      import QtQuick 2.1
      import QtQuick.Controls 1.0
      Item
      {
      	property var listOfQVectors: []
      
      	Component
      	{
      		id: component
      		QtObject
      		{
      			property vector3d v: Qt.vector3d(0,0,0)
      		}
      	}
      	Column
      	{
      		Button
      		{
      			text: "create, delete"
      			onClicked:
      			{
      				var object = component.createObject(parent, {"objectName": "hello"})
      				listOfQVectors.push(object.v);
      				// workaround : listOfQVectors.push(Qt.vector3d(object.v.x, object.v.y, object.v.x));
      				listOfQVectorsChanged()
      				print("before destroy: " +listOfQVectors[0])
      				object.destroy();
      			}
      		}
      		Button
      		{
      			text: "print"
      			onClicked: print("after destroy: " +listOfQVectors[0])
      		}
      	}
      	
      }
      

      I get the following output:

      before destroy: QVector3D(0, 0, 0)
      after destroy: undefined
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              shausman Simon Hausmann
              maxlem Maxime Lemonnier
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes