QgsWmsLegendNode class
Implementation of legend node interface for displaying WMS legend entries.
Contents
Base classes
- class QgsLayerTreeModelLegendNode
- The QgsLegendRendererItem class is abstract interface for legend items returned from QgsMapLayerLegend implementation.
Constructors, destructors, conversion operators
- QgsWmsLegendNode(QgsLayerTreeLayer* nodeLayer, QObject* parent = nullptr)
- Constructor for QgsWmsLegendNode.
Public functions
- auto data(int role) const -> QVariant override
- Returns data associated with the item. Must be implemented in derived class.
- auto drawSymbol(const QgsLegendSettings& settings, ItemContext* ctx, double itemHeight) const -> QSizeF override
- Draws symbol on the left side of the item.
- void invalidateMapBasedData() override
- Notification from model that information from associated map view has changed.
Function documentation
QgsWmsLegendNode:: QgsWmsLegendNode(QgsLayerTreeLayer* nodeLayer,
QObject* parent = nullptr)
Constructor for QgsWmsLegendNode.
| Parameters | |
|---|---|
| nodeLayer | layer node |
| parent | attach a parent QObject to the legend node. |
QSizeF QgsWmsLegendNode:: drawSymbol(const QgsLegendSettings& settings,
ItemContext* ctx,
double itemHeight) const override
Draws symbol on the left side of the item.
| Parameters | |
|---|---|
| settings | Legend layout configuration |
| ctx | Context for rendering - may be null if only doing layout without actual rendering |
| itemHeight | Minimal height of the legend item - used for correct positioning when rendering |
| Returns | Real size of the symbol (may be bigger than "normal" symbol size from settings) |
void QgsWmsLegendNode:: invalidateMapBasedData() override
Notification from model that information from associated map view has changed.
Default implementation does nothing.