From 4069ab9ecab884864bd0a0fcd915a5972d9a73c5 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Sun, 25 Oct 2015 14:46:34 -0700 Subject: [PATCH] Fix binding loop --- src/AutoPilotPlugins/PX4/FlightModesComponent.qml | 12 ++++++------ src/QmlControls/ModeSwitchDisplay.qml | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/AutoPilotPlugins/PX4/FlightModesComponent.qml b/src/AutoPilotPlugins/PX4/FlightModesComponent.qml index 5178b1ca6..d34f6ea2d 100644 --- a/src/AutoPilotPlugins/PX4/FlightModesComponent.qml +++ b/src/AutoPilotPlugins/PX4/FlightModesComponent.qml @@ -260,7 +260,7 @@ QGCView { thresholdValue: controller.manualModeThreshold thresholdDragEnabled: false - onModeChannelIndexChanged: controller.manualModeChannelIndex = modeChannelIndex + onModeChannelIndexSelected: controller.manualModeChannelIndex = index } ModeSwitchDisplay { @@ -308,7 +308,7 @@ QGCView { thresholdValue: controller.acroModeThreshold thresholdDragEnabled: true - onModeChannelIndexChanged: controller.acroModeChannelIndex = modeChannelIndex + onModeChannelIndexSelected: controller.acroModeChannelIndex = index onThresholdValueChanged: controller.acroModeThreshold = thresholdValue Behavior on y { PropertyAnimation { easing.type: Easing.InOutQuad; duration: 1000 } } @@ -341,7 +341,7 @@ QGCView { thresholdValue: controller.posCtlModeThreshold thresholdDragEnabled: true - onModeChannelIndexChanged: controller.posCtlModeChannelIndex = modeChannelIndex + onModeChannelIndexSelected: controller.posCtlModeChannelIndex = index onThresholdValueChanged: controller.posCtlModeThreshold = thresholdValue Behavior on y { PropertyAnimation { easing.type: Easing.InOutQuad; duration: 1000 } } @@ -374,7 +374,7 @@ QGCView { thresholdValue: controller.loiterModeThreshold thresholdDragEnabled: true - onModeChannelIndexChanged: controller.loiterModeChannelIndex = modeChannelIndex + onModeChannelIndexSelected: controller.loiterModeChannelIndex = index onThresholdValueChanged: controller.loiterModeThreshold = thresholdValue Behavior on y { PropertyAnimation { easing.type: Easing.InOutQuad; duration: 1000 } } @@ -391,7 +391,7 @@ QGCView { thresholdValue: controller.returnModeThreshold thresholdDragEnabled: true - onModeChannelIndexChanged: controller.returnModeChannelIndex = modeChannelIndex + onModeChannelIndexSelected: controller.returnModeChannelIndex = index onThresholdValueChanged: controller.returnModeThreshold = thresholdValue Behavior on y { PropertyAnimation { easing.type: Easing.InOutQuad; duration: 1000 } } @@ -408,7 +408,7 @@ QGCView { thresholdValue: controller.offboardModeThreshold thresholdDragEnabled: true - onModeChannelIndexChanged: controller.offboardModeChannelIndex = modeChannelIndex + onModeChannelIndexSelected: controller.offboardModeChannelIndex = index onThresholdValueChanged: controller.offboardModeThreshold = thresholdValue Behavior on y { PropertyAnimation { easing.type: Easing.InOutQuad; duration: 1000 } } diff --git a/src/QmlControls/ModeSwitchDisplay.qml b/src/QmlControls/ModeSwitchDisplay.qml index 126fd7b25..376f15d36 100644 --- a/src/QmlControls/ModeSwitchDisplay.qml +++ b/src/QmlControls/ModeSwitchDisplay.qml @@ -45,6 +45,8 @@ Rectangle { height: column.height + (ScreenTools.defaultFontPixelWidth * 2) color: _qgcPal.window + signal modeChannelIndexSelected(int index) + QGCPalette { id: _qgcPal; colorGroupEnabled: enabled } Item { @@ -82,7 +84,7 @@ Rectangle { currentIndex: modeChannelIndex enabled: modeChannelEnabled - onActivated: modeChannelIndex = index + onActivated: modeChannelIndexSelected(index) } QGCLabel { -- 2.22.0