From 88e4692db8a8d4b829508f90744768689195f8b5 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 17 Nov 2016 09:33:01 -0800 Subject: [PATCH] Fix visible usage Change in visibility was causing combo box contents to reset. Visible goes to false even when you move away from Plan view, not just when the combo is unused. --- src/FirmwarePlugin/APM/CopterGeoFenceEditor.qml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/FirmwarePlugin/APM/CopterGeoFenceEditor.qml b/src/FirmwarePlugin/APM/CopterGeoFenceEditor.qml index f0da718fa..480d3213d 100644 --- a/src/FirmwarePlugin/APM/CopterGeoFenceEditor.qml +++ b/src/FirmwarePlugin/APM/CopterGeoFenceEditor.qml @@ -43,6 +43,8 @@ Column { width: editorColumn.width height: textField.height + property bool showCombo: modelData.enumStrings.length > 0 + QGCLabel { id: textFieldLabel anchors.baseline: textField.baseline @@ -55,7 +57,7 @@ Column { width: _editFieldWidth showUnits: true fact: modelData - visible: !comboField.visible + visible: !parent.showCombo } FactComboBox { @@ -63,8 +65,8 @@ Column { anchors.right: parent.right width: _editFieldWidth indexModel: false - fact: visible ? modelData : _nullFact - visible: modelData.enumStrings.length + fact: showCombo ? modelData : _nullFact + visible: parent.showCombo property var _nullFact: Fact { } } -- 2.22.0