summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative/createQmlObject.qml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets/declarative/createQmlObject.qml')
-rw-r--r--doc/src/snippets/declarative/createQmlObject.qml7
1 files changed, 5 insertions, 2 deletions
diff --git a/doc/src/snippets/declarative/createQmlObject.qml b/doc/src/snippets/declarative/createQmlObject.qml
index 380f6f1..a5f15f4 100644
--- a/doc/src/snippets/declarative/createQmlObject.qml
+++ b/doc/src/snippets/declarative/createQmlObject.qml
@@ -42,16 +42,19 @@ import Qt 4.7
Rectangle {
id: parentItem
- property QtObject newObject
width: 100
height: 100
function createIt() {
//![0]
-newObject = Qt.createQmlObject('import Qt 4.7; Rectangle {color: "red"; width: 20; height: 20}',
+var newObject = Qt.createQmlObject('import Qt 4.7; Rectangle {color: "red"; width: 20; height: 20}',
parentItem, "dynamicSnippet1");
//![0]
+
+//![destroy]
+newObject.destroy(1000);
+//![destroy]
}
Component.onCompleted: createIt()