summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-09-11 05:54:49 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-09-11 05:54:49 (GMT)
commitf7982be51ec5872dba11d87ea653b791251a0215 (patch)
tree556dad915f8ffba2c388dba2750e48d52962f71f /examples
parentefc7963a15c204db48cb3b6560366410b640e5c3 (diff)
parente4648700e7e3c84c61d6b012f7d480394b889c31 (diff)
downloadQt-f7982be51ec5872dba11d87ea653b791251a0215.zip
Qt-f7982be51ec5872dba11d87ea653b791251a0215.tar.gz
Qt-f7982be51ec5872dba11d87ea653b791251a0215.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.qml29
-rw-r--r--examples/declarative/listview/dynamic.qml7
-rw-r--r--examples/declarative/listview/highlight.qml2
-rw-r--r--examples/declarative/loader/Browser.qml2
4 files changed, 36 insertions, 4 deletions
diff --git a/examples/declarative/listview/content/ClickAutoRepeating.qml b/examples/declarative/listview/content/ClickAutoRepeating.qml
new file mode 100644
index 0000000..19dd6f6
--- /dev/null
+++ b/examples/declarative/listview/content/ClickAutoRepeating.qml
@@ -0,0 +1,29 @@
+import Qt 4.6
+
+Item {
+ id: Page
+ property int repeatdelay: 300
+ property int repeatperiod: 75
+ property bool pressed: false
+ signal pressed
+ signal released
+ signal clicked
+ pressed: SequentialAnimation {
+ id: AutoRepeat
+ PropertyAction { target: Page; property: "pressed"; value: true }
+ ScriptAction { script: Page.onPressed }
+ ScriptAction { script: Page.onClicked }
+ PauseAnimation { duration: repeatdelay }
+ SequentialAnimation {
+ repeat: true
+ ScriptAction { script: Page.onClicked }
+ PauseAnimation { duration: repeatperiod }
+ }
+ }
+ MouseRegion {
+ id: MR
+ anchors.fill: parent
+ onPressed: AutoRepeat.start()
+ onReleased: { AutoRepeat.stop(); parent.pressed = false; Page.released }
+ }
+}
diff --git a/examples/declarative/listview/dynamic.qml b/examples/declarative/listview/dynamic.qml
index f615c24..dde24f6 100644
--- a/examples/declarative/listview/dynamic.qml
+++ b/examples/declarative/listview/dynamic.qml
@@ -1,4 +1,5 @@
import Qt 4.6
+import "content"
Item {
width: 320
@@ -75,10 +76,12 @@ Item {
anchors.right: parent.right
width: childrenRect.width
Image { source: "content/pics/add.png"
- MouseRegion { anchors.fill: parent; onClicked: FruitModel.set(index,"cost",Number(cost)+0.25) }
+ ClickAutoRepeating { id: ClickUp; anchors.fill: parent; onClicked: FruitModel.set(index,"cost",Number(cost)+0.25) }
+ scale: ClickUp.pressed ? 0.9 : 1
}
Image { source: "content/pics/del.png"
- MouseRegion { anchors.fill: parent; onClicked: FruitModel.set(index,"cost",Number(cost)-0.25) }
+ ClickAutoRepeating { id: ClickDown; anchors.fill: parent; onClicked: FruitModel.set(index,"cost",Math.max(0,Number(cost)-0.25)) }
+ scale: ClickDown.pressed ? 0.9 : 1
}
Image { source: "content/pics/trash.png"
MouseRegion { anchors.fill: parent; onClicked: FruitModel.remove(index) }
diff --git a/examples/declarative/listview/highlight.qml b/examples/declarative/listview/highlight.qml
index e707ac0..cb92ad9 100644
--- a/examples/declarative/listview/highlight.qml
+++ b/examples/declarative/listview/highlight.qml
@@ -44,7 +44,7 @@ Rectangle {
id: PetHighlight
Rectangle {
width: 200; height: 50; color: "#FFFF88"
- y: SpringFollow { source: List1.current.y; spring: 3; damping: 0.1 }
+ y: SpringFollow { source: List1.currentItem.y; spring: 3; damping: 0.1 }
}
}
ListView {
diff --git a/examples/declarative/loader/Browser.qml b/examples/declarative/loader/Browser.qml
index 196cdc5..6711de4 100644
--- a/examples/declarative/loader/Browser.qml
+++ b/examples/declarative/loader/Browser.qml
@@ -82,7 +82,7 @@ Rectangle {
focus: true
Keys.onPressed: {
if (event.key == Qt.Key_Return || event.key == Qt.Key_Select) {
- View.current.launch();
+ View.currentItem.launch();
event.accepted = true;
}
}