Subgroup: Gradient

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: Methods

acceptDrops
accessibleDescription
accessibleName
actionEvent
actions
activateWindow
addAction
addActions
adjustSize
autoFillBackground
backgroundRole
baseSize
blockSignals
changeEvent
childAt childAt(self, int, int) -> QWidget
childEvent
children
childrenRect
childrenRegion
clearFocus
clearMask
close
closeEvent
colorCount
connectNotify
contentsMargins
contentsRect
contextMenuEvent
contextMenuPolicy
create
createWindowContainer
cursor
customEvent
deleteLater
deleteSelectedStop Deletes the current selected stop.
depth
destroy
devType
devicePixelRatio
devicePixelRatioF
devicePixelRatioFScale
disconnect
disconnectNotify
dragEnterEvent
dragLeaveEvent
dragMoveEvent
dropEvent
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
effectiveWinId
ensurePolished
enterEvent
event
eventFilter
find
findChild findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
findChildren findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
focusInEvent
focusNextChild
focusNextPrevChild
focusOutEvent
focusPolicy
focusPreviousChild
focusProxy
focusWidget
font
fontInfo
fontMetrics
foregroundRole
frameGeometry
frameSize
geometry
getContentsMargins
grab
grabGesture
grabKeyboard
grabMouse grabMouse(self, Union[QCursor, Qt.CursorShape])
grabShortcut
gradientRamp Returns the current ramp created by the editor.
graphicsEffect
graphicsProxyWidget
hasFocus
hasHeightForWidth
hasMouseTracking
hasTabletTracking
height
heightForWidth
heightMM
hide
hideEvent
inherits
initPainter
inputMethodEvent
inputMethodHints
inputMethodQuery
insertAction
insertActions
installEventFilter
isActiveWindow
isAncestorOf
isEnabled
isEnabledTo
isFullScreen
isHidden
isLeftToRight
isMaximized
isMinimized
isModal
isRightToLeft
isSignalConnected
isVisible
isVisibleTo
isWidgetType
isWindow
isWindowModified
isWindowType
keyPressEvent
keyReleaseEvent
keyboardGrabber
killTimer
layout
layoutDirection
leaveEvent
locale
logicalDpiX
logicalDpiY
lower
mapFrom
mapFromGlobal
mapFromParent
mapTo
mapToGlobal
mapToParent
mask
maximumHeight
maximumSize
maximumWidth
metaObject
metric
minimumHeight
minimumSize
minimumSizeHint
minimumWidth
mouseDoubleClickEvent
mouseGrabber
mouseMoveEvent
mousePressEvent
mouseReleaseEvent
move move(self, int, int)
moveEvent
moveToThread
nativeEvent
nativeParentWidget
nextInFocusChain
normalGeometry
objectName
overrideWindowFlags
overrideWindowState
paintEngine
paintEvent
paintingActive
palette
parent
parentWidget
physicalDpiX
physicalDpiY
pos
previousInFocusChain
property
pyqtConfigure Each keyword argument is either the name of a Qt property or a Qt signal.
raise_
receivers
rect
releaseKeyboard
releaseMouse
releaseShortcut
removeAction
removeEventFilter
render render(self, QPainter, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: Union[QWidget.RenderFlags, QWidget.RenderFlag] = QWidget.RenderFlags(QWidget.DrawWindowBackground|QWidget.DrawChildren))
repaint repaint(self, int, int, int, int)
resize resize(self, int, int)
resizeEvent
restoreGeometry
saveGeometry
scroll scroll(self, int, int, QRect)
selectStop Sets the currently selected stop.
selectedStop Returns details about the currently selected stop.
sender
senderSignalIndex
setAcceptDrops
setAccessibleDescription
setAccessibleName
setAttribute
setAutoFillBackground
setBackgroundRole
setBaseSize setBaseSize(self, QSize)
setColor1 Sets the color for the first stop.
setColor2 Sets the color for the last stop.
setContentsMargins setContentsMargins(self, QMargins)
setContextMenuPolicy
setCursor
setDisabled
setEnabled
setFixedHeight
setFixedSize setFixedSize(self, int, int)
setFixedWidth
setFocus setFocus(self, Qt.FocusReason)
setFocusPolicy
setFocusProxy
setFont
setForegroundRole
setGeometry setGeometry(self, int, int, int, int)
setGradientRamp Sets the current ramp shown in the editor.
setGraphicsEffect
setHidden
setInputMethodHints
setLayout
setLayoutDirection
setLocale
setMask setMask(self, QRegion)
setMaximumHeight
setMaximumSize setMaximumSize(self, QSize)
setMaximumWidth
setMinimumHeight
setMinimumSize setMinimumSize(self, QSize)
setMinimumWidth
setMouseTracking
setObjectName
setPalette
setParent setParent(self, QWidget, Union[Qt.WindowFlags, Qt.WindowType])
setProperty
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.
setShortcutAutoRepeat
setShortcutEnabled
setSizeIncrement setSizeIncrement(self, QSize)
setSizePolicy setSizePolicy(self, QSizePolicy.Policy, QSizePolicy.Policy)
setStatusTip
setStyle
setStyleSheet
setTabOrder
setTabletTracking
setToolTip
setToolTipDuration
setUpdatesEnabled
setVisible
setWhatsThis
setWindowFilePath
setWindowFlag
setWindowFlags
setWindowIcon
setWindowIconText
setWindowModality
setWindowModified
setWindowOpacity
setWindowRole
setWindowState
setWindowTitle
sharedPainter
show
showEvent
showFullScreen
showMaximized
showMinimized
showNormal
signalsBlocked
size
sizeHint
sizeIncrement
sizePolicy
stackUnder
startTimer
statusTip
style
styleSheet
tabletEvent
testAttribute
thread
timerEvent
toolTip
toolTipDuration
tr
underMouse
ungrabGesture
unsetCursor
unsetLayoutDirection
unsetLocale
update update(self, QRect)
updateGeometry
updateMicroFocus
updatesEnabled
visibleRegion
whatsThis
wheelEvent
width
widthMM
winId
window
windowFilePath
windowFlags
windowHandle
windowIcon
windowIconText
windowModality
windowOpacity
windowRole
windowState
windowTitle
windowType
x
y

