diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-07-02 03:11:43 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-07-02 03:11:43 (GMT) |
commit | 8aba610c22c44bf36eb2e539a06b65753c48bbc2 (patch) | |
tree | a09af5ec3edd87ffcf041fe030135e58d49cb520 /examples/declarative/dynamic/dynamic.qml | |
parent | dafd625842e2c66551857810a3660c534962746e (diff) | |
parent | 305de45a8d184738dc07fb7e5c787b9dbb5b3c6b (diff) | |
download | Qt-8aba610c22c44bf36eb2e539a06b65753c48bbc2.zip Qt-8aba610c22c44bf36eb2e539a06b65753c48bbc2.tar.gz Qt-8aba610c22c44bf36eb2e539a06b65753c48bbc2.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'examples/declarative/dynamic/dynamic.qml')
-rw-r--r-- | examples/declarative/dynamic/dynamic.qml | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/examples/declarative/dynamic/dynamic.qml b/examples/declarative/dynamic/dynamic.qml index ee81ff6..3e0c12e 100644 --- a/examples/declarative/dynamic/dynamic.qml +++ b/examples/declarative/dynamic/dynamic.qml @@ -1,16 +1,31 @@ Rect { id: page; width: 800; height: 800; color:"black" Script { source: "dynamic.js" } - property bool fourthBox: false; + property bool extendStars: false; Item { id: targetItem; x: 100; y: 100; } Item { id: targetItem2; x: 0; y: 300; } Rect { width: 100; height: 100; color: "green"; id: rect - MouseRegion { anchors.fill:parent; onClicked: {a = create();}} + MouseRegion { anchors.fill:parent; onClicked: {a = createWithComponent();}} } Rect { width: 100; height: 100; color: "red"; id: rect2; y:100; - MouseRegion { anchors.fill:parent; onClicked: {death();}} + MouseRegion { anchors.fill:parent; onClicked: {destroyDynamicObject();}} } Rect { width: 100; height: 100; color: "blue"; id: rect3; y:200; - MouseRegion { anchors.fill:parent; onClicked: {a = make(); if(a!=null){a.parent = targetItem2; fourthBox = true;}}} + MouseRegion { anchors.fill:parent; onClicked: + { + if(fourthBox == null) { + a = createWithEvalQml(); + if(a!=null) { + a.parent = targetItem2; + fourthBox = a; + extendStars = true; + } + } else { + fourthBox.destroy(); + fourthBox = null; + extendStars = false; + } + } + } } - Particles { x:0; y:0; count:20; lifeSpan:500; width:100; height: if(fourthBox){400;}else{300;} source:"star.png"} + Particles { x:0; y:0; count:20; lifeSpan:500; width:100; height: if(extendStars){400;}else{300;} source:"star.png"} } |