summaryrefslogtreecommitdiffstats
path: root/examples/declarative/mouseregion/mouse.qml
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-04-27 07:39:47 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-04-27 07:39:47 (GMT)
commitd782ceee4de31bc4a11cd6cdeacc881bd1c118d8 (patch)
tree59622d424b34ca6d5195fb2ddcc4f4dc393abbd1 /examples/declarative/mouseregion/mouse.qml
parentc33403a2e6a567a1e9bae9c0384a70dcae7d9961 (diff)
downloadQt-d782ceee4de31bc4a11cd6cdeacc881bd1c118d8.zip
Qt-d782ceee4de31bc4a11cd6cdeacc881bd1c118d8.tar.gz
Qt-d782ceee4de31bc4a11cd6cdeacc881bd1c118d8.tar.bz2
Make MouseRegion signals pass a mouse event as their parameter.
Diffstat (limited to 'examples/declarative/mouseregion/mouse.qml')
-rw-r--r--examples/declarative/mouseregion/mouse.qml12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/declarative/mouseregion/mouse.qml b/examples/declarative/mouseregion/mouse.qml
index f0f22ac..9581da2 100644
--- a/examples/declarative/mouseregion/mouse.qml
+++ b/examples/declarative/mouseregion/mouse.qml
@@ -1,10 +1,10 @@
<Rect color="white" width="200" height="200">
<Rect width="50" height="50" color="red">
<Text text="Click" anchors.centeredIn="{parent}"/>
- <MouseRegion onPressed="print('press (x: ' + x + ' y: ' + y + ')')"
- onReleased="print('release (x: ' + x + ' y: ' + y + ' isClick: ' + isClick + ' followsPressAndHold: ' + followsPressAndHold + ')')"
- onClicked="print('click (x: ' + x + ' y: ' + y + ' followsPressAndHold: ' + followsPressAndHold + ')')"
- onDoubleClicked="print('double click (x: ' + x + ' y: ' + y + ')')"
+ <MouseRegion onPressed="print('press (x: ' + mouse.x + ' y: ' + mouse.y + ')')"
+ onReleased="print('release (x: ' + mouse.x + ' y: ' + mouse.y + ' isClick: ' + mouse.isClick + ' wasHeld: ' + mouse.wasHeld + ')')"
+ onClicked="print('click (x: ' + mouse.x + ' y: ' + mouse.y + ' wasHeld: ' + mouse.wasHeld + ')')"
+ onDoubleClicked="print('double click (x: ' + mouse.x + ' y: ' + mouse.y + ')')"
onPressAndHold="print('press and hold')"
onExitedWhilePressed="print('exiting while pressed')"
onReenteredWhilePressed="print('reentering while pressed')" anchors.fill="{parent}"/>
@@ -14,8 +14,8 @@
<MouseRegion drag.target="{parent}"
drag.axis="x" drag.xmin="0" drag.xmax="150"
onPressed="print('press')"
- onReleased="print('release (isClick: ' + isClick + ') (followsPressAndHold: ' + followsPressAndHold + ')')"
- onClicked="print('click' + '(followsPressAndHold: ' + followsPressAndHold + ')')"
+ onReleased="print('release (isClick: ' + mouse.isClick + ') (wasHeld: ' + mouse.wasHeld + ')')"
+ onClicked="print('click' + '(wasHeld: ' + mouse.wasHeld + ')')"
onDoubleClicked="print('double click')"
onPressAndHold="print('press and hold')"
onExitedWhilePressed="print('exiting while pressed')"