Class: QgsGradientStopEditor

class qgis.gui.QgsGradientStopEditor

Bases: PyQt5.QtWidgets.QWidget

An interactive editor for previewing a gradient color ramp and modifying the position of color stops along the gradient.

New in version 2.16.

QgsGradientStopEditor(parent: QWidget = None, ramp: QgsGradientColorRamp = None) Constructor for QgsGradientStopEditor.

Parameters
actionEvent(self, QActionEvent)
changeEvent(self, QEvent)
changed

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

childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
customEvent(self, QEvent)
deleteSelectedStop(self)

Deletes the current selected stop. This slot has no effect if either the first or last stop is selected, as they cannot be deleted.

destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, e: QDragEnterEvent)
Parameters

e (QDragEnterEvent) –

dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, e: QDropEvent)
Parameters

e (QDropEvent) –

enterEvent(self, QEvent)
event(self, QEvent) bool
focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self) bool
gradientRamp(self) QgsGradientColorRamp

Returns the current ramp created by the editor.

Return type

QgsGradientColorRamp

hideEvent(self, QHideEvent)
initPainter(self, QPainter)
inputMethodEvent(self, QInputMethodEvent)
isSignalConnected(self, QMetaMethod) bool
keyPressEvent(self, event: QKeyEvent)
Parameters

event (QKeyEvent) –

keyReleaseEvent(self, QKeyEvent)
leaveEvent(self, QEvent)
metric(self, QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, event: QMouseEvent)
Parameters

event (QMouseEvent) –

mouseMoveEvent(self, event: QMouseEvent)
Parameters

event (QMouseEvent) –

mousePressEvent(self, event: QMouseEvent)
Parameters

event (QMouseEvent) –

mouseReleaseEvent(self, QMouseEvent)
moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int]
paintEvent(self, event: QPaintEvent)
Parameters

event (QPaintEvent) –

receivers(self, PYQT_SIGNAL) int
resizeEvent(self, QResizeEvent)
selectStop(self, index: int)

Sets the currently selected stop.

Parameters

index (int) – index of stop, where 0 corresponds to the first stop

See also

selectedStop()

selectedStop(self) QgsGradientStop

Returns details about the currently selected stop.

See also

selectStop()

Return type

QgsGradientStop

selectedStopChanged

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

sender(self) QObject
senderSignalIndex(self) int
setColor1(self, color: Union[QColor, Qt.GlobalColor, QGradient])

Sets the color for the first stop.

Parameters

color (Union[QColor) – new stop color

See also

setColor2()

setColor2(self, color: Union[QColor, Qt.GlobalColor, QGradient])

Sets the color for the last stop.

Parameters

color (Union[QColor) – new stop color

See also

setColor1()

setGradientRamp(self, ramp: QgsGradientColorRamp)

Sets the current ramp shown in the editor.

Parameters

ramp (QgsGradientColorRamp) – color ramp

See also

gradientRamp()

setSelectedStopColor(self, color: Union[QColor, Qt.GlobalColor, QGradient])

Sets the color for the current selected stop.

Parameters

color (Union[QColor) – new stop color

See also

setColor1()

See also

setColor2()

setSelectedStopColorSpec(self, spec: QColor.Spec)

Sets the color spec for the current selected stop.

New in version 3.24.

Parameters

spec (QColor.Spec) –

setSelectedStopDetails(self, color: Union[QColor, Qt.GlobalColor, QGradient], offset: float)

Sets the color and offset for the current selected stop.

Parameters
  • color (Union[QColor) – new stop color

  • offset (float) – new stop offset

setSelectedStopDirection(self, direction: Qgis.AngularDirection)

Sets the hue angular direction for the current selected stop.

New in version 3.24.

Parameters

direction (Qgis.AngularDirection) –

setSelectedStopOffset(self, offset: float)

Sets the offset for the current selected stop. This slot has no effect if either the first or last stop is selected, as they cannot be repositioned.

Parameters

offset (float) – new stop offset

sharedPainter(self) QPainter
showEvent(self, QShowEvent)
sizeHint(self) QSize
Return type

QSize

tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
wheelEvent(self, QWheelEvent)