16#ifndef QGSMAPLAYERLEGEND_H
17#define QGSMAPLAYERLEGEND_H
66 virtual QDomElement writeXml( QDomDocument &doc,
const QgsReadWriteContext &context )
const;
104 static void setLegendNodeOrder(
QgsLayerTreeLayer *nodeLayer,
const QList<int> &order );
108 static void setLegendNodeUserLabel(
QgsLayerTreeLayer *nodeLayer,
int originalIndex,
const QString &newLabel );
109 static QString legendNodeUserLabel(
QgsLayerTreeLayer *nodeLayer,
int originalIndex );
110 static bool hasLegendNodeUserLabel(
QgsLayerTreeLayer *nodeLayer,
int originalIndex );
137 static void setLegendNodeSymbolSize(
QgsLayerTreeLayer *nodeLayer,
int originalIndex, QSizeF size );
148 static QSizeF legendNodeSymbolSize(
QgsLayerTreeLayer *nodeLayer,
int originalIndex );
172 static std::unique_ptr< QgsSymbol > legendNodeCustomSymbol(
QgsLayerTreeLayer *nodeLayer,
int originalIndex );
209 static void setLegendNodeColumnBreak(
QgsLayerTreeLayer *nodeLayer,
int originalIndex,
bool columnBreakBeforeNode );
217 static bool legendNodeColumnBreak(
QgsLayerTreeLayer *nodeLayer,
int originalIndex );
220 static void applyLayerNodeProperties(
QgsLayerTreeLayer *nodeLayer, QList<QgsLayerTreeModelLegendNode *> &nodes );
296 QDomElement writeXml( QDomDocument &doc,
const QgsReadWriteContext &context )
const override;
302 bool mTextOnSymbolEnabled =
false;
303 bool mShowLabelLegend =
false;
305 QHash<QString, QString> mTextOnSymbolContent;
Settings for a color ramp legend node.
Default legend implementation for mesh layers.
Default legend implementation for point cloud layers.
Default legend implementation for raster layers.
Default legend implementation for vector layers.
void setTextOnSymbolEnabled(bool enabled)
Sets whether the "text on symbol" functionality is enabled.
void setTextOnSymbolContent(const QHash< QString, QString > &content)
Sets per-symbol content of labels for "text on symbol" functionality.
void setShowLabelLegend(bool enabled)
Sets if a legend for the labeling should be shown.
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.
bool showLabelLegend() const
Returns whether the legend for the labeling is shown.
void setTextOnSymbolTextFormat(const QgsTextFormat &format)
Sets text format of symbol labels for "text on symbol" functionality.
QHash< QString, QString > textOnSymbolContent() const
Returns per-symbol content of labels for "text on symbol" functionality.
Layer tree node points to a map layer.
An abstract interface for legend items returned from QgsMapLayerLegend implementation.
Represents a patch shape for use in map legends.
Miscellaneous utility functions for handling of map layer legend.
An abstract interface for implementations of legends for one map layer.
virtual QList< QgsLayerTreeModelLegendNode * > createLayerTreeModelLegendNodes(QgsLayerTreeLayer *nodeLayer)=0
Returns list of legend nodes to be used for a particular layer tree layer node.
void itemsChanged()
Emitted when existing items/nodes got invalid and should be replaced by new ones.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Base class for plugin layers.
Represents a map layer supporting display of point clouds.
Represents a raster layer.
A container for the context for various read/write operations on objects.
Abstract base class for all rendered symbols.
Container for all settings relating to text rendering.
Represents a vector layer which manages a vector based dataset.