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 |
|---|---|---|---|
|
Optional[QWidget]
|
Parent widget. |
None
|
|
int
|
Minimum value of the range. |
0
|
|
int
|
Maximum value of the range. |
100
|
|
Optional[int]
|
Initial low value. |
None
|
|
Optional[int]
|
Initial high value. |
None
|
|
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 |
|---|---|
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. |