From 357cdaccab5dba6ac7a74b7854708b7eeb130b7b Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Thu, 25 Mar 2021 09:50:53 -0700 Subject: [PATCH] Fix terrain follow preset handling --- src/MissionManager/TransectStyleComplexItem.cc | 5 ++++- src/PlanView/TransectStyleComplexItemTerrainFollow.qml | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/MissionManager/TransectStyleComplexItem.cc b/src/MissionManager/TransectStyleComplexItem.cc index 5a303552419..cceb492f476 100644 --- a/src/MissionManager/TransectStyleComplexItem.cc +++ b/src/MissionManager/TransectStyleComplexItem.cc @@ -309,7 +309,10 @@ bool TransectStyleComplexItem::_load(const QJsonObject& complexObject, bool forP } } - if (!forPresets) { + if (forPresets) { + // Most signalling will happen after the transects are rebuilt so we don't over signal here + emit followTerrainChanged(_followTerrain); + } else { emit minAMSLAltitudeChanged(); emit maxAMSLAltitudeChanged(); _amslEntryAltChanged(); diff --git a/src/PlanView/TransectStyleComplexItemTerrainFollow.qml b/src/PlanView/TransectStyleComplexItemTerrainFollow.qml index 36feddaa83e..9a228b8fd73 100644 --- a/src/PlanView/TransectStyleComplexItemTerrainFollow.qml +++ b/src/PlanView/TransectStyleComplexItemTerrainFollow.qml @@ -21,6 +21,10 @@ ColumnLayout { text: qsTr("Vehicle follows terrain") checked: missionItem.followTerrain onClicked: missionItem.followTerrain = checked + + Binding on checkedState { + value: missionItem.followTerrain ? Qt.Checked : Qt.Unchecked + } } GridLayout {