Class: QgsRasterSymbolLegendNode¶
- class qgis.core.QgsRasterSymbolLegendNode¶
Bases:
QgsLayerTreeModelLegendNode
Implementation of legend node interface for displaying raster legend entries
New in version 2.6.
QgsRasterSymbolLegendNode(nodeLayer:
QgsLayerTreeLayer
, color: Union[QColor, Qt.GlobalColor, QGradient], label: str, parent: QObject = None, isCheckable: bool = False, ruleKey: str = ‘’) Constructor for QgsRasterSymbolLegendNode.- Parameters
nodeLayer – layer node
color – color
label – label
parent – attach a parent QObject to the legend node.
isCheckable – set to
True
to enable the checkbox for the node (since QGIS 3.18)ruleKey –
optional identifier to allow a unique ID to be assigned to the node by a renderer (since QGIS 3.18)
Methods
Returns a temporary context or
None
if legendMapViewData are not valid- param role
- param settings
- param settings
- rtype
Qt.ItemFlags
Returns whether the item is user-checkable - whether renderer supports enabling/disabling it.
Returns the unique identifier of node for identification of the item within renderer.
- param value
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- createTemporaryRenderContext(self) QgsRenderContext ¶
Returns a temporary context or
None
if legendMapViewData are not valid
- customEvent(self, QEvent)¶
- data(self, role: int) Any ¶
- Parameters
role (int) –
- Return type
Any
- disconnectNotify(self, QMetaMethod)¶
- drawSymbol(self, settings: QgsLegendSettings, ctx: QgsLayerTreeModelLegendNode.ItemContext, itemHeight: float) QSizeF ¶
- Parameters
settings (QgsLegendSettings) –
itemHeight (float) –
- Return type
QSizeF
- exportSymbolToJson(self, settings: QgsLegendSettings, context: QgsRenderContext) Dict[str, QJsonValue] ¶
- Parameters
settings (QgsLegendSettings) –
context (QgsRenderContext) –
- Return type
Dict[str, QJsonValue]
- flags(self) Qt.ItemFlags ¶
- Return type
Qt.ItemFlags
- isCheckable(self) bool ¶
Returns whether the item is user-checkable - whether renderer supports enabling/disabling it.
New in version 3.18.
- Return type
bool
- isSignalConnected(self, QMetaMethod) bool ¶
- receivers(self, PYQT_SIGNAL) int ¶
- ruleKey(self) str ¶
Returns the unique identifier of node for identification of the item within renderer.
New in version 3.18.
- Return type
str
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setData(self, value: Any, role: int) bool ¶
- Parameters
value (Any) –
role (int) –
- Return type
bool
- timerEvent(self, QTimerEvent)¶