October 5, 2011

Ruzik Ruzik
Lab Rat
293 posts

[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!

8 replies

October 5, 2011

mlong mlong
Robot Herder
1551 posts

If you mean you want to increment or decrement by 2, try looking at QSpinBox::setSingleStep() [doc.qt.nokia.com]

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

October 5, 2011

Ruzik Ruzik
Lab Rat
293 posts

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?

October 5, 2011

mlong mlong
Robot Herder
1551 posts

Ah. You need a QDoubleSpinBox. [doc.qt.nokia.com] it also has a setSingleStep() method, which you can set to 0.01.

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

October 5, 2011

Eddy Eddy
Gene Splicer
1523 posts

Did you try this :

  1. void setSingleStep ( double val )

The docs say: By default val == 1.0 and val must be greater than 0.

 Signature 

Qt Certified Specialist
Nokia Qt Ambassador

October 5, 2011

Vass Vass
Ant Farmer
740 posts

you need use QDoubleSpinBox and method setSingleStep(double val) for set your step 0.01

 Signature 


Vasiliy

October 5, 2011

Ruzik Ruzik
Lab Rat
293 posts

thank you for your help!

October 5, 2011

Eddy Eddy
Gene Splicer
1523 posts

3 answers to your question! You must feel happy?!

Could you change your title and add [solved] to it? Thanks.

 Signature 

Qt Certified Specialist
Nokia Qt Ambassador

October 5, 2011

mlong mlong
Robot Herder
1551 posts

Glad to help!

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

 
  ‹‹ How QGraphicsTextItem can be not sized during scaling of QGraphicView      setWidgetResizable(true) ››

You must log in to post a reply. Not a member yet? Register here!