C++ – For QDoubleSpinBox, can I give an range 0.0

c++qtuser-interface

I am using a QDoubleSpinBox,

And during sometime, I have a range where min and max is less than 1 and greater than 0.
If I set that range, when I hit the step down the value in the spin box changes to 0.0 and step up would result in 1.0 eventhough they are out of range.
I would like to know if there is a particular way to avoid this problem.

Best Solution

Use setSingleStep() to set the step size to something reasonable for your range. (http://doc.trolltech.com/4.5/qdoublespinbox.html#singleStep-prop)