-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFingers.qml
58 lines (42 loc) · 1.15 KB
/
Fingers.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import QtQuick 1.1
import "ManageFingers.js" as FC
Rectangle {
//set geometry of rectangle to half of screen size both length and width
id: mainView
width: 600
height: 300
color: "black"
focus: true
//Build a Component for refering finger tip position
//Has to be child of the root element
Component {
id: fingerTip
Rectangle {
height: 20; width: height; radius: height/2
color: "skyblue"
}
}
//Destroy the Component when index is given
//Listen if a component has to be created
//Listen if a component has to be destroyed
//Listen for the placement of the fingers
//Apply the placement
//Keys & Status Display
property int idNo : 1
Keys.onPressed: {
if(event.key===Qt.Key_Up) {
FC.createFinger(fingerTip,mainView,status)
}
if(event.key===Qt.Key_Down) {
var fingerId = 'finger'+idNo
FC.destroyFinger(fingerId, status)
idNo++
}
}
Text {
id: status
anchors.centerIn: parent
text: "Status Display"
color: "white"
}
}