Sketcher: Make TAB clear the field if user hasn't valid input

This commit is contained in:
tetektoza
2025-06-23 19:24:30 +02:00
committed by Benjamin Nauck
parent 7515c70b67
commit 75017b2dd2

View File

@@ -221,6 +221,10 @@ bool EditableDatumLabel::eventFilter(QObject* watched, QEvent* event)
// if tab has been pressed and user did not type anything previously,
// then just cycle but don't lock anything, otherwise we lock the label
if (keyEvent->key() == Qt::Key_Tab && !this->isSet) {
if (!this->spinBox->hasValidInput()) {
Q_EMIT this->spinBox->valueChanged(this->value);
return true;
}
return false;
}