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

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[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

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[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal rangeLimitsChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

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