diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-27 04:40:30 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-27 04:40:30 (GMT) |
commit | af7a8523d28539f719d3e3b82d7cf6628bbdd74a (patch) | |
tree | f960783fadfaf1e0a50aa79db1837fa4e7bdfbf1 /examples | |
parent | b590c65a82ec6fe085d6d609bf342e2c18b8e6c9 (diff) | |
parent | 174b95702dac03866f684426f84dfdf882293b0b (diff) | |
download | Qt-af7a8523d28539f719d3e3b82d7cf6628bbdd74a.zip Qt-af7a8523d28539f719d3e3b82d7cf6628bbdd74a.tar.gz Qt-af7a8523d28539f719d3e3b82d7cf6628bbdd74a.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'examples')
-rw-r--r-- | examples/declarative/listview/content/ClickAutoRepeating.qml | 16 | ||||
-rw-r--r-- | examples/declarative/listview/dynamic.qml | 8 |
2 files changed, 13 insertions, 11 deletions
diff --git a/examples/declarative/listview/content/ClickAutoRepeating.qml b/examples/declarative/listview/content/ClickAutoRepeating.qml index f0e7df1..796f9e3 100644 --- a/examples/declarative/listview/content/ClickAutoRepeating.qml +++ b/examples/declarative/listview/content/ClickAutoRepeating.qml @@ -4,25 +4,27 @@ Item { id: page property int repeatdelay: 300 property int repeatperiod: 75 - property bool pressed: false + property bool isPressed: false + signal pressed signal released signal clicked - pressed: SequentialAnimation { + + isPressed: SequentialAnimation { id: autoRepeat - PropertyAction { target: page; property: "pressed"; value: true } - ScriptAction { script: page.onPressed } - ScriptAction { script: page.onClicked } + PropertyAction { target: page; property: "isPressed"; value: true } + ScriptAction { script: page.pressed() } + ScriptAction { script: page.clicked() } PauseAnimation { duration: repeatdelay } SequentialAnimation { repeat: true - ScriptAction { script: page.onClicked } + ScriptAction { script: page.clicked() } PauseAnimation { duration: repeatperiod } } } MouseRegion { anchors.fill: parent onPressed: autoRepeat.start() - onReleased: { autoRepeat.stop(); parent.pressed = false; page.released } + onReleased: { autoRepeat.stop(); parent.isPressed = false; page.released() } } } diff --git a/examples/declarative/listview/dynamic.qml b/examples/declarative/listview/dynamic.qml index 4f8e483..f48cc4e 100644 --- a/examples/declarative/listview/dynamic.qml +++ b/examples/declarative/listview/dynamic.qml @@ -59,8 +59,8 @@ Item { id: fruitDelegate Item { width: parent.width; height: 55 - Text { id: label; font.pixelSize: 24; text: name; elide: "ElideRight"; anchors.right: cost.left; anchors.left:parent.left } - Text { id: cost; font.pixelSize: 24; text: '$'+Number(cost).toFixed(2); anchors.right: itemButtons.left } + Text { id: label; font.pixelSize: 24; text: name; elide: "ElideRight"; anchors.right: costText.left; anchors.left:parent.left } + Text { id: costText; font.pixelSize: 24; text: '$'+Number(cost).toFixed(2); anchors.right: itemButtons.left } Row { anchors.top: label.bottom spacing: 5 @@ -77,11 +77,11 @@ Item { width: childrenRect.width Image { source: "content/pics/add.png" ClickAutoRepeating { id: clickUp; anchors.fill: parent; onClicked: fruitModel.set(index,"cost",Number(cost)+0.25) } - scale: clickUp.pressed ? 0.9 : 1 + scale: clickUp.isPressed ? 0.9 : 1 } Image { source: "content/pics/del.png" ClickAutoRepeating { id: clickDown; anchors.fill: parent; onClicked: fruitModel.set(index,"cost",Math.max(0,Number(cost)-0.25)) } - scale: clickDown.pressed ? 0.9 : 1 + scale: clickDown.isPressed ? 0.9 : 1 } Image { source: "content/pics/trash.png" MouseRegion { anchors.fill: parent; onClicked: fruitModel.remove(index) } |