5import QGroundControl.Controls
7/// A PreFlightCheckGroup manages a set of PreFlightCheckButtons as a single entity. Groups are always expanded;
8/// PreFlightCheckList disables (locks) a group until every group above it has passed.
11 property bool passed: false
12 readonly property bool failed: failedCount > 0
13 readonly property Item headerItem: groupHeader
15 readonly property int failedCount: {
17 for (const button of innerColumn.children) {
25 spacing: ScreenTools.defaultFontPixelHeight / 2
27 Layout.fillWidth: true
28 Layout.preferredWidth: 0
29 Layout.minimumWidth: 0
32 if (parent && typeof parent.groupPassedChanged === "function") {
33 parent.groupPassedChanged()
37 Component.onCompleted: {
40 for (i = 2; i < children.length; i++) {
41 moveList.push(children[i])
43 for (i = 0; i < moveList.length; i++) {
44 moveList[i].parent = innerColumn
49 for (var i=0; i<innerColumn.children.length; i++) {
50 innerColumn.children[i].reset()
56 anchors.left: parent.left
57 anchors.right: parent.right
59 text: name + (passed ? qsTr(" (passed)") : (enabled ? "" : qsTr(" (locked)")))
60 color: !enabled ? groupPalette.textPrimary :
61 (failed ? groupPalette.errorText : (passed ? groupPalette.successText : groupPalette.warningText))
64 QGCPalette { id: groupPalette; colorGroupEnabled: enabled }
69 spacing: ScreenTools.defaultFontPixelHeight / 2
71 function buttonPassedChanged() {
72 for (var i=0; i<children.length; i++) {
73 if (!children[i].passed) {