[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-12 16:23:17 +02:00
parent b64cd15535
commit b0928cf115

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;
}
}