QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
RallyPointList.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Layouts
3
4import QGroundControl
5import QGroundControl.Controls
6
7/// List of the rally points of the Rally Points tab
8QGCListView {
9 id: root
10
11 required property var page
12
13 signal itemActivated
14
15 objectName: "planPanel_rallyList"
16 model: page.points
17 spacing: ScreenTools.defaultFontPixelHeight * 0.1
18 clip: true
19
20 delegate: PlanPanelRow {
21 id: row
22
23 required property var object
24 required property int index
25
26 objectName: "planPanel_rallyRow_" + index
27 width: root.width
28 selected: object === root.page.current
29
30 onClicked: {
31 if (!mainWindow.allowViewSwitch()) {
32 return
33 }
34 root.page.select(object)
35 root.itemActivated()
36 }
37
38 Rectangle {
39 Layout.preferredWidth: ScreenTools.defaultFontPixelHeight * 1.5
40 Layout.preferredHeight: Layout.preferredWidth
41 radius: width / 2
42 color: row.selected ? qgcPal.accent : "transparent"
43 border.width: 2
44 border.color: row.selected ? qgcPal.accent : qgcPal.textPrimary
45
46 QGCLabel {
47 anchors.centerIn: parent
48 text: String(row.index + 1)
49 font.pointSize: ScreenTools.smallFontPointSize
50 font.bold: true
51 color: row.selected ? qgcPal.accentText : qgcPal.textPrimary
52 }
53 }
54
55 QGCLabel {
56 Layout.fillWidth: true
57 elide: Text.ElideRight
58 text: qsTr("%1, %2").arg(row.object.coordinate.latitude.toFixed(5)).arg(row.object.coordinate.longitude.toFixed(5))
59 }
60
61 QGCLabel {
62 color: qgcPal.textSecondary
63 font.pointSize: ScreenTools.smallFontPointSize
64 text: qsTr("%1 %2").arg(QGroundControl.unitsConversion.metersToAppSettingsVerticalDistanceUnitsString(row.object.coordinate.altitude))
65 .arg(QGroundControl.altitudeFrameExtraUnits(row.object.altitudeFrame))
66 }
67 }
68
69 QGCPalette { id: qgcPal }
70}