From 91ba89eeceeb0616725f6ee087e4164813edbd34 Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Sat, 14 Jan 2012 22:58:51 +0200 Subject: [PATCH] ConfigTaskWidget: add QDoubleSpinBox to addUAVObjectToWidgetRelation() --- .../src/plugins/config/configtaskwidget.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ground/openpilotgcs/src/plugins/config/configtaskwidget.cpp b/ground/openpilotgcs/src/plugins/config/configtaskwidget.cpp index c7a082507..05955f7d1 100644 --- a/ground/openpilotgcs/src/plugins/config/configtaskwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configtaskwidget.cpp @@ -193,6 +193,10 @@ void ConfigTaskWidget::populateWidgets() { cb->setValue(ow->field->getValue(ow->index).toInt()/ow->scale); } + else if (QDoubleSpinBox * cb = qobject_cast(ow->widget)) + { + cb->setValue(ow->field->getValue(ow->index).toDouble()/ow->scale); + } else if(QSlider * cb=qobject_cast(ow->widget)) { cb->setValue(ow->field->getValue(ow->index).toInt()/ow->scale); @@ -226,6 +230,10 @@ void ConfigTaskWidget::refreshWidgetsValues() { cb->setValue(ow->field->getValue(ow->index).toInt()/ow->scale); } + else if (QDoubleSpinBox * cb = qobject_cast(ow->widget)) + { + cb->setValue(ow->field->getValue(ow->index).toDouble()/ow->scale); + } else if(QSlider * cb=qobject_cast(ow->widget)) { cb->setValue(ow->field->getValue(ow->index).toInt()/ow->scale); @@ -258,6 +266,10 @@ void ConfigTaskWidget::updateObjectsFromWidgets() { ow->field->setValue(cb->value()* ow->scale,ow->index); } + else if (QDoubleSpinBox * cb = qobject_cast(ow->widget)) + { + ow->field->setValue(cb->value()* ow->scale,ow->index); + } else if(QSlider * cb=qobject_cast(ow->widget)) { ow->field->setValue(cb->value()* ow->scale,ow->index);