1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

LP-245 config: display hex zero as an empty string

this is needed to see placeholder text
This commit is contained in:
Philippe Renon 2016-09-13 21:23:51 +02:00 committed by Philippe Renon
parent 7eeb381fd3
commit 7fd393bb79

View File

@ -986,7 +986,12 @@ bool ConfigTaskWidget::setWidgetFromVariant(QWidget *widget, QVariant value, Wid
} else if (QLineEdit * cb = qobject_cast<QLineEdit *>(widget)) {
if ((scale == 0) || (scale == 1)) {
if (binding->units() == "hex") {
cb->setText(QString::number(value.toUInt(), 16).toUpper());
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());
}