Description
QDoubleSpinBox.setValue accepts int and double values (which makes sense as long as the int can be converted to a double without loss, which should be true up to 2**52-1).
However, QDoubleSpinBox.setValue accepts values only up to 2*31-1:
import warnings from PySide6.QtWidgets import QApplication, QDoubleSpinBox, QSpinBox warnings.filterwarnings("ignore") app = QApplication() int_box = QSpinBox() int_box.setValue(2**31 - 1) # pass try: int_box.setValue(2**31) # fail except OverflowError: print("expected overflow: QSpinBox uses signed int32") double_box = QDoubleSpinBox() double_box.setValue(2**31 - 1) # pass try: double_box.setValue(2**31) # fail except OverflowError: print("unexpected overflow: Q*Double*SpinBox shold *not* be using signed int32") double_box.setValue(2.0**31) # pass
I am happy there is a workaround in converting the value to float before setting it, but IMHO integers should be accepted without conversion.
Attachments
Issue Links
- relates to
-
PYSIDE-2652 QDoubleSpinBox.setValue does not accept integers >= 2**63
- Closed