Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
4.6.3, 5.5.1
-
None
Description
The implementation of setMinimum() and setMaximum() for QDoubleSpinBox is unsafe and may lead to undesirable results. I.e. in a QDoubleSpinBox with decimals set to 1 a range of setMinimum(0.44) and setMaximum(1.55) will lead to a range of 0.4 - 1.6 because the values are rounded. That means the actual limits of the spin box are outside of the specified range and the user can select values that are outside of the desired range.
IMHO setMinimum() should do a kind of ceil() and setMaximum() should do a kind of floor(). This would lead to a safe range of 0.5 - 1.5 and this range is inside of the desired range from 0.44 - 1.55.