Skip to content

QLabeledDoubleRangeSlider

A QDoubleRangeSlider with labels for its handles and range. It works like a QLabeledRangeSlider; setDecimals sets the number of decimals shown.

QLabeledDoubleRangeSlider QLabeledDoubleRangeSlider
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()

QLabeledDoubleRangeSlider

QLabeledDoubleRangeSlider(parent: QWidget | None = ...)
QLabeledDoubleRangeSlider(
    orientation: Orientation, parent: QWidget | None = ...
)

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.EdgeLabelMode
LabelIsRange, LabelIsValue
QLabeledDoubleRangeSlider.LabelPosition
NoLabel, LabelsAbove, LabelsBelow, LabelsOnHandle

Properties

barColor

barColor = Property(
    QtGui.QBrush, _getBarColor, _setBarColor
)

The color of the bar between the first and last handle.

Methods

decimals

decimals() -> int

edgeLabelMode

edgeLabelMode() -> EdgeLabelMode

Return current EdgeLabelMode.

expandRangeOnHandleEdit

expandRangeOnHandleEdit() -> bool

Return whether out-of-range handle edits expand the slider range.

handleLabelPosition

handleLabelPosition() -> LabelPosition

Return where/whether labels are shown adjacent to slider handles.

setDecimals

setDecimals(prec: int) -> None

setEdgeLabelMode

setEdgeLabelMode(opt: EdgeLabelMode) -> None

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

setHandleLabelPosition(opt: LabelPosition) -> None

Set where/whether labels are shown adjacent to slider handles.

setInvertedAppearance

setInvertedAppearance(a0: bool) -> None

setOrientation

setOrientation(orientation: Orientation) -> None

Set orientation, value will be 'horizontal' or 'vertical'.

setRange

setRange(min: int, max: int) -> None

setTickInterval

setTickInterval(interval: int) -> None

setTickPosition

setTickPosition(pos: TickPosition) -> None

tickInterval

tickInterval() -> int

tickPosition

tickPosition() -> TickPosition