Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved _frangeChanged for LabeledSliders #111

Closed
wants to merge 2 commits into from

Conversation

david-jenkins
Copy link

This fixes a bug where rangeChanged expected integers.
The _GenericSlider class uses floats for the range and so QLabeledRangeSlider needs to have the _frangeChanged signal
This moves it from QLabeledDoubleRangeSlider

QLabeledRangeSlider needs _frangeChange,
it's been moved from QLabeledDoubleRangeSlider.
_GenericSlider uses floats for the range
@codecov
Copy link

codecov bot commented Aug 24, 2022

Codecov Report

Merging #111 (461be39) into main (04efa95) will decrease coverage by 1.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #111      +/-   ##
==========================================
- Coverage   84.94%   83.92%   -1.02%     
==========================================
  Files          30       30              
  Lines        2391     2389       -2     
==========================================
- Hits         2031     2005      -26     
- Misses        360      384      +24     
Impacted Files Coverage Δ
src/superqt/sliders/_labeled.py 79.79% <100.00%> (-0.11%) ⬇️
src/superqt/sliders/_range_style.py 67.66% <0.00%> (-4.52%) ⬇️
src/superqt/sliders/_generic_range_slider.py 86.01% <0.00%> (-3.11%) ⬇️
src/superqt/sliders/_generic_slider.py 86.64% <0.00%> (-2.49%) ⬇️
src/superqt/fonticon/_plugins.py 67.27% <0.00%> (-1.82%) ⬇️
src/superqt/fonticon/_qfont_icon.py 92.39% <0.00%> (-1.09%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@tlambert03
Copy link
Member

thanks for the fix @david-jenkins! Could you by chance add a test that would prevent a regression on this? (and also help us make sure it works across all the backends being tested here)

Copy link
Member

@tlambert03 tlambert03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, this now makes it that QLabeledRangeSlider (the non double version) emits a float... which is not what we want:

In [1]: from superqt import QLabeledRangeSlider

In [3]: s = QLabeledRangeSlider()

In [4]: s.rangeChanged.connect(print)
Out[4]: <PyQt5.QtCore.QMetaObject.Connection object at 0x10d917ca0>

In [6]: s.setRange(0,10)
0.0 10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants