def createRangeSlider(self): widget = RangeSlider(self) widget.setRange(0, 500) widget.setValues(100, 400) widget.sigValueChanged.connect(functools.partial(self.printEvent, "sigValueChanged")) widget.sigPositionChanged.connect(functools.partial(self.printEvent, "sigPositionChanged")) widget.sigPositionCountChanged.connect(functools.partial(self.printEvent, "sigPositionCountChanged")) return widget
def createRangeSliderWithBackground(self): widget = RangeSlider(self) widget.setRange(0, 500) widget.setValues(100, 400) background = numpy.sin(numpy.arange(250) / 250.0) background[0], background[-1] = background[-1], background[0] colormap = Colormap("viridis") widget.setGroovePixmapFromProfile(background, colormap) return widget