[Solved]How can i set double step to QSpinBox
-
Hellow!, How can i set double step to QSpinBox?
In advance many thanks for your help! -
If you mean you want to increment or decrement by 2, try looking at "QSpinBox::setSingleStep()":http://doc.qt.nokia.com/4.7-snapshot/qspinbox.html#singleStep-prop
-
I need to increment or decrement by 0.01, i need to this method not for int, for double
Can i do this by conventional ways or i need to make new class? -
Ah. You need a "QDoubleSpinBox.":http://doc.qt.nokia.com/4.7-snapshot/qdoublespinbox.html it also has a setSingleStep() method, which you can set to 0.01.
-
Did you try this :
@void setSingleStep ( double val )@
The docs say: By default val == 1.0 and val must be greater than 0.
-
you need use [[Doc:QDoubleSpinBox]] and method setSingleStep(double val) for set your step 0.01
-
thank you for your help!
-
3 answers to your question! You must feel happy?!
Could you change your title and add [solved] to it? Thanks.
-
Glad to help!
-
Hi you can use "morph into" by right click on spinbox on ui
and use ->setPrecision(3); in code