QLabeledDoubleRangeSlider¶
A QDoubleRangeSlider with labels for its handles and
range. It works like a QLabeledRangeSlider;
setDecimals sets the number of decimals shown.
from qtpy.QtCore import Qt
from qtpy.QtWidgets import QApplication
from superqt import QLabeledDoubleRangeSlider
app = QApplication([])
slider = QLabeledDoubleRangeSlider(Qt.Orientation.Horizontal)
slider.setRange(0, 1)
slider.setValue((0.2, 0.8))
slider.show()
app.exec()
Subclass of QAbstractSlider
QLabeledDoubleRangeSlider inherits all of QAbstractSlider's methods, signals, and properties. Only those that superqt adds or changes are listed here.
Signals¶
frangeChanged(float, float)valuesChanged(tuple)editingFinished()
Enums¶
QLabeledDoubleRangeSlider.EdgeLabelModeLabelIsRange,LabelIsValueQLabeledDoubleRangeSlider.LabelPositionNoLabel,LabelsAbove,LabelsBelow,LabelsOnHandle
Properties¶
barColor
¶
The color of the bar between the first and last handle.
Methods¶
expandRangeOnHandleEdit
¶
expandRangeOnHandleEdit() -> bool
Return whether out-of-range handle edits expand the slider range.
handleLabelPosition
¶
Return where/whether labels are shown adjacent to slider handles.
setEdgeLabelMode
¶
Set EdgeLabelMode, controls what is shown at the min/max labels.
setExpandRangeOnHandleEdit
¶
setExpandRangeOnHandleEdit(expand: bool) -> None
Set whether out-of-range handle edits expand the slider range.
When enabled, typing a value above a handle that is outside the current slider range will expand the corresponding range edge and then set the handle to the entered value.
setHandleLabelPosition
¶
Set where/whether labels are shown adjacent to slider handles.
setOrientation
¶
Set orientation, value will be 'horizontal' or 'vertical'.