Attributes

DrawChildren
DrawWindowBackground
IgnoreMask
PdmDepth
PdmDevicePixelRatio
PdmDevicePixelRatioScaled
PdmDpiX
PdmDpiY
PdmHeight
PdmHeightMM
PdmNumColors
PdmPhysicalDpiX
PdmPhysicalDpiY
PdmWidth
PdmWidthMM
changed Emitted when the gradient ramp is changed by a user [signal]
customContextMenuRequested customContextMenuRequested(self, QPoint) [signal]
destroyed destroyed(self, QObject = None) [signal]
objectNameChanged objectNameChanged(self, str) [signal]
selectedStopChanged Emitted when the current selected stop changes.
staticMetaObject
windowIconChanged windowIconChanged(self, QIcon) [signal]
windowIconTextChanged windowIconTextChanged(self, str) [signal]
windowTitleChanged windowTitleChanged(self, str) [signal]
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.

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

selectedStop(self) → QgsGradientStop

Returns details about the currently selected stop.

See also

selectStop()

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

setColor2()

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

Sets the color for the last stop.

Parameters:color – new stop color

See also

setColor1()

setGradientRamp(self, ramp: QgsGradientColorRamp)

Sets the current ramp shown in the editor.

Parameters:ramp – color ramp

See also

gradientRamp()

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

Sets the color for the current selected stop.

Parameters:color – 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 – new stop color
  • offset – 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 – new stop offset
sharedPainter()
showEvent()
sizeHint(self) → QSize
tabletEvent()
timerEvent()
updateMicroFocus()
wheelEvent()