Class: QgsRangeSlider

class qgis.gui.QgsRangeSlider

Bases: PyQt5.QtWidgets.QWidget

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

Added in version 3.18.

QgsRangeSlider(parent: Optional[QWidget] = None) Constructor for QgsRangeSlider, with the specified parent widget.

QgsRangeSlider(orientation: Qt.Orientation, parent: Optional[QWidget] = None) Constructor for QgsRangeSlider, with the specified parent widget.

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

Methods

actionEvent

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

customEvent

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

event

param event:

fixedRangeSize

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

flippedDirection

Returns True if the slider has its values flipped.

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

initPainter

inputMethodEvent

isSignalConnected

keyPressEvent

param event:

keyReleaseEvent

leaveEvent

lowerValue

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

maximum

Returns the maximum value allowed by the widget.

metric

minimum

Returns the minimum value allowed by the widget.

minimumSizeHint

rtype:

QSize

mouseDoubleClickEvent

mouseMoveEvent

param event:

mousePressEvent

param event:

mouseReleaseEvent

param event:

moveEvent

nativeEvent

orientation

Returns the orientation of the slider.

pageStep

Returns the page step value for the widget.

paintEvent

param event:

receivers

resizeEvent

sender

senderSignalIndex

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.

sharedPainter

showEvent

singleStep

Returns the single step value for the widget.

sizeHint

rtype:

QSize

tabletEvent

tickInterval

Returns the interval for tick marks shown in the widget.

tickPosition

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

timerEvent

updateMicroFocus

upperValue

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

wheelEvent

Signals

fixedRangeSizeChanged

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

rangeChanged

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

rangeLimitsChanged

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

actionEvent(self, a0: QActionEvent | None)
changeEvent(self, a0: QEvent | None)
childEvent(self, a0: QChildEvent | None)
closeEvent(self, a0: QCloseEvent | None)
connectNotify(self, signal: QMetaMethod)
contextMenuEvent(self, a0: QContextMenuEvent | None)
create(self, window: PyQt5.sip.voidptr = None, initializeWindow: bool = True, destroyOldWindow: bool = True)
customEvent(self, a0: QEvent | None)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, signal: QMetaMethod)
dragEnterEvent(self, a0: QDragEnterEvent | None)
dragLeaveEvent(self, a0: QDragLeaveEvent | None)
dragMoveEvent(self, a0: QDragMoveEvent | None)
dropEvent(self, a0: QDropEvent | None)
enterEvent(self, a0: QEvent | None)
event(self, event: QEvent | None) bool
Parameters:

event (Optional[QEvent])

Return type:

bool

fixedRangeSize(self) int

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

fixedRangeSizeChanged

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.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

flippedDirection(self) bool

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

focusInEvent(self, a0: QFocusEvent | None)
focusNextChild(self) bool
focusNextPrevChild(self, next: bool) bool
focusOutEvent(self, a0: QFocusEvent | None)
focusPreviousChild(self) bool
hideEvent(self, a0: QHideEvent | None)
initPainter(self, painter: QPainter | None)
inputMethodEvent(self, a0: QInputMethodEvent | None)
isSignalConnected(self, signal: QMetaMethod) bool
keyPressEvent(self, event: QKeyEvent | None)
Parameters:

event (Optional[QKeyEvent])

keyReleaseEvent(self, a0: QKeyEvent | None)
leaveEvent(self, a0: QEvent | None)
lowerValue(self) int

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

See also

upperValue()

See also

setLowerValue()

Return type:

int

maximum(self) int

Returns the maximum value allowed by the widget.

See also

setMaximum()

See also

minimum()

Return type:

int

metric(self, a0: QPaintDevice.PaintDeviceMetric) int
minimum(self) int

Returns the minimum value allowed by the widget.

See also

setMinimum()

See also

maximum()

Return type:

int

minimumSizeHint(self) QSize
Return type:

QSize

mouseDoubleClickEvent(self, a0: QMouseEvent | None)
mouseMoveEvent(self, event: QMouseEvent | None)
Parameters:

event (Optional[QMouseEvent])

mousePressEvent(self, event: QMouseEvent | None)
Parameters:

event (Optional[QMouseEvent])

mouseReleaseEvent(self, event: QMouseEvent | None)
Parameters:

event (Optional[QMouseEvent])

moveEvent(self, a0: QMoveEvent | None)
nativeEvent(self, eventType: QByteArray | bytes | bytearray, message: PyQt5.sip.voidptr | None)
orientation(self) Qt.Orientation

Returns the orientation of the slider.

See also

setOrientation()

Return type:

Qt.Orientation

pageStep(self) int

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

paintEvent(self, event: QPaintEvent | None)
Parameters:

event (Optional[QPaintEvent])

rangeChanged

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.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

rangeLimitsChanged

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.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

receivers(self, signal: PYQT_SIGNAL) int
resizeEvent(self, a0: QResizeEvent | None)
sender(self) QObject | None
senderSignalIndex(self) int
setFixedRangeSize(self, size: int)

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)

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)

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)

Sets the maximum value allowed in the widget.

See also

maximum()

See also

setMinimum()

Parameters:

maximum (int)

setMinimum(self, minimum: int)

Sets the minimum value allowed in the widget.

See also

minimum()

See also

setMaximum()

Parameters:

minimum (int)

setOrientation(self, orientation: Qt.Orientation)

Sets the orientation of the slider.

See also

orientation()

Parameters:

orientation (Qt.Orientation)

setPageStep(self, step: int)

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)

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)

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)

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)

Sets the interval for tick marks shown in the widget.

See also

tickInterval()

Parameters:

interval (int)

setTickPosition(self, position: QSlider.TickPosition)

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

See also

tickPosition()

Parameters:

position (QSlider.TickPosition)

setUpperValue(self, value: int)

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

See also

upperValue()

See also

setRange()

See also

setLowerValue()

Parameters:

value (int)

sharedPainter(self) QPainter | None
showEvent(self, a0: QShowEvent | None)
singleStep(self) int

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

sizeHint(self) QSize
Return type:

QSize

tabletEvent(self, a0: QTabletEvent | None)
tickInterval(self) int

Returns the interval for tick marks shown in the widget.

Return type:

int

tickPosition(self) QSlider.TickPosition

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

Return type:

QSlider.TickPosition

timerEvent(self, a0: QTimerEvent | None)
updateMicroFocus(self)
upperValue(self) int

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

See also

lowerValue()

See also

setUpperValue()

Return type:

int

wheelEvent(self, a0: QWheelEvent | None)