mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-30 15:52:12 +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;
|
||||
} else if (QLabel * cb = qobject_cast<QLabel *>(widget)) {
|
||||
if (scale == 0) {
|
||||
cb->setText(value.toString());
|
||||
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());
|
||||
}
|
||||
} else {
|
||||
cb->setText(QString::number(value.toDouble() / scale));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user