From ced787d71616ccab2ce2718094e4884fcc2fb041 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Wed, 14 May 2014 23:37:40 +0200 Subject: [PATCH] OP-1331 fixed regression in widget binding framework (handling of scale was broken) --- .../uavobjectwidgetutils/configtaskwidget.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp index 19c9ff8fb..714de84d7 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp @@ -406,24 +406,23 @@ void ConfigTaskWidget::widgetsContentsChanged() { QWidget *emitter = ((QWidget *)sender()); emit widgetContentsChanged(emitter); - double scale = 1.0; QVariant value; foreach(WidgetBinding * binding, m_widgetBindingsPerWidget.values(emitter)) { if (binding && binding->isEnabled()) { if (binding->widget() == emitter) { - checkWidgetsLimits(emitter, binding->field(), binding->index(), binding->isLimited(), - getVariantFromWidget(emitter, binding), binding->scale()); + value = getVariantFromWidget(emitter, binding); + checkWidgetsLimits(emitter, binding->field(), binding->index(), binding->isLimited(), value, binding->scale()); } else { foreach(ShadowWidgetBinding * shadow, binding->shadows()) { if (shadow->widget() == emitter) { - WidgetBinding tmpBinding(shadow->widget(), binding->object(), binding->field(), binding->index(), shadow->scale(), shadow->isLimited()); - QVariant value = getVariantFromWidget(emitter, &tmpBinding); - checkWidgetsLimits(emitter, binding->field(), binding->index(), shadow->isLimited(), value, scale); + WidgetBinding tmpBinding(shadow->widget(), binding->object(), binding->field(), + binding->index(), shadow->scale(), shadow->isLimited()); + value = getVariantFromWidget(emitter, &tmpBinding); + checkWidgetsLimits(emitter, binding->field(), binding->index(), shadow->isLimited(), value, shadow->scale()); } } } - value = getVariantFromWidget(emitter, binding); binding->setValue(value); if (binding->widget() != emitter) {