Using QT Designer, I built a user interface with a few QDoubleSpinBoxes. I want to change the spin boxes so that only the left most digit is incremented. For example, if the user presses the up button, 1000 goes to 2000. But if the down button is pressed, 1000 should go to 900. I created a custom Spin Box Class that overwrote the stepBy function.
I'm not sure how to replace the QDoubleSpinBoxes with the Custom Spin Box while keeping all the formatting I already placed on the QDoubleSpinBoxes in QT Designer. I know that you can promote the QDoubleSpinBoxes but I'm not sure how to connect that with my python code.
I tried changing the singleStepSize whenever the value was changed but that lead to 1000 going to 0. But I want 1000 to 900.
Option 1: Promote the QDoubleSpinBox in the designer to your custom class. Set the QDoubleSpinBox as base class. Check the box for "Global include" and empty the "Header file" entry. Make sure you include your custom spinbox before the ui. Keep in mind, this way you can not use your custom functionality in the preview from the designer.
Option 2: Write a plugin https://doc.qt.io/qt-6/designer-creating-custom-widgets.html