[Measure] Redirect enter key press to apply button
Fixes #16401. Now call of the save function is dependent on whether the apply button is enabled. The button is only enabled if valid objects to save.
This commit is contained in:
@@ -479,7 +479,9 @@ bool TaskMeasure::eventFilter(QObject* obj, QEvent* event)
|
||||
}
|
||||
|
||||
if (keyEvent->key() == Qt::Key_Return || keyEvent->key() == Qt::Key_Enter) {
|
||||
this->apply();
|
||||
// Save object. Indirectly dependent on whether the apply button is enabled
|
||||
// enabled if valid measurement object.
|
||||
this->buttonBox->button(QDialogButtonBox::Apply)->click();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user