QGIS API Documentation 3.41.0-Master (25ec5511245)
|
Default legend implementation for vector layers. More...
#include <qgsmaplayerlegend.h>
Public Member Functions | |
QgsDefaultVectorLayerLegend (QgsVectorLayer *vl) | |
QList< QgsLayerTreeModelLegendNode * > | createLayerTreeModelLegendNodes (QgsLayerTreeLayer *nodeLayer) override |
Returns list of legend nodes to be used for a particular layer tree layer node. | |
void | readXml (const QDomElement &elem, const QgsReadWriteContext &context) override |
Reads configuration from a DOM element previously written by writeXml() | |
void | setShowLabelLegend (bool enabled) |
Sets if a legend for the labeling should be shown. | |
void | setTextOnSymbolContent (const QHash< QString, QString > &content) |
Sets per-symbol content of labels for "text on symbol" functionality. | |
void | setTextOnSymbolEnabled (bool enabled) |
Sets whether the "text on symbol" functionality is enabled. | |
void | setTextOnSymbolTextFormat (const QgsTextFormat &format) |
Sets text format of symbol labels for "text on symbol" functionality. | |
bool | showLabelLegend () const |
Returns whether the legend for the labeling is shown. | |
QHash< QString, QString > | textOnSymbolContent () const |
Returns per-symbol content of labels for "text on symbol" functionality. | |
bool | textOnSymbolEnabled () const |
Returns whether the "text on symbol" functionality is enabled. | |
QgsTextFormat | textOnSymbolTextFormat () const |
Returns text format of symbol labels for "text on symbol" functionality. | |
QDomElement | writeXml (QDomDocument &doc, const QgsReadWriteContext &context) const override |
Writes configuration to a DOM element, to be used later with readXml() | |
Public Member Functions inherited from QgsMapLayerLegend | |
QgsMapLayerLegend (QObject *parent=nullptr) | |
Constructor for QgsMapLayerLegend. | |
Additional Inherited Members | |
Signals inherited from QgsMapLayerLegend | |
void | itemsChanged () |
Emitted when existing items/nodes got invalid and should be replaced by new ones. | |
Static Public Member Functions inherited from QgsMapLayerLegend | |
static QgsMapLayerLegend * | defaultMeshLegend (QgsMeshLayer *ml) |
Create new legend implementation for mesh layer. | |
static QgsMapLayerLegend * | defaultPointCloudLegend (QgsPointCloudLayer *layer) |
Create new legend implementation for a point cloud layer. | |
static QgsMapLayerLegend * | defaultRasterLegend (QgsRasterLayer *rl) |
Create new legend implementation for raster layer. | |
static QgsMapLayerLegend * | defaultVectorLegend (QgsVectorLayer *vl) |
Create new legend implementation for vector layer. | |
Default legend implementation for vector layers.
Definition at line 233 of file qgsmaplayerlegend.h.
|
explicit |
Definition at line 353 of file qgsmaplayerlegend.cpp.
|
overridevirtual |
Returns list of legend nodes to be used for a particular layer tree layer node.
Ownership is transferred to the caller.
Implements QgsMapLayerLegend.
Definition at line 360 of file qgsmaplayerlegend.cpp.
|
overridevirtual |
Reads configuration from a DOM element previously written by writeXml()
Reimplemented from QgsMapLayerLegend.
Definition at line 444 of file qgsmaplayerlegend.cpp.
|
inline |
Sets if a legend for the labeling should be shown.
enabled | true to show label legend entries |
Definition at line 267 of file qgsmaplayerlegend.h.
|
inline |
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.
Definition at line 293 of file qgsmaplayerlegend.h.
|
inline |
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().
Definition at line 254 of file qgsmaplayerlegend.h.
|
inline |
Sets text format of symbol labels for "text on symbol" functionality.
Definition at line 279 of file qgsmaplayerlegend.h.
|
inline |
Returns whether the legend for the labeling is shown.
Definition at line 260 of file qgsmaplayerlegend.h.
|
inline |
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.
Definition at line 286 of file qgsmaplayerlegend.h.
|
inline |
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().
Definition at line 246 of file qgsmaplayerlegend.h.
|
inline |
Returns text format of symbol labels for "text on symbol" functionality.
Definition at line 273 of file qgsmaplayerlegend.h.
|
overridevirtual |
Writes configuration to a DOM element, to be used later with readXml()
Reimplemented from QgsMapLayerLegend.
Definition at line 468 of file qgsmaplayerlegend.cpp.