Class: QgsDefaultVectorLayerLegend¶
Default legend implementation for vector layers.
Class Hierarchy¶
Base classes¶
An abstract interface for implementations of legends for one map layer. |
|
Methods
Sets if a legend for the labeling should be shown |
|
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 whether the legend for the labeling is shown |
|
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. |
- class qgis.core.QgsDefaultVectorLayerLegend[source]¶
Bases:
QgsMapLayerLegend
- setShowLabelLegend(self, enabled: bool)[source]¶
Sets if a legend for the labeling should be shown
- Parameters:
enabled (bool) – true to show label legend entries
Added in version 3.20.
- setTextOnSymbolContent(self, content: Dict[str | None, str | None])[source]¶
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.
Added in version 3.2.
- Parameters:
content (Dict[Optional[str], Optional[str]])
- setTextOnSymbolEnabled(self, enabled: bool)[source]¶
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()
andtextOnSymbolTextFormat()
.Added in version 3.2.
- Parameters:
enabled (bool)
- setTextOnSymbolTextFormat(self, format: QgsTextFormat)[source]¶
Sets text format of symbol labels for “text on symbol” functionality.
Added in version 3.2.
- Parameters:
format (QgsTextFormat)
- showLabelLegend(self) bool [source]¶
Returns whether the legend for the labeling is shown
Added in version 3.20.
- Return type:
bool
- 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.
Added in version 3.2.
- Return type:
Dict[str, str]
- textOnSymbolEnabled(self) bool [source]¶
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()
andtextOnSymbolTextFormat()
.Added in version 3.2.
- Return type:
bool
- textOnSymbolTextFormat(self) QgsTextFormat [source]¶
Returns text format of symbol labels for “text on symbol” functionality.
Added in version 3.2.
- Return type: