8import QGroundControl.Controls
9import QGroundControl.FactControls
10import QGroundControl.FlyView
11import QGroundControl.FlightMap
12import QGroundControl.PlanView
13import QGroundControl.Toolbar
15/// @brief Native QML top level window
16/// All properties defined here are visible to all QML pages.
20 // The special casing for android prevents white bars from showing up on the edges of the screen with newer android versions
21 flags: Qt.Window | (ScreenTools.isAndroid ? Qt.ExpandedClientAreaHint | Qt.NoTitleBarBackgroundHint : 0)
23 // Qt 6.9+ auto-sets ApplicationWindow padding to the display safe-area insets on mobile,
24 // which insets our full-bleed content and leaves a blank strip along the screen edge.
25 // QGC draws edge-to-edge and manages its own insets, so zero the padding.
31 Component.onCompleted: {
32 // Start the sequence of first run prompt(s)
33 firstRunPromptManager.nextPrompt()
36 /// Saves main window position and size and re-opens it in the same position and size next time
37 MainWindowSavedState {
42 id: firstRunPromptManager
44 property var currentDialog: null
45 property var rgPromptIds: QGroundControl.corePlugin.firstRunPromptsToShow()
46 property int nextPromptIdIndex: 0
48 function clearNextPromptSignal() {
50 currentDialog.closed.disconnect(nextPrompt)
54 function nextPrompt() {
55 if (nextPromptIdIndex < rgPromptIds.length) {
56 var component = Qt.createComponent(QGroundControl.corePlugin.firstRunPromptResource(rgPromptIds[nextPromptIdIndex]));
57 currentDialog = component.createObject(mainWindow)
58 currentDialog.closed.connect(nextPrompt)
67 readonly property real _topBottomMargins: ScreenTools.defaultFontPixelHeight * 0.5
69 //-------------------------------------------------------------------------
70 //-- Global Scope Variables
75 readonly property var activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
76 readonly property real defaultTextHeight: ScreenTools.defaultFontPixelHeight
77 readonly property real defaultTextWidth: ScreenTools.defaultFontPixelWidth
78 readonly property var planMasterControllerFlyView: flyView.planController
79 readonly property var guidedControllerFlyView: flyView.guidedController
81 // Number of QGCTextField's with validation errors. Used to prevent closing panels with validation errors.
82 property int validationErrorCount: 0
84 // Set to a non-empty string to block navigation with a custom reason (e.g. during calibration)
85 property string navigationBlockedReason: ""
87 // Property to manage RemoteID quick access to settings page
88 property bool commingFromRIDIndicator: false
91 /// Default color palette used throughout the UI
92 QGCPalette { id: qgcPal; colorGroupEnabled: true }
94 //-------------------------------------------------------------------------
97 signal armVehicleRequest
98 signal forceArmVehicleRequest
99 signal disarmVehicleRequest
100 signal vtolTransitionToFwdFlightRequest
101 signal vtolTransitionToMRFlightRequest
103 //-------------------------------------------------------------------------
104 //-- Global Scope Functions
106 // This function is used to prevent view switching if there are validation errors
107 function allowViewSwitch(previousValidationErrorCount = 0, showErrorOnDisallow = true) {
108 // Check for explicit navigation block (e.g. calibration in progress)
109 if (globals.navigationBlockedReason !== "") {
110 if (showErrorOnDisallow) {
111 validationErrorToast.text = globals.navigationBlockedReason
112 if (validationErrorToast.visible) {
113 validationErrorToast.close()
115 validationErrorToast.open()
119 // Run validation on active focus control to ensure it is valid before switching views
120 if (mainWindow.activeFocusControl instanceof FactTextField) {
121 mainWindow.activeFocusControl._onEditingFinished()
123 var allowed = globals.validationErrorCount <= previousValidationErrorCount
124 if (!allowed && showErrorOnDisallow) {
125 validationErrorToast.text = qsTr("Please correct the invalid value before continuing")
126 if (validationErrorToast.visible) {
127 validationErrorToast.close()
129 validationErrorToast.open()
134 function showPlanView() {
135 flyView.visible = false
136 planView.visible = true
137 toolDrawer.visible = false
140 function showFlyView() {
141 flyView.visible = true
142 planView.visible = false
143 toolDrawer.visible = false
146 function showTool(toolTitle, toolSource, toolIcon) {
147 toolDrawer.backIcon = flyView.visible ? "/qmlimages/PaperPlane.svg" : "/qmlimages/Plan.svg"
148 toolDrawer.toolTitle = toolTitle
149 toolDrawer.toolSource = toolSource
150 toolDrawer.toolIcon = toolIcon
151 toolDrawer.visible = true
154 function showAnalyzeTool() {
155 showTool(qsTr("Analyze Tools"), "qrc:/qml/QGroundControl/AnalyzeView/AnalyzeView.qml", "/qmlimages/Analyze.svg")
158 function showVehicleConfig() {
159 showTool(qsTr("Vehicle Configuration"), "qrc:/qml/QGroundControl/VehicleSetup/VehicleConfigView.qml", "/qmlimages/Gears.svg")
162 function showVehicleConfigParametersPage() {
164 toolDrawerLoader.item.showParametersPanel()
167 function showKnownVehicleComponentConfigPage(knownVehicleComponent) {
169 let vehicleComponent = globals.activeVehicle.autopilotPlugin.findKnownVehicleComponent(knownVehicleComponent)
170 if (vehicleComponent) {
171 toolDrawerLoader.item.showVehicleComponentPanel(vehicleComponent)
175 function showSettingsTool(settingsPage = "") {
176 showTool(qsTr("Application Settings"), "qrc:/qml/QGroundControl/Controls/AppSettings.qml", "/res/QGCLogoWhite")
177 if (settingsPage !== "") {
178 toolDrawerLoader.item.showSettingsPage(settingsPage)
182 //-------------------------------------------------------------------------
183 //-- Global simple message dialog
185 function _showMessageDialogWorker(owner, dialogTitle, dialogText, buttons = Dialog.Ok, acceptFunction = null, closeFunction = null, bypassNavigationCheck = false) {
186 let dialog = simpleMessageDialogComponent.createObject(owner, { title: dialogTitle, text: dialogText, buttons: buttons, acceptFunction: acceptFunction, closeFunction: closeFunction, bypassNavigationCheck: bypassNavigationCheck })
190 // This variant is only meant to be called by QGCApplication
191 function _showMessageDialog(dialogTitle, dialogText) {
192 _showMessageDialogWorker(mainWindow, dialogTitle, dialogText)
196 target: QGroundControl
198 function onShowMessageDialogRequested(owner, title, text, buttons, acceptFunction, closeFunction) {
199 _showMessageDialogWorker(owner, title, text, buttons, acceptFunction, closeFunction)
204 id: simpleMessageDialogComponent
206 QGCSimpleMessageDialog {
210 property bool _forceClose: false
211 property bool suppressCriticalVehicleMessages: false
213 function finishCloseProcess() {
215 // For some reason on the Qml side Qt doesn't automatically disconnect a signal when an object is destroyed.
216 // So we have to do it ourselves otherwise the signal flows through on app shutdown to an object which no longer exists.
217 firstRunPromptManager.clearNextPromptSignal()
218 QGroundControl.linkManager.shutdown()
219 QGroundControl.videoManager.stopVideo();
223 // Check for things which should prevent the app from closing
224 // Returns true if it is OK to close
225 readonly property int _skipUnsavedMissionCheckMask: 0x01
226 readonly property int _skipPendingParameterWritesCheckMask: 0x02
227 readonly property int _skipActiveConnectionsCheckMask: 0x04
228 property int _closeChecksToSkip: 0
229 property bool _reentrantCloseGuard: false
230 function performCloseChecks() {
231 if (!(_closeChecksToSkip & _skipUnsavedMissionCheckMask) && !checkForUnsavedMission()) {
234 if (!(_closeChecksToSkip & _skipPendingParameterWritesCheckMask) && !checkForPendingParameterWrites()) {
237 if (!(_closeChecksToSkip & _skipActiveConnectionsCheckMask) && !checkForActiveConnections()) {
244 function _hasUnsavedMission() {
245 // Only warn when edits are neither saved to disk nor uploaded to the vehicle.
246 // If either happened the edits are recoverable, so closing loses nothing.
247 // With no active vehicle an upload can't have happened, so treat the plan as
248 // not uploaded regardless of dirtyForUpload.
249 return planView._planMasterController.dirtyForSave &&
250 (planView._planMasterController.dirtyForUpload || !QGroundControl.multiVehicleManager.activeVehicle)
253 function _hasPendingParameterWrites() {
254 for (var index=0; index<QGroundControl.multiVehicleManager.vehicles.count; index++) {
255 if (QGroundControl.multiVehicleManager.vehicles.get(index).parameterManager.pendingWrites) {
262 function _hasActiveConnections() {
263 return !!QGroundControl.multiVehicleManager.activeVehicle
266 /// True when closing would show at least one close-check warning
267 function _closeNeedsConfirmation() {
268 return _hasUnsavedMission() || _hasPendingParameterWrites() || _hasActiveConnections()
271 function checkForUnsavedMission() {
272 if (_hasUnsavedMission()) {
274 _reentrantCloseGuard = true
275 _showMessageDialogWorker(mainWindow, qsTr("Unsaved Mission"),
276 qsTr("You have a mission edit in progress which has not been saved/uploaded. If you close you will lose changes. Are you sure you want to close?"),
277 Dialog.Yes | Dialog.No,
278 function() { accepted = true; _closeChecksToSkip |= _skipUnsavedMissionCheckMask; performCloseChecks() },
279 function() { if (!accepted) _reentrantCloseGuard = false },
280 true /* bypassNavigationCheck */)
287 function checkForPendingParameterWrites() {
288 if (_hasPendingParameterWrites()) {
290 _reentrantCloseGuard = true
291 _showMessageDialogWorker(mainWindow, qsTr("Pending Parameter Updates"),
292 qsTr("You have pending parameter updates to a vehicle. If you close you will lose changes. Are you sure you want to close?"),
293 Dialog.Yes | Dialog.No,
294 function() { accepted = true; _closeChecksToSkip |= _skipPendingParameterWritesCheckMask; performCloseChecks() },
295 function() { if (!accepted) _reentrantCloseGuard = false },
296 true /* bypassNavigationCheck */)
302 function checkForActiveConnections() {
303 if (_hasActiveConnections()) {
305 _reentrantCloseGuard = true
306 _showMessageDialogWorker(mainWindow, qsTr("Active Vehicle Connections"),
307 qsTr("There are still active connections to vehicles. Are you sure you want to exit?"),
308 Dialog.Yes | Dialog.No,
309 function() { accepted = true; _closeChecksToSkip |= _skipActiveConnectionsCheckMask; performCloseChecks() },
310 function() { if (!accepted) _reentrantCloseGuard = false },
311 true /* bypassNavigationCheck */)
318 onClosing: (close) => {
320 if (_reentrantCloseGuard) {
321 close.accepted = false
324 _closeChecksToSkip = 0
325 close.accepted = performCloseChecks()
329 // Since Qt 6.12 an unhandled Android back press backgrounds the app without a close event.
330 // Route back through the close checks while they would warn; open popups still take back first.
332 objectName: "androidBackShortcut"
333 sequences: [ "Back" ]
334 enabled: Qt.platform.os === "android" && mainWindow._closeNeedsConfirmation()
335 onActivated: mainWindow.close()
338 background: Rectangle {
340 color: QGroundControl.globalPalette.window
343 // Disabled under the tool drawer: pointer handlers (e.g. GeoMap DragHandler) still get presses through it and steal drags
346 objectName: "mainView_fly"
348 enabled: !toolDrawer.visible
353 objectName: "mainView_plan"
356 enabled: !toolDrawer.visible
359 footer: LogReplayStatusBar {
360 visible: QGroundControl.settingsManager.flyViewSettings.showLogReplayStatusBar.rawValue
364 id: showTouchAreasNotification
365 title: qsTr("Debug Touch Areas")
366 text: qsTr("Touch Area display toggled")
367 buttons: MessageDialog.Ok
371 id: advancedModeOnConfirmation
372 title: qsTr("Advanced Mode")
373 text: QGroundControl.corePlugin.showAdvancedUIMessage
374 buttons: MessageDialog.Yes | MessageDialog.No
375 onButtonClicked: function (button, role) {
376 if (button === MessageDialog.Yes) {
377 QGroundControl.corePlugin.showAdvancedUI = true
383 id: advancedModeOffConfirmation
384 title: qsTr("Advanced Mode")
385 text: qsTr("Turn off Advanced Mode?")
386 buttons: MessageDialog.Yes | MessageDialog.No
387 onButtonClicked: function (button, role) {
388 if (button === MessageDialog.Yes) {
389 QGroundControl.corePlugin.showAdvancedUI = false
394 function showToolSelectDialog() {
395 if (mainWindow.allowViewSwitch()) {
396 mainWindow.showIndicatorDrawer(toolSelectComponent, null)
400 // Toast notification shown when a view switch is blocked by a validation error
402 id: validationErrorToast
403 x: (mainWindow.width - width) / 2
404 y: mainWindow.height - height - ScreenTools.defaultFontPixelHeight * 3
406 closePolicy: Popup.NoAutoClose
407 text: qsTr("Please correct the invalid value before continuing")
409 background: Rectangle {
410 color: qgcPal.alertBackground
411 radius: ScreenTools.defaultFontPixelWidth / 2
414 contentItem: QGCLabel {
415 text: validationErrorToast.text
416 color: qgcPal.alertText
421 id: toolSelectComponent
429 objectName: "mainView_toolDrawer"
434 property var backIcon
435 property string toolTitle
436 property alias toolSource: toolDrawerLoader.source
437 property var toolIcon
440 if (!toolDrawer.visible) {
441 toolDrawerLoader.source = ""
445 // This need to block click event leakage to underlying map.
451 id: toolDrawerToolbar
452 anchors.left: parent.left
453 anchors.right: parent.right
454 anchors.top: parent.top
455 height: ScreenTools.toolbarHeight
456 color: qgcPal.toolbarBackground
459 id: toolDrawerToolbarLayout
460 anchors.leftMargin: ScreenTools.defaultFontPixelWidth
461 anchors.left: parent.left
462 anchors.top: parent.top
463 anchors.bottom: parent.bottom
464 spacing: ScreenTools.defaultFontPixelWidth
468 objectName: "toolbar_qgcLogo"
469 height: parent.height
470 icon.source: "/res/QGCLogoFull.svg"
472 onClicked: mainWindow.showToolSelectDialog()
476 id: toolbarDrawerText
477 text: toolDrawer.toolTitle
478 font.pointSize: ScreenTools.largeFontPointSize
485 anchors.left: parent.left
486 anchors.right: parent.right
487 anchors.top: toolDrawerToolbar.bottom
488 anchors.bottom: parent.bottom
492 //-------------------------------------------------------------------------
493 //-- Critical Vehicle Message Popup
495 function showCriticalVehicleMessage(message) {
496 if (suppressCriticalVehicleMessages) {
499 if (criticalVehicleMessagePopup.visible) {
500 // Once a message is held back, later ones are too so the shown messages stay in order
501 if (!criticalVehicleMessagePopup.additionalCriticalMessagesReceived && criticalVehicleMessagePopup.appendMessageIfRoom(message)) {
502 criticalVehicleMessageDismissTimer.restart()
503 } else if (!criticalVehicleMessagePopup.additionalCriticalMessagesReceived) {
504 // When the user closes the popup drop the message indicator tool so they can see the rest.
505 criticalVehicleMessagePopup.additionalCriticalMessagesReceived = true
506 // Leave time to act on the new "Click to see more" prompt
507 criticalVehicleMessageDismissTimer.restart()
509 } else if (QGroundControl.videoManager.fullScreen) {
510 criticalVehicleMessagePopup.additionalCriticalMessagesReceived = true
512 criticalVehicleMessagePopup.criticalVehicleMessage = message
513 criticalVehicleMessagePopup.shownMessageCount = 1
514 criticalVehicleMessagePopup.additionalCriticalMessagesReceived = false
515 criticalVehicleMessagePopup.open()
519 // No focus and no Escape handler: either would steal keys from whatever the user is typing in.
521 id: criticalVehicleMessagePopup
522 objectName: "criticalVehicleMessage_popup"
523 y: ScreenTools.toolbarHeight + ScreenTools.defaultFontPixelHeight - topInset
524 x: Math.round((mainWindow.width - width) * 0.5)
525 width: mainWindow.width * 0.55
526 height: criticalVehicleMessageText.contentHeight + _chromeHeight
527 topInset: vehicleWarningHeading.height / 2
528 topPadding: padding + topInset
530 closePolicy: Popup.CloseOnPressOutside
532 property alias criticalVehicleMessage: criticalVehicleMessageText.text
533 property bool additionalCriticalMessagesReceived: false
534 property int shownMessageCount: 0
535 readonly property int maxShownMessages: 5
537 readonly property real _chromeHeight: topInset + ScreenTools.defaultFontPixelHeight
538 readonly property real _maxHeight: mainWindow.height - y - ScreenTools.defaultFontPixelHeight
540 function appendMessageIfRoom(message) {
541 if (shownMessageCount >= maxShownMessages) {
544 const previousMessages = criticalVehicleMessage
545 criticalVehicleMessage += "<br/>" + message
546 if (criticalVehicleMessageText.contentHeight + _chromeHeight > _maxHeight) {
547 criticalVehicleMessage = previousMessages
554 function acknowledge() {
556 if (additionalCriticalMessagesReceived) {
557 additionalCriticalMessagesReceived = false
558 flyView.dropMainStatusIndicatorTool(true /* showMessages */)
562 background: Rectangle {
563 color: qgcPal.alertBackground
564 radius: ScreenTools.defaultFontPixelHeight * 0.5
565 border.color: qgcPal.alertBorder
569 id: vehicleWarningHeading
570 objectName: "criticalVehicleMessage_heading"
571 anchors.horizontalCenter: parent.horizontalCenter
572 anchors.top: parent.top
573 anchors.topMargin: -(height / 2)
574 color: qgcPal.alertBackground
575 radius: ScreenTools.defaultFontPixelHeight * 0.25
576 border.color: qgcPal.alertBorder
578 width: Math.min(vehicleWarningLabel.implicitWidth + _margins, parent.width - ScreenTools.defaultFontPixelHeight)
579 height: vehicleWarningLabel.contentHeight + _margins
581 property real _margins: ScreenTools.defaultFontPixelHeight * 0.25
584 id: vehicleWarningLabel
585 anchors.centerIn: parent
586 width: parent.width - parent._margins
587 horizontalAlignment: Text.AlignHCenter
588 elide: Text.ElideRight
589 text: criticalVehicleMessagePopup.additionalCriticalMessagesReceived ?
590 qsTr("Vehicle Alert - Click to see more") :
591 qsTr("Vehicle Alert")
592 font.pointSize: ScreenTools.smallFontPointSize
593 color: qgcPal.alertText
597 // Extends over the heading's overhang so clicking the heading acknowledges too
600 anchors.topMargin: -criticalVehicleMessagePopup.topInset
601 onClicked: criticalVehicleMessagePopup.acknowledge()
606 id: criticalVehicleMessageText
607 objectName: "criticalVehicleMessage_text"
608 width: criticalVehicleMessagePopup.width - ScreenTools.defaultFontPixelHeight
609 anchors.centerIn: parent
610 wrapMode: Text.WordWrap
611 color: qgcPal.alertText
612 textFormat: TextEdit.RichText
615 // Plain close, not acknowledge(): a timeout must not drop the status indicator drawer.
617 id: criticalVehicleMessageDismissTimer
618 objectName: "criticalVehicleMessage_dismissTimer"
620 running: criticalVehicleMessagePopup.visible
621 onTriggered: criticalVehicleMessagePopup.close()
625 //-------------------------------------------------------------------------
626 //-- Indicator Drawer
628 function showIndicatorDrawer(drawerComponent, indicatorItem) {
629 indicatorDrawer.sourceComponent = drawerComponent
630 indicatorDrawer.indicatorItem = indicatorItem
631 indicatorDrawer.open()
634 function closeIndicatorDrawer() {
635 indicatorDrawer.close()
638 // Fires before the active vehicle is cleared, so drawer contents never see it go null
640 target: QGroundControl.multiVehicleManager
641 function onActiveVehicleAvailableChanged(activeVehicleAvailable) {
642 if (!activeVehicleAvailable) {
643 closeIndicatorDrawer()
651 y: ScreenTools.toolbarHeight + _margins
656 padding: _margins * 2
660 closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
662 property var sourceComponent
663 property var indicatorItem
665 property bool _expanded: false
666 property real _margins: ScreenTools.defaultFontPixelHeight / 4
667 property bool _fillWindow: indicatorDrawerLoader.item ? indicatorDrawerLoader.item.fillWindow === true : false
669 function calcXPosition() {
674 var xCenter = indicatorItem.mapToItem(mainWindow.contentItem, indicatorItem.width / 2, 0).x
675 return Math.max(_margins, Math.min(xCenter - (contentItem.implicitWidth / 2), mainWindow.contentItem.width - contentItem.implicitWidth - _margins - (indicatorDrawer.padding * 2) - (ScreenTools.defaultFontPixelHeight / 2)))
683 indicatorDrawerLoader.sourceComponent = indicatorDrawer.sourceComponent
687 indicatorItem = undefined
688 indicatorDrawerLoader.sourceComponent = undefined
695 color: QGroundControl.globalPalette.window
696 border.color: QGroundControl.globalPalette.borderSubtle
697 radius: indicatorDrawer._margins
702 objectName: "indicatorDrawerExpandButton"
703 anchors.horizontalCenter: backgroundRect.right
704 anchors.verticalCenter: backgroundRect.top
705 width: ScreenTools.largeFontPixelHeight
708 color: QGroundControl.globalPalette.windowCard
709 border.color: QGroundControl.globalPalette.textPrimary
710 visible: indicatorDrawerLoader.item && indicatorDrawerLoader.item._showExpand && !indicatorDrawer._expanded
713 anchors.centerIn: parent
715 color: QGroundControl.globalPalette.textPrimary
720 onClicked: indicatorDrawer._expanded = true
725 contentItem: QGCFlickable {
726 id: indicatorDrawerLoaderFlickable
727 implicitWidth: indicatorDrawer._fillWindow ? _availableWidth : Math.min(_availableWidth, indicatorDrawerLoader.width)
728 implicitHeight: indicatorDrawer._fillWindow ? _availableHeight : Math.min(_availableHeight, indicatorDrawerLoader.height)
729 contentWidth: indicatorDrawerLoader.width
730 contentHeight: indicatorDrawerLoader.height
732 property real _availableWidth: mainWindow.contentItem.width - (2 * indicatorDrawer._margins) - (indicatorDrawer.padding * 2)
733 property real _availableHeight: mainWindow.contentItem.height - ScreenTools.toolbarHeight - (2 * indicatorDrawer._margins) - (indicatorDrawer.padding * 2)
736 id: indicatorDrawerLoader
737 objectName: "indicatorDrawerLoader"
738 width: indicatorDrawer._fillWindow ? indicatorDrawerLoaderFlickable.width : undefined
741 target: indicatorDrawerLoader.item
743 value: indicatorDrawer._expanded
747 target: indicatorDrawerLoader.item
749 value: indicatorDrawer
755 // Analyze page items (both in-panel and popped-out windows) are created with mainWindow as their
756 // QObject parent so their lifetime is not tied to AnalyzeView. This lets a popped-out window
757 // survive AnalyzeView being unloaded from the tool drawer.
759 // Tracks the analyze page item currently shown inside AnalyzeView's panel (not popped out).
760 // null when no page is loaded or the item has been handed off to a popup window.
761 property var _inPanelAnalyzePage: null
763 // Called by AnalyzeView.Component.onDestruction to destroy the in-panel item while
764 // panelContainer is still alive.
765 function destroyInPanelAnalyzePage() {
766 if (_inPanelAnalyzePage) {
767 _inPanelAnalyzePage.destroy()
768 _inPanelAnalyzePage = null
772 // Called by AnalyzeView to create an analyze page item owned by mainWindow.
773 // The caller sets the visual parent to panelContainer after creation.
774 function createAnalyzePage(source) {
775 if (_inPanelAnalyzePage) {
776 _inPanelAnalyzePage.destroy()
777 _inPanelAnalyzePage = null
779 var component = Qt.createComponent(source)
780 if (component.status !== Component.Ready) {
781 console.warn("createAnalyzePage failed source:", source, "errorString:", component.errorString())
784 _inPanelAnalyzePage = component.createObject(mainWindow)
785 return _inPanelAnalyzePage
788 // Called by AnalyzeView when the in-panel item is handed off to a popup window.
789 // Clears _inPanelAnalyzePage so destroyInPanelAnalyzePage() does not destroy it
790 // when AnalyzeView is torn down.
791 function analyzePageMovedToPopup() {
792 _inPanelAnalyzePage = null
795 function createWindowedAnalyzePage(title, source, requiresVehicle, existingItem) {
796 var windowedPage = windowedAnalyzePage.createObject(mainWindow)
797 windowedPage.title = title
798 windowedPage.requiresVehicle = requiresVehicle
800 windowedPage.adoptItem(existingItem)
802 windowedPage.source = source
804 windowedPage.visible = true
808 id: windowedAnalyzePage
811 width: ScreenTools.defaultFontPixelWidth * 100
812 height: ScreenTools.defaultFontPixelHeight * 40
815 property alias source: loader.source
816 property bool requiresVehicle: false
818 function adoptItem(item) {
819 loader.visible = false
821 item.parent = contentRect
822 item.anchors.fill = contentRect
828 target: QGroundControl.multiVehicleManager
829 function onActiveVehicleChanged() {
830 if (requiresVehicle) {
838 color: QGroundControl.globalPalette.window
844 onLoaded: item.popped = true
850 // Destroy any reparented children (not owned by loader)
851 for (var i = contentRect.children.length - 1; i >= 0; i--) {
852 var child = contentRect.children[i]
853 if (child !== loader) {
858 Qt.callLater(destroy)