summaryrefslogtreecommitdiffstats
path: root/examples/declarative
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-04-28 05:05:53 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-04-28 05:05:53 (GMT)
commit2b8abf28d10a6d064fe116892161289be5ffb391 (patch)
tree6a1123766682c82bddbdf358316f26e11f6976c7 /examples/declarative
parentd7ffaa8ccbf881d25004b9a710259701d1a8c9bc (diff)
parenta6ffd7c7c28066f2794579bc40e7b9517e76d1ff (diff)
downloadQt-2b8abf28d10a6d064fe116892161289be5ffb391.zip
Qt-2b8abf28d10a6d064fe116892161289be5ffb391.tar.gz
Qt-2b8abf28d10a6d064fe116892161289be5ffb391.tar.bz2
Merge branch 'kinetic-declarativeui' of ../kinetic into kinetic-declarativeui-qfx
Conflicts: examples/declarative/mouseregion/mouse.qml
Diffstat (limited to 'examples/declarative')
-rw-r--r--examples/declarative/mouseregion/mouse.qml72
1 files changed, 24 insertions, 48 deletions
diff --git a/examples/declarative/mouseregion/mouse.qml b/examples/declarative/mouseregion/mouse.qml
index 070543c..7aaf51a 100644
--- a/examples/declarative/mouseregion/mouse.qml
+++ b/examples/declarative/mouseregion/mouse.qml
@@ -1,48 +1,24 @@
-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: ' + 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
- }
- }
- Rect {
- y: 100
- width: 50
- height: 50
- color: "blue"
- Text {
- text: "Drag"
- anchors.centeredIn: parent
- }
- MouseRegion {
- drag.target: parent
- drag.axis: "x"
- drag.xmin: 0
- drag.xmax: 150
- onPressed: { print('press') }
- 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') }
- onReenteredWhilePressed: { print('reentering while pressed') }
- anchors.fill: parent
- }
- }
-}
+<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: ' + mouse.x + ' y: ' + mouse.y + ' button: ' + (mouse.button == Qt.RightButton ? 'right' : 'left') + ' Shift: ' + (mouse.modifiers &amp; Qt.ShiftModifier ? 'true' : 'false') + ')')"
+ 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}"/>
+ </Rect>
+ <Rect y="100" width="50" height="50" color="blue">
+ <Text text="Drag" anchors.centeredIn="{parent}"/>
+ <MouseRegion drag.target="{parent}"
+ drag.axis="x" drag.xmin="0" drag.xmax="150"
+ onPressed="print('press')"
+ 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')"
+ onReenteredWhilePressed="print('reentering while pressed')" anchors.fill="{parent}"/>
+ </Rect>
+</Rect>