I am using a QSpinBox that can be used to input values from 0 to 33. The default value is zero. If I use the keyboard to enter numbers it keeps the leading zero, which is annoying.
Example: I want to enter 23 via the keyboard
I type “2” – the value of the spinbox changes to “02”
I type “3” – nothing happens – the spinbox is full
How do I prevent this behavior?
thanks,
A
Add a line of code in the
valueChangedlistener to remove a leading zero.