mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-18 08:54:15 +01:00
Fixed some formatting issues.
This commit is contained in:
parent
081c016dfa
commit
8f51610776
@ -1132,19 +1132,21 @@ bool ConfigTaskWidget::setWidgetFromVariant(QWidget *widget, QVariant value, dou
|
|||||||
}
|
}
|
||||||
else if(QLineEdit * cb=qobject_cast<QLineEdit *>(widget))
|
else if(QLineEdit * cb=qobject_cast<QLineEdit *>(widget))
|
||||||
{
|
{
|
||||||
if((scale== 0) || (scale == 1)) {
|
if ((scale== 0) || (scale == 1)) {
|
||||||
if(units == "hex") {
|
if(units == "hex") {
|
||||||
cb->setText(QString::number(value.toUInt(), 16).toUpper());
|
cb->setText(QString::number(value.toUInt(), 16).toUpper());
|
||||||
} else {
|
} else {
|
||||||
cb->setText(value.toString());
|
cb->setText(value.toString());
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
cb->setText(QString::number((value.toDouble()/scale)));
|
cb->setText(QString::number((value.toDouble()/scale)));
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a widget from a variant
|
* Sets a widget from a variant
|
||||||
* @param widget pointer for the widget to set
|
* @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(""));
|
return setWidgetFromVariant(widget, value, scale, QString(""));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a widget from a UAVObject field
|
* Sets a widget from a UAVObject field
|
||||||
* @param widget pointer to the widget to set
|
* @param widget pointer to the widget to set
|
||||||
|
@ -71,9 +71,8 @@ public:
|
|||||||
QString getUnits() const {
|
QString getUnits() const {
|
||||||
if (field) {
|
if (field) {
|
||||||
return field->getUnits();
|
return field->getUnits();
|
||||||
} else {
|
|
||||||
return QString("");
|
|
||||||
}
|
}
|
||||||
|
return QString("");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user