Commit cdb568e0 authored by John Tourtellott's avatar John Tourtellott Committed by Kitware Robot

Merge topic 'qtDoubleLineEdit-unset'

4f0aaa7c Fix qtDoubleLineEdit to display empty string instead of converting to 0
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Bob Obara's avatarBob Obara <bob.obara@kitware.com>
Merge-request: !1576
parents f509af03 4f0aaa7c
......@@ -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