QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
PipState.qml
Go to the documentation of this file.
1import QtQuick
2
3// Used to manage state for itesm using with QGCPipOveral
4Item {
5 id: control
6 state: initState
7
8 readonly property string initState: "init"
9 readonly property string pipState: "pip"
10 readonly property string fullState: "full"
11 readonly property string windowState: "window"
12
13 property var pipView // PipView control
14 property bool isDark: true // true: Use dark overlay visuals
15
16 signal windowAboutToOpen // Catch this signal to do something special prior to the item transition to windowed mode
17 signal windowAboutToClose // Catch this signal to do special processing prior to the item transition back to pip mode
18
19 property var _viewControl: control.parent
20
21 states: [
22 State {
23 name: pipState
24
25 AnchorChanges {
26 target: _viewControl
27 anchors.top: pipView._pipContentItem.top
28 anchors.bottom: pipView._pipContentItem.bottom
29 anchors.left: pipView._pipContentItem.left
30 anchors.right: pipView._pipContentItem.right
31 }
32
33 ParentChange {
34 target: _viewControl
35 parent: pipView._pipContentItem
36 }
37 },
38 State {
39 name: fullState
40
41 AnchorChanges {
42 target: _viewControl
43 anchors.top: pipView.parent.top
44 anchors.bottom: pipView.parent.bottom
45 anchors.left: pipView.parent.left
46 anchors.right: pipView.parent.right
47 }
48
49 ParentChange {
50 target: _viewControl
51 parent: pipView.parent
52 }
53 },
54 State {
55 name: windowState
56
57 AnchorChanges {
58 target: _viewControl
59 anchors.top: pipView._windowContentItem.top
60 anchors.bottom: pipView._windowContentItem.bottom
61 anchors.left: pipView._windowContentItem.left
62 anchors.right: pipView._windowContentItem.right
63 }
64
65 ParentChange {
66 target: _viewControl
67 parent: pipView._windowContentItem
68 }
69
70 StateChangeScript {
71 script: {
72 control.windowAboutToOpen()
73 pipView.showWindow()
74 }
75 }
76 }
77 ]
78}