superqt icon indicating copy to clipboard operation
superqt copied to clipboard

`examples/labeled_sliders.py` broken

Open gselzer opened this issue 4 months ago • 3 comments

Describe the bug When running examples//labeled_sliders.py, you get the following printout:

> uv run python .\examples\labeled_sliders.py
qls valueChanged 300
qlds valueChanged 0.5
Traceback (most recent call last):
  File "C:\Users\gjselzer\code\pyapp-kit\superqt\examples\labeled_sliders.py", line 31, in <module>
    qlrs.setRange(0, 10**11)
    ~~~~~~~~~~~~~^^^^^^^^^^^
  File "C:\Users\gjselzer\code\pyapp-kit\superqt\src\superqt\sliders\_labeled.py", line 448, in setRange
    self._on_range_changed(min, max)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "C:\Users\gjselzer\code\pyapp-kit\superqt\src\superqt\sliders\_labeled.py", line 608, in _on_range_changed
    self._slider.setRange(min, max)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "C:\Users\gjselzer\code\pyapp-kit\superqt\src\superqt\sliders\_generic_slider.py", line 171, in setRange
    self.rangeChanged.emit(self._minimum, self._maximum)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: rangeChanged(self, min: int, max: int).emit(): argument 2 has unexpected type 'int'

This comes from trying to emit the QSlider.rangeChanged signal of the backing QSlider. I did spend a while attempting a fix however looking at the code as well as relevant issues/PRs (especially #249 and #283), I have a feeling that I'm falling down a rabbit hole. Thoughts @tlambert03?

To Reproduce Steps to reproduce the behavior:

  1. Run python examples/labeled_slider.py

Expected behavior The example to run bug-free

Screenshots Screenshots and GIFS are much appreciated when reporting visual bugs.

Desktop (please complete the following information):

  • OS with version [e.g macOS 10.15.7] Windows 11
  • Qt Backend [e.g PyQt5, PySide2] PyQt6
  • Python version 3.13.1

gselzer avatar Oct 09 '25 21:10 gselzer

wasn't immediately able to reproduce this (on macos with a variety of pyqt6 versions) can you tell me what version of pyqt6 you ended up with? (and is it within the constraints of our pyqt6 extra?)

tlambert03 avatar Oct 13 '25 14:10 tlambert03

can you tell me what version of pyqt6 you ended up with? (and is it within the constraints of our pyqt6 extra?)

Looks like pyqt6 6.9.1.

Full uv environment
> uv pip list
Package                 Version         Editable project location
----------------------- --------------- ----------------------------------------
asttokens               3.0.0
certifi                 2025.10.5
cfgv                    3.4.0
charset-normalizer      3.4.3
cmap                    0.6.2
colorama                0.4.6
coverage                7.10.7
decorator               5.2.1
distlib                 0.4.0
executing               2.2.1
filelock                3.20.0
flexcache               0.3
flexparser              0.4
identify                2.6.15
idna                    3.10
iniconfig               2.1.0
ipython                 9.6.0
ipython-pygments-lexers 1.1.1
jedi                    0.19.2
markdown-it-py          4.0.0
matplotlib-inline       0.1.7
mdurl                   0.1.2
mypy                    1.18.2
mypy-extensions         1.1.0
nodeenv                 1.9.1
numpy                   2.3.3
packaging               25.0
parso                   0.8.5
pathspec                0.12.1
pint                    0.25
platformdirs            4.5.0
pluggy                  1.6.0
pre-commit              4.3.0
pre-commit-uv           4.1.5
prompt-toolkit          3.0.52
pure-eval               0.2.3
pyconify                0.2.1
pydocstyle              6.3.0
pygments                2.19.2
pyqt6                   6.9.1
pyqt6-qt6               6.9.2
pyqt6-sip               13.10.2
pytest                  8.4.2
pytest-cov              7.0.0
pytest-qt               4.4.0
pyyaml                  6.0.3
qtpy                    2.4.3
requests                2.32.5
rich                    14.1.0
ruff                    0.14.0
snowballstemmer         3.0.1
stack-data              0.6.3
superqt                 0.7.6           C:\Users\gjselzer\code\pyapp-kit\superqt
traitlets               5.14.3
types-docutils          0.22.2.20251006
types-pygments          2.19.0.20250809
typing-extensions       4.15.0
urllib3                 2.5.0
uv                      0.9.0
virtualenv              20.34.0
wcwidth                 0.2.14

gselzer avatar Oct 13 '25 14:10 gselzer

k, will have to check on a windows sometime soon

tlambert03 avatar Oct 13 '25 14:10 tlambert03