Class: QgsLegendModel¶
Item model implementation based on layer tree model for layout legend.
Overrides some functionality of QgsLayerTreeModel to better
fit the needs of layout legends.
Class Hierarchy¶
Base classes¶
A model representing the layer tree, including layers and groups of layers. |
|
- class qgis.core.QgsLegendModel[source]¶
Bases:
QgsLayerTreeModel- __init__(rootNode: QgsLayerTree | None, parent: QObject | None = None, layout: QgsLayoutItemLegend | None = None)
Construct the model based on the given layer tree
- Parameters:
rootNode (Optional[QgsLayerTree])
parent (Optional[QObject] = None)
layout (Optional[QgsLayoutItemLegend] = None)
- __init__(rootNode: QgsLayerTree | None, layout: QgsLayoutItemLegend | None)
Alternative constructor.
- Parameters:
rootNode (Optional[QgsLayerTree])
layout (Optional[QgsLayoutItemLegend])
- clearCachedData(self, node: QgsLayerTreeNode | None)[source]¶
Clears any previously cached data for the specified
node.Added in version 3.14.
- Parameters:
node (Optional[QgsLayerTreeNode])
- signal refreshLegend[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.