Class: QgsGradientStopEditor

class qgis.gui.QgsGradientStopEditor(parent: QWidget = None, ramp: QgsGradientColorRamp = None)

Bases: PyQt5.QtWidgets.QWidget

Constructor for QgsGradientStopEditor.

Parameters
  • parent (QWidget = None) – parent widget

  • ramp (QgsGradientColorRamp = None) – optional initial gradient ramp

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

Methods

actionEvent

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

customEvent

deleteSelectedStop

Deletes the current selected stop.

destroy

disconnectNotify

dragEnterEvent

param e

dragLeaveEvent

dragMoveEvent

dropEvent

param e

enterEvent

event

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

gradientRamp

Returns the current ramp created by the editor.

hideEvent

initPainter

inputMethodEvent

isSignalConnected

keyPressEvent

param event

keyReleaseEvent

leaveEvent

metric

mouseDoubleClickEvent

param event

mouseMoveEvent

param event

mousePressEvent

param event

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

param event

receivers

resizeEvent

selectStop

Sets the currently selected stop.

selectedStop

Returns details about the currently selected stop.

sender

senderSignalIndex

setColor1

Sets the color for the first stop.

setColor2

Sets the color for the last stop.

setGradientRamp

Sets the current ramp shown in the editor.

setSelectedStopColor

Sets the color for the current selected stop.

setSelectedStopDetails

Sets the color and offset for the current selected stop.

setSelectedStopOffset

Sets the offset for the current selected stop.

sharedPainter

showEvent

sizeHint

rtype

QSize

tabletEvent

timerEvent

updateMicroFocus

wheelEvent

Signals

changed

Emitted when the gradient ramp is changed by a user [signal]

selectedStopChanged

Emitted when the current selected stop changes.

actionEvent()
changeEvent()
changed

Emitted when the gradient ramp is changed by a user [signal]

childEvent()
closeEvent()
connectNotify()
contextMenuEvent()
create()
customEvent()
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()
disconnectNotify()
dragEnterEvent(self, e: QDragEnterEvent)
Parameters

e (QDragEnterEvent) –

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

e (QDropEvent) –

enterEvent()
event()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
gradientRamp(self) → QgsGradientColorRamp

Returns the current ramp created by the editor.

Return type

QgsGradientColorRamp

hideEvent()
initPainter()
inputMethodEvent()
isSignalConnected()
keyPressEvent(self, event: QKeyEvent)
Parameters

event (QKeyEvent) –

keyReleaseEvent()
leaveEvent()
metric()
mouseDoubleClickEvent(self, event: QMouseEvent)
Parameters

event (QMouseEvent) –

mouseMoveEvent(self, event: QMouseEvent)
Parameters

event (QMouseEvent) –

mousePressEvent(self, event: QMouseEvent)
Parameters

event (QMouseEvent) –

mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent(self, event: QPaintEvent)
Parameters

event (QPaintEvent) –

receivers()
resizeEvent()
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

Emitted when the current selected stop changes.

Parameters

stop (QgsGradientStop) – details about newly selected stop [signal]

sender()
senderSignalIndex()
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()

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

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()
showEvent()
sizeHint(self) → QSize
Return type

QSize

tabletEvent()
timerEvent()
updateMicroFocus()
wheelEvent()