PyQt5 QSpinBox – Setting step type
In this article we will see how we can set the step type to the spin box, there are two types of step types i.e default one which increment value normally and other is adaptive decimal. Adaptive decimal step means that the step size will continuously be adjusted to one power of ten below the current value i.e if value is 900 it get next increment will be of 10 for value equals to 1000 increment will be of 100. By default it is set to default step type although we can change. In order to do this we will use setStepType method Note : This feature was introduced in Qt 5.12. so lower versions don’t have this feature.
Syntax : spin_box.setStepType(QAbstractSpinBox.AdaptiveDecimalStepType) or spin_box.setStepType(1) Argument : It takes QAbstractionSpinBox object or we can pass 1 i.e its value as argument Return : It returns None
Below is the implementation
Please Login to comment...