QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
MainStatusChecklistHost.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Layouts
3
4/// Shows the single checklist instance owned by a Loader. The checklist keeps its progress, so it is handed back to
5/// the loader when this host is destroyed.
6Item {
7 id: control
8
9 required property Loader loader
10
11 Layout.fillWidth: true
12 implicitHeight: loader.item ? loader.item.implicitHeight : 0
13
14 function adoptChecklist() {
15 if (loader.item) {
16 loader.item.parent = control
17 }
18 }
19
20 Connections {
21 target: control.loader
22 function onItemChanged() { control.adoptChecklist() }
23 }
24
25 Binding {
26 target: control.loader.item
27 property: "width"
28 value: control.width
29 when: !!control.loader.item
30 restoreMode: Binding.RestoreNone
31 }
32
33 Component.onCompleted: adoptChecklist()
34
35 Component.onDestruction: {
36 if (loader.item) {
37 loader.item.parent = loader
38 }
39 }
40}