diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2009-10-27 03:55:34 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2009-10-27 03:55:34 (GMT) |
commit | a9745ccc4d1d5e8e033a805fe1870221250f7dec (patch) | |
tree | d017c9a214edf911a9be7d3bb35272ce03db4375 /examples | |
parent | b1a5b6c40c6c76d44d9afc24c6cddf1d2abf7b29 (diff) | |
download | Qt-a9745ccc4d1d5e8e033a805fe1870221250f7dec.zip Qt-a9745ccc4d1d5e8e033a805fe1870221250f7dec.tar.gz Qt-a9745ccc4d1d5e8e033a805fe1870221250f7dec.tar.bz2 |
make listview/dynamic.qml work again
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) } |