diff options
| author | Warwick Allison <warwick.allison@nokia.com> | 2010-05-05 03:13:40 (GMT) |
|---|---|---|
| committer | Warwick Allison <warwick.allison@nokia.com> | 2010-05-05 03:13:40 (GMT) |
| commit | fde6b4cc1e720ae655ccac9d7f83c7d2dc4badc4 (patch) | |
| tree | b16e2cfd90d7e996f79f7e3020a4c4ae7b44c970 /doc/src/snippets/declarative/dynamicObjects.qml | |
| parent | a5d15c36ae3db3caff4eeb86fd7eb5cdbb928f2d (diff) | |
| parent | 99502731c6f093c8db82189d46b949657ad83b25 (diff) | |
| download | Qt-fde6b4cc1e720ae655ccac9d7f83c7d2dc4badc4.zip Qt-fde6b4cc1e720ae655ccac9d7f83c7d2dc4badc4.tar.gz Qt-fde6b4cc1e720ae655ccac9d7f83c7d2dc4badc4.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.qml | 30 |
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] |
