Class: QgsColorRampLegendNodeWidget¶
- class qgis.gui.QgsColorRampLegendNodeWidget¶
Bases:
QgsPanelWidget
A widget for properties relating to a
QgsColorRampLegendNode
(QgsColorRampLegendNodeSettings
).The current settings are set by a call to
setSettings()
, and the settings defined by the widget are retrieved by callingsettings()
.When changes are made the to settings by a user the
widgetChanged()
signal is emitted.Added in version 3.18.
QgsColorRampLegendNodeWidget(parent: Optional[QWidget] = None, capabilities: Union[QgsColorRampLegendNodeWidget.Capabilities, QgsColorRampLegendNodeWidget.Capability] = QgsColorRampLegendNodeWidget.Capability.AllCapabilities) Constructor for
QgsColorRampLegendNodeWidget
, with the specifiedparent
widget.Since QGIS 3.38, the
capabilities
argument can be used to fine-tune settings exposed in the widget.Enums
Bases:
enum.IntEnum
Methods
Overridden key press event to handle the esc event on the widget.
Sets the settings to show in the widget.
Sets visibility for the "Use Continuous Legend" checkbox to
visible
.Returns the legend node settings as defined by the widget.
- class Capabilities¶
- class Capabilities(f: QgsColorRampLegendNodeWidget.Capabilities | QgsColorRampLegendNodeWidget.Capability)
- class Capabilities(a0: QgsColorRampLegendNodeWidget.Capabilities)
Bases:
sip.wrapper
- baseClass¶
alias of
QgsColorRampLegendNodeWidget
- class Capability(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
enum.IntEnum
Capabilities to expose in the widget.
Added in version 3.38.
Prefix
: Allow editing legend prefixSuffix
: Allow editing legend suffixNumberFormat
: Allow editing number formatDefaultMinimum
: Allow resetting minimum label to defaultDefaultMaximum
: Allow resetting maximum label to defaultAllCapabilities
: All capabilities
- AllCapabilities = 31¶
- DefaultMaximum = 16¶
- DefaultMinimum = 8¶
- NumberFormat = 4¶
- Prefix = 1¶
- Suffix = 2¶
- baseClass¶
alias of
QgsColorRampLegendNodeWidget
- 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, a0: QEvent | None) 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)¶
Overridden key press event to handle the esc event on the widget.
- Parameters:
event – The key event
- keyReleaseEvent(self, a0: QKeyEvent | None)¶
- leaveEvent(self, a0: QEvent | None)¶
- metric(self, a0: QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, a0: QMouseEvent | None)¶
- mouseMoveEvent(self, a0: QMouseEvent | None)¶
- mousePressEvent(self, a0: QMouseEvent | None)¶
- mouseReleaseEvent(self, a0: QMouseEvent | None)¶
- moveEvent(self, a0: QMoveEvent | None)¶
- nativeEvent(self, eventType: QByteArray | bytes | bytearray, message: PyQt5.sip.voidptr | None)¶
- paintEvent(self, a0: QPaintEvent | None)¶
- receivers(self, signal: PYQT_SIGNAL) int ¶
- resizeEvent(self, a0: QResizeEvent | None)¶
- sender(self) QObject | None ¶
- senderSignalIndex(self) int ¶
- setSettings(self, settings: QgsColorRampLegendNodeSettings)¶
Sets the settings to show in the widget.
See also
- Parameters:
settings (QgsColorRampLegendNodeSettings)
- setUseContinuousRampCheckBoxVisibility(self, visible: bool)¶
Sets visibility for the “Use Continuous Legend” checkbox to
visible
.This widget is visible and checked by default but in a few cases it does not need to be visible because disabling it would not make sense (for instance when using single band gray renderer).
- Parameters:
visible (bool)
- settings(self) QgsColorRampLegendNodeSettings ¶
Returns the legend node settings as defined by the widget.
See also
- Return type:
- showEvent(self, a0: QShowEvent | None)¶
- tabletEvent(self, a0: QTabletEvent | None)¶
- timerEvent(self, a0: QTimerEvent | None)¶
- updateMicroFocus(self)¶
- wheelEvent(self, a0: QWheelEvent | None)¶