diff --git a/traitsui/qt/extra/range_slider.py b/traitsui/qt/extra/range_slider.py index 9eed87fd9..6f5224ecf 100644 --- a/traitsui/qt/extra/range_slider.py +++ b/traitsui/qt/extra/range_slider.py @@ -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 ) @@ -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 ) @@ -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)