mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-12 02:54:15 +01:00
LP-245 config: properly display hex in QLabel too
This commit is contained in:
parent
7fd393bb79
commit
bbd166045e
@ -965,8 +965,17 @@ bool ConfigTaskWidget::setWidgetFromVariant(QWidget *widget, QVariant value, Wid
|
|||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
} else if (QLabel * cb = qobject_cast<QLabel *>(widget)) {
|
} else if (QLabel * cb = qobject_cast<QLabel *>(widget)) {
|
||||||
if (scale == 0) {
|
if ((scale == 0) || (scale == 1)) {
|
||||||
|
if (binding->units() == "hex") {
|
||||||
|
if (value.toUInt()) {
|
||||||
|
cb->setText(QString::number(value.toUInt(), 16).toUpper());
|
||||||
|
} else {
|
||||||
|
// display 0 as an empty string
|
||||||
|
cb->setText("");
|
||||||
|
}
|
||||||
|
} 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));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user