From fba0ef06710640af27dacd201cdc105b864e245c Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 30 Dec 2014 14:18:02 +0100 Subject: [PATCH] + fixes #0001657: Sketcher: First digit can not be deleted when editing grid size --- src/Gui/QuantitySpinBox.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Gui/QuantitySpinBox.cpp b/src/Gui/QuantitySpinBox.cpp index c61694f225..51a0e8fa73 100644 --- a/src/Gui/QuantitySpinBox.cpp +++ b/src/Gui/QuantitySpinBox.cpp @@ -51,6 +51,11 @@ public: Base::Quantity validateAndInterpret(QString& input, int& pos, QValidator::State& state) const { Base::Quantity res; + if (input.isEmpty()) { + state = QValidator::Intermediate; + return res; + } + try { res = Base::Quantity::parse(input); @@ -143,6 +148,13 @@ bool QuantitySpinBox::hasValidInput() const void QuantitySpinBox::userInput(const QString & text) { Q_D(QuantitySpinBox); + + if (text.isEmpty()) { + d->errorText.clear(); + d->validInput = true; + return; + } + Base::Quantity res; try { QString input = text;