diff --git a/src/superqt/sliders/_labeled.py b/src/superqt/sliders/_labeled.py index a2d45f07..f7a10e7a 100644 --- a/src/superqt/sliders/_labeled.py +++ b/src/superqt/sliders/_labeled.py @@ -150,6 +150,9 @@ def __init__(self, *args, **kwargs) -> None: def _setValue(self, value: float): """Convert the value from float to int before setting the slider value.""" + value = int(value) + if self._slider.maximum() < value: + self._slider.setMaximum(value) self._slider.setValue(int(value)) def _rename_signals(self):