Fix large integer ranges on QRangeSlider / QLabeledRangeSlider - #351
Open
Phoenix0531-sudo wants to merge 3 commits into
Open
Fix large integer ranges on QRangeSlider / QLabeledRangeSlider#351Phoenix0531-sudo wants to merge 3 commits into
Phoenix0531-sudo wants to merge 3 commits into
Conversation
QRangeSlider left rangeChanged bound to QSlider's native Signal(int, int), so setRange(0, 10**11) failed on PyQt6 when emitting rangeChanged. The double variants already rebind rangeChanged to frangeChanged; do the same for the integer range slider and labeled wrapper so examples/labeled_sliders.py works on Windows. Fixes pyapp-kit#308
After rebinding rangeChanged to frangeChanged, older PySide6 builds on Windows still raise OverflowError when the payload is a Python int larger than C long. Emit float(min)/float(max) so large ranges such as 10**11 work with both PyQt6 and PySide6. Refs pyapp-kit#308
QLabeledSlider still uses QAbstractSlider's native rangeChanged(int, int). Only _GenericSlider.setRange needs float() for frangeChanged / pyapp-kit#308.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/labeled_sliders.pycrashes on Windows with PyQt6 when it callsQLabeledRangeSlider.setRange(0, 10**11). The traceback is aTypeErrorfromrangeChanged(...).emit(): the integer range slider still used Qt's nativerangeChanged(int, int), which cannot carry values outside the signed 32-bit range. The double variants already rebindrangeChangedtofrangeChanged(Signal(float, float)); this PR applies the same pattern toQRangeSliderandQLabeledRangeSlider.This stays a small signal rebind, not the broader slider inheritance refactor discussed in #249 / #283.
Testing
QRangeSlider/QLabeledRangeSliderwith10**11rangespytest tests/zz_test_sliders: 283 passed, 50 skipped, 1 xfailedRelated
Fixes #308