Is it possible to limit the inputs of a QDoubleSpinBox to defined increments?
-
Hi. I have a QDoubleSpinBox, whose contents I want to be able to change in increments of 0.03.
So, something like this:


I have set the singleStep button increments to 0.03, but it is still possible to edit the value directly. I was wondering whether a function for making the QDoubleSpinBox only accept values of a certain increment exists as I was unable to find it in the QAbstractSpinBox or QDoubleSpinBox documentation.
-
Hi. I have a QDoubleSpinBox, whose contents I want to be able to change in increments of 0.03.
So, something like this:


I have set the singleStep button increments to 0.03, but it is still possible to edit the value directly. I was wondering whether a function for making the QDoubleSpinBox only accept values of a certain increment exists as I was unable to find it in the QAbstractSpinBox or QDoubleSpinBox documentation.
@Dummie1138
No, you can only affect the step increments. You could add some kind of validator to do whatever with a number entered by the user, but it won't stop him typing something.