Class: QgsGradientStopEditor¶
-
class
qgis.gui.
QgsGradientStopEditor
(parent: QWidget = None, ramp: QgsGradientColorRamp = None)¶ Bases:
PyQt5.QtWidgets.QWidget
Constructor for QgsGradientStopEditor.
- Parameters
parent – parent widget
ramp – optional initial gradient ramp
An interactive editor for previewing a gradient color ramp and modifying the position of color stops along the gradient.
New in version 2.16: Enums
Methods
Deletes the current selected stop.
Returns the current ramp created by the editor.
Sets the currently selected stop.
Returns details about the currently selected stop.
Sets the color for the first stop.
Sets the color for the last stop.
Sets the current ramp shown in the editor.
Sets the color for the current selected stop.
Sets the color and offset for the current selected stop.
Sets the offset for the current selected stop.
Signals
Emitted when the gradient ramp is changed by a user [signal]
Emitted when the current selected stop changes.
Attributes
-
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)¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
dropEvent
(self, e: QDropEvent)¶
-
enterEvent
()¶
-
event
()¶
-
focusInEvent
()¶
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
()¶
-
focusPreviousChild
()¶
-
gradientRamp
(self) → QgsGradientColorRamp¶ Returns the current ramp created by the editor.
See also
-
hideEvent
()¶
-
initPainter
()¶
-
inputMethodEvent
()¶
-
isSignalConnected
()¶
-
keyPressEvent
(self, event: QKeyEvent)¶
-
keyReleaseEvent
()¶
-
leaveEvent
()¶
-
metric
()¶
-
mouseDoubleClickEvent
(self, event: QMouseEvent)¶
-
mouseMoveEvent
(self, event: QMouseEvent)¶
-
mousePressEvent
(self, event: QMouseEvent)¶
-
mouseReleaseEvent
()¶
-
moveEvent
()¶
-
nativeEvent
()¶
-
paintEvent
(self, event: QPaintEvent)¶
-
receivers
()¶
-
resizeEvent
()¶
-
selectStop
(self, index: int)¶ Sets the currently selected stop.
- Parameters
index – index of stop, where 0 corresponds to the first stop
See also
-
selectedStop
(self) → QgsGradientStop¶ Returns details about the currently selected stop.
See also
-
selectedStopChanged
¶ Emitted when the current selected stop changes.
- Parameters
stop – 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 – new stop color
See also
See also
-
setColor2
(self, color: Union[QColor, Qt.GlobalColor, QGradient])¶ Sets the color for the last stop.
- Parameters
color – new stop color
See also
See also
-
setGradientRamp
(self, ramp: QgsGradientColorRamp)¶ Sets the current ramp shown in the editor.
- Parameters
ramp – color ramp
See also
-
setSelectedStopColor
(self, color: Union[QColor, Qt.GlobalColor, QGradient])¶ Sets the color for the current selected stop.
- Parameters
color – new stop color
See also
See also
See also
See also
-
setSelectedStopDetails
(self, color: Union[QColor, Qt.GlobalColor, QGradient], offset: float)¶ Sets the color and offset for the current selected stop.
- Parameters
color – new stop color
offset – new stop offset
See also
See also
-
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 – new stop offset
See also
See also
-
showEvent
()¶
-
sizeHint
(self) → QSize¶
-
tabletEvent
()¶
-
timerEvent
()¶
-
updateMicroFocus
()¶
-
wheelEvent
()¶