summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative/dynamicObjects.qml
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-05-04 03:44:31 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-05-04 03:44:31 (GMT)
commit019e7ab64a55df88d0884b7e32fd099e1b75e4e4 (patch)
tree88c8b3059926f8628fff0a7abde909c548916099 /doc/src/snippets/declarative/dynamicObjects.qml
parenta9a97a9f1ed78d55888679f7ae1a1534f2b20fad (diff)
parent56dcdada14f1a499da5a458bdada2127e73dc630 (diff)
downloadQt-019e7ab64a55df88d0884b7e32fd099e1b75e4e4.zip
Qt-019e7ab64a55df88d0884b7e32fd099e1b75e4e4.tar.gz
Qt-019e7ab64a55df88d0884b7e32fd099e1b75e4e4.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'doc/src/snippets/declarative/dynamicObjects.qml')
-rw-r--r--doc/src/snippets/declarative/dynamicObjects.qml30
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/src/snippets/declarative/dynamicObjects.qml b/doc/src/snippets/declarative/dynamicObjects.qml
new file mode 100644
index 0000000..dd55d78
--- /dev/null
+++ b/doc/src/snippets/declarative/dynamicObjects.qml
@@ -0,0 +1,30 @@
+import Qt 4.7
+
+//![0]
+Rectangle {
+ id: rootItem
+ width: 300
+ height: 300
+
+ Component {
+ id: rectComponent
+
+ Rectangle {
+ id: rect
+ width: 40; height: 40;
+ color: "red"
+
+ NumberAnimation on opacity { from: 1; to: 0; duration: 1000 }
+
+ Component.onCompleted: rect.destroy(1000);
+ }
+ }
+
+ function createRectangle() {
+ var object = rectComponent.createObject();
+ object.parent = rootItem;
+ }
+
+ Component.onCompleted: createRectangle()
+}
+//![0]