diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-08-13 02:31:54 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-08-13 02:31:54 (GMT) |
commit | 4a8f38ed6ef6c1cb4a0ac7d2e123b6c42332fd07 (patch) | |
tree | 40adb805bff19393f9534e0ed84ac3f1009a1e14 /examples/declarative | |
parent | 89a2087b7ec5e36f7f4dd16d942aa23d2c7a6042 (diff) | |
download | Qt-4a8f38ed6ef6c1cb4a0ac7d2e123b6c42332fd07.zip Qt-4a8f38ed6ef6c1cb4a0ac7d2e123b6c42332fd07.tar.gz Qt-4a8f38ed6ef6c1cb4a0ac7d2e123b6c42332fd07.tar.bz2 |
Add delay parameter to the destroy function on QML objects
Also updated dynamic example to have a fadeout effect on deletion.
Also slipped in a toStr function, as it didn't work when I called it
toString.
Diffstat (limited to 'examples/declarative')
-rw-r--r-- | examples/declarative/dynamic/DynRect.qml | 8 | ||||
-rw-r--r-- | examples/declarative/dynamic/dynamic.qml | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/examples/declarative/dynamic/DynRect.qml b/examples/declarative/dynamic/DynRect.qml index 3f83afb..ec27441 100644 --- a/examples/declarative/dynamic/DynRect.qml +++ b/examples/declarative/dynamic/DynRect.qml @@ -1,3 +1,9 @@ import Qt 4.6 -Rect { color: "steelblue"; width: 100; height: 100; id: newRect } +Item { + states: State{ name: "dying"; SetProperties{ target: newRect; opacity: 0 } } + transitions: Transition{ + NumberAnimation{ properties: "opacity"; target: newRect; duration:500 } + } + Rect {color: "steelblue"; width: 100; height: 100; id: newRect } +} diff --git a/examples/declarative/dynamic/dynamic.qml b/examples/declarative/dynamic/dynamic.qml index 286e449..54d8dc8 100644 --- a/examples/declarative/dynamic/dynamic.qml +++ b/examples/declarative/dynamic/dynamic.qml @@ -19,10 +19,12 @@ Rect { id: page; width: 800; height: 800; color:"black" if(a!=null) { a.parent = targetItem2;//BUG: this should happen automatically fourthBox = a; + print(a.toStr()); extendStars = true; } } else { - fourthBox.destroy(); + fourthBox.state = 'dying'; + fourthBox.destroy(500); fourthBox = null; extendStars = false; } |