Sketcher: Allow user to reset OVP state using backspace key

Currently if user tries to reset OVP, they can only do that by entering
"0" for example, and then the parameters will get unset in
unsetOnViewParameter. But that will only happen if user types a value
that's under confusion point (typically 1e^-7). In my opinion, it would
be cool to reset that state if user deletes all content in the label, to
allow them to specify coordinates with mouse once again.

Also, this patch fixes a regression with backspace, where deleting stuff
from OVP was working on unix systems, but seems like on Windows it
doesn't pass the check.
This commit is contained in:
tetektoza
2025-06-07 21:00:27 +02:00
committed by Kacper Donat
parent aace4b1e7c
commit 2933eaf819
5 changed files with 29 additions and 3 deletions

View File

@@ -186,9 +186,16 @@ void EditableDatumLabel::startEdit(double val, QObject* eventFilteringObj, bool
return;
}
isSet = true;
if (!spinBox->hasValidInput()) {
// unset parameters in DrawSketchController, this is needed in a case
// when user removes values we reset state of the OVP
Q_EMIT this->parameterUnset();
return;
}
value = spinBox->rawValue();
isSet = true;
Q_EMIT this->valueChanged(value);
};