Class: QgsDefaultVectorLayerLegend¶
-
class
qgis.core.
QgsDefaultVectorLayerLegend
¶ Bases:
QgsMapLayerLegend
Default legend implementation for vector layers
Methods
- param nodeLayer
- param elem
Sets per-symbol content of labels for “text on symbol” functionality.
Sets whether the “text on symbol” functionality is enabled.
Sets text format of symbol labels for “text on symbol” functionality.
Returns per-symbol content of labels for “text on symbol” functionality.
Returns whether the “text on symbol” functionality is enabled.
Returns text format of symbol labels for “text on symbol” functionality.
- param doc
-
childEvent
(self, QChildEvent)¶
-
connectNotify
(self, QMetaMethod)¶
-
createLayerTreeModelLegendNodes
(self, nodeLayer: QgsLayerTreeLayer) → List[QgsLayerTreeModelLegendNode]¶ - Parameters
nodeLayer (QgsLayerTreeLayer) –
- Return type
-
customEvent
(self, QEvent)¶
-
disconnectNotify
(self, QMetaMethod)¶
-
isSignalConnected
(self, QMetaMethod) → bool¶
-
readXml
(self, elem: QDomElement, context: QgsReadWriteContext)¶ - Parameters
elem (QDomElement) –
context (QgsReadWriteContext) –
-
receivers
(self, PYQT_SIGNAL) → int¶
-
sender
(self) → QObject¶
-
senderSignalIndex
(self) → int¶
-
setTextOnSymbolContent
(self, content: Dict[str, str])¶ Sets per-symbol content of labels for “text on symbol” functionality. In the passed dictionary the keys are rule keys of legend items, the values are labels to be shown.
New in version 3.2.
- Parameters
content (Dict[str) –
-
setTextOnSymbolEnabled
(self, enabled: bool)¶ Sets whether the “text on symbol” functionality is enabled. When enabled, legend symbols may have extra text rendered on top. The content of labels and their style is controlled by textOnSymbolContent() and textOnSymbolTextFormat().
New in version 3.2.
- Parameters
enabled (bool) –
-
setTextOnSymbolTextFormat
(self, format: QgsTextFormat)¶ Sets text format of symbol labels for “text on symbol” functionality.
New in version 3.2.
- Parameters
format (QgsTextFormat) –
-
textOnSymbolContent
(self) → Dict[str, str]¶ Returns per-symbol content of labels for “text on symbol” functionality. In the passed dictionary the keys are rule keys of legend items, the values are labels to be shown.
New in version 3.2.
- Return type
Dict[str, str]
-
textOnSymbolEnabled
(self) → bool¶ Returns whether the “text on symbol” functionality is enabled. When enabled, legend symbols may have extra text rendered on top. The content of labels and their style is controlled by textOnSymbolContent() and textOnSymbolTextFormat().
New in version 3.2.
- Return type
bool
-
textOnSymbolTextFormat
(self) → QgsTextFormat¶ Returns text format of symbol labels for “text on symbol” functionality.
New in version 3.2.
- Return type
-
timerEvent
(self, QTimerEvent)¶
-
writeXml
(self, doc: QDomDocument, context: QgsReadWriteContext) → QDomElement¶ - Parameters
doc (QDomDocument) –
context (QgsReadWriteContext) –
- Return type
QDomElement