QLabeledSlider¶
A slider with a label next to it that shows the slider's value. The value can be typed into the label.
QLabeledSlider is a QAbstractSlider
that wraps a QSlider and a label; slider methods such as setRange and
setValue work as they do on a QSlider. To move the label to the other side,
or hide it, use setEdgeLabelPosition (with LabelPosition.LabelsLeft or
LabelPosition.NoLabel).
from qtpy.QtCore import Qt
from qtpy.QtWidgets import QApplication
from superqt import QLabeledSlider
app = QApplication([])
slider = QLabeledSlider(Qt.Orientation.Horizontal)
slider.setValue(42)
slider.show()
app.exec()
Subclass of QAbstractSlider
QLabeledSlider inherits all of QAbstractSlider's methods, signals, and properties. Only those that superqt adds or changes are listed here.
Signals¶
editingFinished()
Enums¶
QLabeledSlider.EdgeLabelModeLabelIsRange,LabelIsValueQLabeledSlider.LabelPositionNoLabel,LabelsAbove,LabelsBelow,LabelsOnHandle
Methods¶
edgeLabelPosition
¶
Return where/whether a label is shown at the edge of the slider.
setEdgeLabelMode
¶
Set the EdgeLabelMode.
Parameters:
-
opt(EdgeLabelMode) –To show no label, use
EdgeLabelMode.NoLabel. To show the value of the slider, useEdgeLabelMode.LabelIsValue. To showvalue / maximum, useEdgeLabelMode.LabelIsValue | EdgeLabelMode.LabelIsRange.
setEdgeLabelPosition
¶
Set where/whether a label is shown at the edge of the slider.
setOrientation
¶
Set orientation, value will be 'horizontal' or 'vertical'.