class SpinBox(QtWidgets.QDoubleSpinBox):

    def keyPressEvent(self, event):
        if event.key() == QtCore.Qt.Key_Backspace:
            suffix = self.suffix()
if suffix:
    edit = self.lineEdit()
text = edit.text()
if text.endswith(suffix) and text != self.specialValueText():
    pos = edit.cursorPosition()
end = len(text) - len(suffix)
if pos > end:
    edit.setCursorPosition(end)
return
super().keyPressEvent(event)
Редактирование поведения клавиши «возврат» QDoubleSpinBox