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

Fixed some formatting issues.

This commit is contained in:
Brian Webb 2013-04-11 14:40:52 +01:00
parent 081c016dfa
commit 8f51610776
2 changed files with 6 additions and 4 deletions

View File

@ -1132,19 +1132,21 @@ bool ConfigTaskWidget::setWidgetFromVariant(QWidget *widget, QVariant value, dou
}
else if(QLineEdit * cb=qobject_cast<QLineEdit *>(widget))
{
if((scale== 0) || (scale == 1)) {
if ((scale== 0) || (scale == 1)) {
if(units == "hex") {
cb->setText(QString::number(value.toUInt(), 16).toUpper());
} else {
cb->setText(value.toString());
}
} else
} else {
cb->setText(QString::number((value.toDouble()/scale)));
}
return true;
}
else
return false;
}
/**
* Sets a widget from a variant
* @param widget pointer for the widget to set
@ -1156,6 +1158,7 @@ bool ConfigTaskWidget::setWidgetFromVariant(QWidget *widget, QVariant value, dou
{
return setWidgetFromVariant(widget, value, scale, QString(""));
}
/**
* Sets a widget from a UAVObject field
* @param widget pointer to the widget to set

View File

@ -71,9 +71,8 @@ public:
QString getUnits() const {
if (field) {
return field->getUnits();
} else {
return QString("");
}
return QString("");
}
};