Just a quick note: there's no need to modify the title anymore to mark the thread as solved. You can use the "Topic Tool" button for that. That makes things cleaner :)
Thanks for your answer, but this also would not work for other line edits.
In QT creator I cannot find the input mask setting for the QSpinBox, this would be helpful in a shared project, so everyone directly would see the input Mask like in the QlinEdit.
But anyway you solution would be a workaorund but does not explain why this issue .
The only explanation like you already mentioned is because of useage of backspace deletion.