If you need to invoke default processing of the event, you need to call base class implementation:
void MytSpinBox::keyPressEvent(QKeyEvent *event) {
if (event->key() == Qt::Key_Return) {
qDebug() << "return pressed";
editingFinished();
} else {
QSpinBox::keyPressEvent(event);
}
}