Skip to content

range_slider

_range_slider

Dual-handle range slider widget.

Classes:

Name Description
FXRangeSlider

A slider with two handles for selecting a min/max range.

Classes

FXRangeSlider

FXRangeSlider(
    parent: Optional[QWidget] = None,
    minimum: int = 0,
    maximum: int = 100,
    low: Optional[int] = None,
    high: Optional[int] = None,
    show_values: bool = True,
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets._range_slider.FXRangeSlider[FXRangeSlider]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets._range_slider.FXRangeSlider
                


              click fxgui.fxwidgets._range_slider.FXRangeSlider href "" "fxgui.fxwidgets._range_slider.FXRangeSlider"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A slider with two handles for selecting a min/max range.

This widget provides a dual-handle slider perfect for filtering values within a range (e.g., frame ranges, price ranges).

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
minimum
int

Minimum value of the range.

0
maximum
int

Maximum value of the range.

100
low
Optional[int]

Initial low value.

None
high
Optional[int]

Initial high value.

None
show_values
bool

Whether to show value labels.

True
Signals

range_changed: Emitted when either handle changes (low, high). low_changed: Emitted when the low value changes. high_changed: Emitted when the high value changes.

Examples:

>>> slider = FXRangeSlider(minimum=0, maximum=100)
>>> slider.range_changed.connect(lambda l, h: print(f"Range: {l}-{h}"))
>>> slider.set_range(25, 75)

Methods:

Name Description
focusInEvent

Repaint to show the focus indicator.

focusOutEvent

Repaint to hide the focus indicator.

keyPressEvent

Adjust the active handle from the keyboard.

leaveEvent

Handle mouse leave.

minimumSizeHint

Return the minimum size.

mouseMoveEvent

Handle mouse move.

mousePressEvent

Handle mouse press.

mouseReleaseEvent

Handle mouse release.

paintEvent

Paint the range slider.

set_maximum

Set the maximum value.

set_minimum

Set the minimum value.

set_range

Set both low and high values.

sizeHint

Return the preferred size.

Attributes:

Name Type Description
high int

Return the high value.

low int

Return the low value.

Attributes
high property writable
high: int

Return the high value.

low property writable
low: int

Return the low value.

Methods:
focusInEvent
focusInEvent(event) -> None

Repaint to show the focus indicator.

focusOutEvent
focusOutEvent(event) -> None

Repaint to hide the focus indicator.

keyPressEvent
keyPressEvent(event: QKeyEvent) -> None

Adjust the active handle from the keyboard.

Left/Down and Right/Up move the active handle by 1, PageUp/PageDown by 10% of the range, Home/End jump it to the extremes, and Space switches between the low and high handle.

leaveEvent
leaveEvent(event) -> None

Handle mouse leave.

minimumSizeHint
minimumSizeHint()

Return the minimum size.

mouseMoveEvent
mouseMoveEvent(event: QMouseEvent) -> None

Handle mouse move.

mousePressEvent
mousePressEvent(event: QMouseEvent) -> None

Handle mouse press.

mouseReleaseEvent
mouseReleaseEvent(event: QMouseEvent) -> None

Handle mouse release.

paintEvent
paintEvent(event) -> None

Paint the range slider.

set_maximum
set_maximum(maximum: int) -> None

Set the maximum value.

set_minimum
set_minimum(minimum: int) -> None

Set the minimum value.

set_range
set_range(low: int, high: int) -> None

Set both low and high values.

Parameters:

Name Type Description Default
low int

The low value.

required
high int

The high value.

required
sizeHint
sizeHint()

Return the preferred size.