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

Fix TypeError in RangeSlider for python >=3.10 (Fix #1906) #2048

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions traitsui/qt/extra/range_slider.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def paintEvent(self, event):
else:
opt.activeSubControls = self.hover_control

opt.sliderPosition = value
opt.sliderValue = value
opt.sliderPosition = int(value)
opt.sliderValue = int(value)
style.drawComplexControl(
QtGui.QStyle.ComplexControl.CC_Slider, opt, painter, self
)
Expand All @@ -103,7 +103,7 @@ def mousePressEvent(self, event):
self.active_slider = -1

for i, value in enumerate([self._low, self._high]):
opt.sliderPosition = value
opt.sliderPosition = int(value)
hit = style.hitTestComplexControl(
style.CC_Slider, opt, event.pos(), self
)
Expand Down Expand Up @@ -132,7 +132,7 @@ def mouseMoveEvent(self, event):
return

event.accept()
new_pos = self.__pixelPosToRangeValue(self.__pick(event.pos()))
new_pos = int(self.__pixelPosToRangeValue(self.__pick(event.pos())))
opt = QtGui.QStyleOptionSlider()
self.initStyleOption(opt)

Expand Down
Loading