-3

In different areas of program i need to set different increment somewhere by +1 and somewehere by +2 or more. How to do this?

HMD
  • 2,202
  • 6
  • 24
  • 37
ratojakuf
  • 708
  • 1
  • 11
  • 21

2 Answers2

10

Use setSingleStep() method:

This property holds the step value.

When the user uses the arrows to change the spin box's value the value will be incremented/decremented by the amount of the singleStep. The default value is 1. Setting a singleStep value of less than 0 does nothing.

spinBox->setSingleStep(2);

http://qt-project.org/doc/qt-4.8/qspinbox.html#singleStep-prop

Jablonski
  • 18,083
  • 2
  • 46
  • 47
2

Another method:

If you create the spinBox using design mode, then click the spinBox of your choice and change the value of property called singleStep. By default it is 1, but you can change it to 2 or any other number (step size will be changed to that number).

ANMOSI
  • 141
  • 4