debian build fixed for new name mardrone
[mardrone] / mardrone / JoyStick2.qml
1 import Qt 4.7
2 import Qt.labs.gestures 2.0
3
4
5 Rectangle {
6     id:joystick2
7     property int xv:(knob.x-(width-knob.width)/2)*(200/(width-knob.width))
8     property int yv:(knob.y-(height-knob.height)/2)*(200/(height-knob.height))
9     width: 200
10     height: 200
11     Text {
12         id: xtext
13         text:xv
14     }
15     Text {
16         id: ytext
17         x:40
18         text: yv
19     }
20     Text {
21         id: msg
22         x:100
23         text: ""
24     }
25
26
27
28     Rectangle {
29         id:knob
30         x:parent.width/2-width/2
31         y:parent.width/2-height/2
32         width:20;
33         height:20;
34         color:"black"
35     }
36     GestureArea {
37              anchors.fill: parent
38              focus: true
39
40              // Only some of the many gesture properties are shown. See Gesture documentation.
41
42 /*
43              Default {
44
45              onStarted: console.log("onStarted pos = (",gesture.position.x,",",gesture.position.y,")")
46              onFinished:console.log("onFinished pos = (",gesture.position.x,",",gesture.position.y,")")
47              onUpdated: console.log("onUpdated pos = (",gesture.position.x,",",gesture.position.y,")");
48             }
49             */
50 /*
51              Tap {
52                onStarted:console.log("tap onStarted pos = (",gesture.position.x,",",gesture.position.y,")")
53                onFinished:console.log("tap onFinished pos = (",gesture.position.x,",",gesture.position.y,")")
54                onUpdated:{
55                      console.log("tap onUpdated pos = (",gesture.position.x,",",gesture.position.y,")");
56                      // msg.text=gesture.position.x+","+gesture.position.y
57                    }
58               }
59              //onTapAndHold:
60              //    console.log("tap and hold pos = (",gesture.position.x,",",gesture.position.y,")")
61 */
62              Pan {
63                onStarted: console.log("pan onStarted  delta = (",gesture.delta.x,",",gesture.delta.y,") acceleration = ",gesture.acceleration)
64                onFinished:console.log("pan onFinished  delta = (",gesture.delta.x,",",gesture.delta.y,") acceleration = ",gesture.acceleration)
65                onUpdated: {
66                     console.log("pan onUpdated pos = (",gesture.delta.x,",",gesture.delta.y,")");
67                     msg.text=gesture.delta.x+","+gesture.delta.y;
68                 }
69              }
70
71             /*
72              onPinch:
73                  console.log("pinch center = (",gesture.centerPoint.x,",",gesture.centerPoint.y,") rotation =",gesture.rotationAngle," scale =",gesture.scaleFactor)
74              onSwipe:
75                  console.log("swipe angle=",gesture.swipeAngle)
76              onGesture:
77                  console.log("gesture hot spot = (",gesture.hotSpot.x,",",gesture.hotSpot.y,")")
78              */
79          }
80
81 }