1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

ConfigTaskWidget: add QDoubleSpinBox to addUAVObjectToWidgetRelation()

This commit is contained in:
Oleg Semyonov 2012-01-14 22:58:51 +02:00
parent 6444d6b3f6
commit 4fcd0f97c5

View File

@ -193,6 +193,10 @@ void ConfigTaskWidget::populateWidgets()
{
cb->setValue(ow->field->getValue(ow->index).toInt()/ow->scale);
}
else if (QDoubleSpinBox * cb = qobject_cast<QDoubleSpinBox *>(ow->widget))
{
cb->setValue(ow->field->getValue(ow->index).toDouble()/ow->scale);
}
else if(QSlider * cb=qobject_cast<QSlider *>(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<QDoubleSpinBox *>(ow->widget))
{
cb->setValue(ow->field->getValue(ow->index).toDouble()/ow->scale);
}
else if(QSlider * cb=qobject_cast<QSlider *>(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<QDoubleSpinBox *>(ow->widget))
{
ow->field->setValue(cb->value()* ow->scale,ow->index);
}
else if(QSlider * cb=qobject_cast<QSlider *>(ow->widget))
{
ow->field->setValue(cb->value()* ow->scale,ow->index);