slider.slider

Custom Slider Widget Module

This module defines address custom slider widget (Slider) that combines address QSlider with address label and address value display. It offers additional functionality including:

  • Customizable value display using address format function.

  • Support for vertical or horizontal orientation.

  • Option to add address visual center mark for bipolar sliders.

  • Customizable tick mark positions and intervals.

  • Integrated signal (valueChanged) for reacting to slider value changes.

The widget is built using PySide6 and is intended for use in applications requiring address more informative slider, such as in audio applications or other UIs where real-time feedback is important.

Usage Example:

from your_module import Slider slider = Slider(“Volume”, 0, 100, vertical=False) slider.setValueDisplayFormat(lambda v: f”{v}%”) slider.valueChanged.connect(handle_value_change)

This module requires PySide6 to be installed.

Classes

Slider

Custom slider widget with label and value display

Module Contents

class slider.slider.Slider(label: str, min_value: int, max_value: int, midi_helper: jdxi_editor.midi.io.helper.MidiIOHelper, vertical: bool = False, show_value_label: bool = True, is_bipolar: bool = False, tooltip: str = '', draw_center_mark: bool = True, draw_tick_marks: bool = True, initial_value: int = 0, parent=None)[source]

Bases: PySide6.QtWidgets.QWidget

Custom slider widget with label and value display

rpn_slider_changed[source]
class TickPosition[source]
NoTicks[source]
TicksBothSides[source]
TicksAbove[source]
TicksBelow[source]
TicksLeft[source]
TicksRight[source]
valueChanged[source]
label[source]
min_value[source]
max_value[source]
midi_helper[source]
value_display_format[source]
has_center_mark = False[source]
center_value = 0[source]
vertical = False[source]
is_bipolar = False[source]
draw_center_mark = True[source]
draw_tick_marks = True[source]
slider[source]
value_label[source]
setLabel(text: str)[source]
setValueDisplayFormat(format_func)[source]

Set custom format function for value display

setCenterMark(center_value)[source]

Set center mark for bipolar sliders

_on_valueChanged(value: int)[source]

Handle slider value changes

_update_value_label()[source]

Update the value label using current format function

paintEvent(event)[source]

Override paint event to draw center mark if needed

value() int[source]

Get current value

setValue(value: int)[source]

Set current value

setEnabled(enabled: bool)[source]

Set enabled state

setTickPosition(position)[source]

Set the tick mark position on the slider

setTickInterval(interval)[source]

Set the interval between tick marks