[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:
Benjamin Bræstrup Sayoc
2024-09-13 08:43:07 -05:00
committed by Chris Hennes
parent 4e5e193c76
commit d00aae972c
+3 -1
View File
@@ -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;
}
}