Commit 4f0aaa7c authored by John Tourtellott's avatar John Tourtellott

Fix qtDoubleLineEdit to display empty string instead of converting to 0

parent b446e613
......@@ -115,11 +115,19 @@ public:
const auto real_notation =
this->UseGlobalPrecisionAndNotation ? qtDoubleLineEdit::globalNotation() : this->Notation;
QString limited = qtDoubleLineEdit::formatDouble(
self->text().toDouble(), toTextStreamNotation(real_notation), real_precision);
bool changed = false;
if (self->text().isEmpty())
{
this->InactiveLineEdit->setText("");
}
else
{
QString limited = qtDoubleLineEdit::formatDouble(
self->text().toDouble(), toTextStreamNotation(real_notation), real_precision);
const bool changed = (limited != this->InactiveLineEdit->text());
this->InactiveLineEdit->setText(limited);
changed = (limited != this->InactiveLineEdit->text());
this->InactiveLineEdit->setText(limited);
}
auto pal = self->palette();
this->InactiveLineEdit->setPalette(pal);
if (changed & !this->useFullPrecision(self))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment