summaryrefslogtreecommitdiffstats
path: root/examples/declarative/mouseregion
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/mouseregion')
-rw-r--r--examples/declarative/mouseregion/mouse.qml20
1 files changed, 5 insertions, 15 deletions
diff --git a/examples/declarative/mouseregion/mouse.qml b/examples/declarative/mouseregion/mouse.qml
index 6d10425..471874d 100644
--- a/examples/declarative/mouseregion/mouse.qml
+++ b/examples/declarative/mouseregion/mouse.qml
@@ -1,15 +1,10 @@
Rect {
color: "white"
- width: 200
- height: 200
+ width: 200; height: 200
Rect {
- width: 50
- height: 50
+ width: 50; height: 50
color: "red"
- Text {
- text: "Click"
- anchors.centeredIn: parent
- }
+ 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 & Qt.ShiftModifier ? 'true' : 'false') + ')') }
onReleased: { print('release (x: ' + mouse.x + ' y: ' + mouse.y + ' isClick: ' + mouse.isClick + ' wasHeld: ' + mouse.wasHeld + ')') }
@@ -22,14 +17,9 @@ Rect {
}
}
Rect {
- y: 100
- width: 50
- height: 50
+ y: 100; width: 50; height: 50
color: "blue"
- Text {
- text: "Drag"
- anchors.centeredIn: parent
- }
+ Text { text: "Drag"; anchors.centeredIn: parent }
MouseRegion {
drag.target: parent
drag.axis: "x"