7import QGroundControl.Controls
8import QGroundControl.FlyView
10/// Shows the pre-vehicle checks. Unlike PreFlightCheckList it is not tied to a vehicle, so its progress survives
11/// vehicle connect and disconnect.
13 objectName: "preVehicleCheckList"
14 spacing: 0.8 * ScreenTools.defaultFontPixelWidth
16 property Item _firstHeader: null ///< SectionHeader of the first group
17 readonly property real _headerLineGap: 2
19 readonly property var _model: modelContainer.item ? modelContainer.item.model : null
20 readonly property bool hasGroups: !!_model && _model.count > 0
21 property bool allChecksPassed: !hasGroups
25 source: "qrc:/qml/QGroundControl/FlyView/PreVehicleChecks.qml"
29 if (checkListRepeater.model) {
30 checkListRepeater.model.reset()
34 function groupPassedChanged() {
35 const model = checkListRepeater.model
39 model.updateGroupLocks()
40 allChecksPassed = model.isPassed()
43 // Zero-height row so the Reset button floats over the first group header's empty right side
45 Layout.fillWidth: true
46 Layout.preferredHeight: 0
47 Layout.bottomMargin: -parent.spacing
52 objectName: "preVehicleCheckListResetButton"
54 anchors.right: parent.right
55 y: _firstHeader ? Math.max(0, _firstHeader.height - _firstHeader.bottomPadding - height - _headerLineGap) : 0
65 onItemAdded: (index, item) => {
66 if (index === 0 && item.headerItem) {
67 _firstHeader = item.headerItem
68 _firstHeader.showSpacer = false
69 _firstHeader.topPadding = 0
71 // Automatic checks can pass before the group gets a parent to notify, so count them now