Class: QgsRangeSlider

A slider control with two interactive endpoints, for interactive selection of a range of values.

Added in version 3.18.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsRangeSlider

Base classes

QWidget

QObject

QPaintDevice

Methods

fixedRangeSize

Returns the slider's fixed range size, or -1 if not set.

flippedDirection

Returns True if the slider has its values flipped.

lowerValue

Returns the lower value for the range selected in the widget.

maximum

Returns the maximum value allowed by the widget.

minimum

Returns the minimum value allowed by the widget.

orientation

Returns the orientation of the slider.

pageStep

Returns the page step value for the widget.

setFixedRangeSize

Sets the slider's fixed range size.

setFlippedDirection

Sets whether the slider has its values flipped.

setLowerValue

Sets the lower value for the range currently selected in the widget.

setMaximum

Sets the maximum value allowed in the widget.

setMinimum

Sets the minimum value allowed in the widget.

setOrientation

Sets the orientation of the slider.

setPageStep

Sets the page step value for the widget.

setRange

Sets the current range selected in the widget.

setRangeLimits

Sets the minimum and maximum range limits for values allowed in the widget.

setSingleStep

Sets the single step value for the widget.

setTickInterval

Sets the interval for tick marks shown in the widget.

setTickPosition

Sets the position of the tick marks shown in the widget.

setUpperValue

Sets the upper value for the range currently selected in the widget.

singleStep

Returns the single step value for the widget.

tickInterval

Returns the interval for tick marks shown in the widget.

tickPosition

Returns the position of the tick marks shown in the widget.

upperValue

Returns the upper value for the range selected in the widget.

Signals

fixedRangeSizeChanged

Emitted when the widget's fixed range size is changed.

rangeChanged

Emitted when the range selected in the widget is changed.

rangeLimitsChanged

Emitted when the limits of values allowed in the widget is changed.

class qgis.gui.QgsRangeSlider[source]

Bases: QWidget

__init__(parent: QWidget | None = None)

Constructor for QgsRangeSlider, with the specified parent widget.

Parameters:

parent (Optional[QWidget] = None)

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

Constructor for QgsRangeSlider, with the specified parent widget.

The orientation parameter determines whether the slider is horizontal or vertical.

Parameters:
  • orientation (Qt.Orientation)

  • parent (Optional[QWidget] = None)

fixedRangeSize(self) int[source]

Returns the slider’s fixed range size, or -1 if not set.

If a fixed range size is set then moving either the lower or upper slider will automatically move the other slider accordingly, in order to keep the selected range at the specified fixed size.

Added in version 3.38.

Return type:

int

signal fixedRangeSizeChanged(size: int)[source]

Emitted when the widget’s fixed range size is changed.

See also

fixedRangeSize()

Added in version 3.38.

Parameters:

size (int)

flippedDirection(self) bool[source]

Returns True if the slider has its values flipped.

If this property is False (the default), the minimum and maximum will be shown in its classic position for the widget. If the value is True, the minimum and maximum appear at their opposite location.

Return type:

bool

lowerValue(self) int[source]

Returns the lower value for the range selected in the widget.

See also

upperValue()

See also

setLowerValue()

Return type:

int

maximum(self) int[source]

Returns the maximum value allowed by the widget.

See also

setMaximum()

See also

minimum()

Return type:

int

minimum(self) int[source]

Returns the minimum value allowed by the widget.

See also

setMinimum()

See also

maximum()

Return type:

int

orientation(self) Qt.Orientation[source]

Returns the orientation of the slider.

See also

setOrientation()

Return type:

Qt.Orientation

pageStep(self) int[source]

Returns the page step value for the widget.

This corresponds to the larger increment or decrement applied when the user presses the page increment key (usually PageUp or PageDown).

See also

setPageStep()

See also

singleStep()

Return type:

int

signal rangeChanged(minimum: int, maximum: int)[source]

Emitted when the range selected in the widget is changed.

Parameters:
  • minimum (int)

  • maximum (int)

signal rangeLimitsChanged(minimum: int, maximum: int)[source]

Emitted when the limits of values allowed in the widget is changed.

Parameters:
  • minimum (int)

  • maximum (int)

setFixedRangeSize(self, size: int)[source]

Sets the slider’s fixed range size. Set to -1 if no fixed size is desired.

If a fixed range size is set then moving either the lower or upper slider will automatically move the other slider accordingly, in order to keep the selected range at the specified fixed size.

See also

fixedRangeSize()

Added in version 3.38.

Parameters:

size (int)

setFlippedDirection(self, flipped: bool)[source]

Sets whether the slider has its values flipped.

If this property is False (the default), the minimum and maximum will be shown in its classic position for the widget. If the value is True, the minimum and maximum appear at their opposite location. (i.e. minimum at the bottom of a vertical slider, maximum at the top of a vertical slider).

Parameters:

flipped (bool)

setLowerValue(self, value: int)[source]

Sets the lower value for the range currently selected in the widget.

See also

lowerValue()

See also

setRange()

See also

setUpperValue()

Parameters:

value (int)

setMaximum(self, maximum: int)[source]

Sets the maximum value allowed in the widget.

See also

maximum()

See also

setMinimum()

Parameters:

maximum (int)

setMinimum(self, minimum: int)[source]

Sets the minimum value allowed in the widget.

See also

minimum()

See also

setMaximum()

Parameters:

minimum (int)

setOrientation(self, orientation: Qt.Orientation)[source]

Sets the orientation of the slider.

See also

orientation()

Parameters:

orientation (Qt.Orientation)

setPageStep(self, step: int)[source]

Sets the page step value for the widget.

This corresponds to the larger increment or decrement applied when the user presses the page increment key (usually PageUp or PageDown).

See also

pageStep()

See also

setSingleStep()

Parameters:

step (int)

setRange(self, lower: int, upper: int)[source]

Sets the current range selected in the widget.

See also

setLowerValue()

See also

setUpperValue()

Parameters:
  • lower (int)

  • upper (int)

setRangeLimits(self, minimum: int, maximum: int)[source]

Sets the minimum and maximum range limits for values allowed in the widget.

See also

setMinimum()

See also

setMaximum()

Parameters:
  • minimum (int)

  • maximum (int)

setSingleStep(self, step: int)[source]

Sets the single step value for the widget.

This corresponds to the smaller increment or decrement applied when the user presses an arrow key.

See also

singleStep()

See also

pageStep()

Parameters:

step (int)

setTickInterval(self, interval: int)[source]

Sets the interval for tick marks shown in the widget.

See also

tickInterval()

Parameters:

interval (int)

setTickPosition(self, position: QSlider.TickPosition)[source]

Sets the position of the tick marks shown in the widget.

See also

tickPosition()

Parameters:

position (QSlider.TickPosition)

setUpperValue(self, value: int)[source]

Sets the upper value for the range currently selected in the widget.

See also

upperValue()

See also

setRange()

See also

setLowerValue()

Parameters:

value (int)

singleStep(self) int[source]

Returns the single step value for the widget.

This corresponds to the smaller increment or decrement applied when the user presses an arrow key.

See also

setSingleStep()

See also

pageStep()

Return type:

int

tickInterval(self) int[source]

Returns the interval for tick marks shown in the widget.

Return type:

int

tickPosition(self) QSlider.TickPosition[source]

Returns the position of the tick marks shown in the widget.

Return type:

QSlider.TickPosition

upperValue(self) int[source]

Returns the upper value for the range selected in the widget.

See also

lowerValue()

See also

setUpperValue()

Return type:

int