-
Notifications
You must be signed in to change notification settings - Fork 9
/
location.qml
52 lines (39 loc) · 912 Bytes
/
location.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
import QtQuick 2.0
import QtQuick.Controls 1.4
Rectangle {
property string trackname: ""
id: main
width: content.width + 10
height: content.height + 10
x: 0
y: 0
color: "white"
Column {
id: content
anchors.centerIn: parent
Label {
text: "Tracker: " + trackname
}
Button {
anchors.right: parent.right
anchors.left: parent.left
text: "Remove me"
onClicked: {
map.removeLocationTracking(trackname)
}
}
}
Connections {
target: map
onLocationChanged: {
if (id !== trackname) return;
x = pixel.x
y = pixel.y
main.visible = visible
}
onLocationTrackingRemoved: {
if (id !== trackname) return;
main.destroy()
}
}
}