Subgroup: Symbol

Class: QgsSymbolLegendNode

class qgis.core.QgsSymbolLegendNode

Bases: qgis._core.QgsLayerTreeModelLegendNode

Implementation of legend node interface for displaying preview of vector symbols and their labels and allowing interaction with the symbol / renderer.

New in version 2.6: Methods

blockSignals
checkAllItems Checks all items belonging to the same layer as this node.
childEvent
children
connectNotify
createTemporaryRenderContext
customEvent
data
deleteLater
disconnect
disconnectNotify
draw Entry point called from QgsLegendRenderer to do the rendering.
drawSymbol
drawSymbolText Draws label on the right side of the item
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
event
eventFilter
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]
flags
iconSize

New in version 2.10.

inherits
installEventFilter
invalidateMapBasedData
isEmbeddedInParent
isScaleOK
isSignalConnected
isWidgetType
isWindowType
killTimer
layerNode Return pointer to the parent layer node
metaObject
minimumIconSize Calculates the minimum icon size to prevent cropping.
model Return pointer to model owning this legend node
moveToThread
objectName
parent
property
pyqtConfigure Each keyword argument is either the name of a Qt property or a Qt signal.
receivers
removeEventFilter
sender
senderSignalIndex
setData
setEmbeddedInParent
setIconSize Set the icon size
setObjectName
setParent
setProperty
setSymbol Sets the symbol to be used by the legend node.
setUserLabel
signalsBlocked
startTimer
symbol Returns the symbol used by the legend node.
thread
timerEvent
tr
uncheckAllItems Unchecks all items belonging to the same layer as this node.
userLabel

Attributes

ParentRuleKeyRole
RuleKeyRole
dataChanged Emitted on internal data change so the layer tree model can forward the signal to views [signal]
destroyed destroyed(self, QObject = None) [signal]
objectNameChanged objectNameChanged(self, str) [signal]
staticMetaObject
checkAllItems(self)

Checks all items belonging to the same layer as this node.

New in version 2.14.

childEvent()
connectNotify()
createTemporaryRenderContext()
customEvent()
data(self, role: int) → Any
disconnectNotify()
drawSymbol(self, settings: QgsLegendSettings, ctx: QgsLayerTreeModelLegendNode.ItemContext, itemHeight: float) → QSizeF
flags(self) → Qt.ItemFlags
iconSize(self) → QSize

New in version 2.10.

invalidateMapBasedData(self)
isScaleOK(self, scale: float) → bool
isSignalConnected()
minimumIconSize(self) → QSize

Calculates the minimum icon size to prevent cropping. When evaluating the size for multiple icons it is more efficient to create a single render context in advance and use the variant which accepts a QgsRenderContext argument.

New in version 2.10.

minimumIconSize(self, context: QgsRenderContext) -> QSize Calculates the minimum icon size to prevent cropping. When evaluating the size for multiple icons it is more efficient to create a single render context in advance and call this method instead of minimumIconSize().

New in version 2.18.

receivers()
sender()
senderSignalIndex()
setData(self, value: Any, role: int) → bool
setEmbeddedInParent(self, embedded: bool)
setIconSize(self, sz: QSize)

Set the icon size

New in version 2.10.

setSymbol(self, symbol: QgsSymbol)

Sets the symbol to be used by the legend node. The symbol change is also propagated to the associated vector layer’s renderer.

Parameters:symbol – new symbol for node. Ownership is transferred.

See also

symbol()

New in version 2.14.

setUserLabel(self, userLabel: str)
symbol(self) → QgsSymbol

Returns the symbol used by the legend node.

See also

setSymbol()

New in version 2.14.

timerEvent()
uncheckAllItems(self)

Unchecks all items belonging to the same layer as this node.

New in version 2.14.

See also

checkAllItems()