Class: QgsColorRampLegendNodeWidget

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 calling settings().

When changes are made the to settings by a user the widgetChanged() signal is emitted.

Added in version 3.18.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsColorRampLegendNodeWidget

Base classes

QgsPanelWidget

Base class for any widget that can be shown as an inline panel.

QWidget

QObject

QPaintDevice

Enums

Capability

Capabilities to expose in the widget.

Methods

setSettings

Sets the settings to show in the widget.

setUseContinuousRampCheckBoxVisibility

Sets visibility for the "Use Continuous Legend" checkbox to visible.

settings

Returns the legend node settings as defined by the widget.

class qgis.gui.QgsColorRampLegendNodeWidget[source]

Bases: QgsPanelWidget

__init__(parent: QWidget | None = None, capabilities: QgsColorRampLegendNodeWidget.Capabilities | QgsColorRampLegendNodeWidget.Capability = QgsColorRampLegendNodeWidget.Capability.AllCapabilities)

Constructor for QgsColorRampLegendNodeWidget, with the specified parent widget.

Since QGIS 3.38, the capabilities argument can be used to fine-tune settings exposed in the widget.

Parameters:
class Capabilities
class Capabilities(f: QgsColorRampLegendNodeWidget.Capabilities | QgsColorRampLegendNodeWidget.Capability)
class Capabilities(a0: QgsColorRampLegendNodeWidget.Capabilities)

Bases: object

class Capability(*values)

Bases: IntEnum

Capabilities to expose in the widget.

Added in version 3.38.

  • Prefix: Allow editing legend prefix

  • Suffix: Allow editing legend suffix

  • NumberFormat: Allow editing number format

  • DefaultMinimum: Allow resetting minimum label to default

  • DefaultMaximum: Allow resetting maximum label to default

  • AllCapabilities: All capabilities

AllCapabilities = 31
DefaultMaximum = 16
DefaultMinimum = 8
NumberFormat = 4
Prefix = 1
Suffix = 2
setSettings(self, settings: QgsColorRampLegendNodeSettings)[source]

Sets the settings to show in the widget.

See also

settings()

Parameters:

settings (QgsColorRampLegendNodeSettings)

setUseContinuousRampCheckBoxVisibility(self, visible: bool)[source]

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[source]

Returns the legend node settings as defined by the widget.

See also

setSettings()

Return type:

QgsColorRampLegendNodeSettings