PDA

View Full Version : QSpinBox: Pressing 'Backspace' wont set it to 'Zero'



deepakn
7th October 2008, 12:37
I have a dialog with several QSpinBox elements in it.

You enter a value, then select it later and press backspace[or 'delete'], it wont be set to '0'. The old value will remain there.

Is it the default behavior of QSpinBox? How can I make it revert to zero on 'backspace/delete' key press? Someone please guide me.

Thanks in advance

deepakn
8th October 2008, 10:00
Hi all,
Were someone able to figure this out?
I am using Qt 4.2.2 from Windows and Linux
In both platforms, the behaviour is same only.
Dont you think, from the users point of view, its is required that pressing backspace should erase the values?

Someone got any workarounds for this issue? Any kind of help will be highly appreciated.
Thanks

fnmblot
8th October 2008, 14:18
You would probably have to capture the key event and set it to what you want for the spinbox