QgsDataDefinedSizeLegendNode class

Produces legend node with a marker symbol.

Base classes

class QgsLayerTreeModelLegendNode
The QgsLegendRendererItem class is abstract interface for legend items returned from QgsMapLayerLegend implementation.

Constructors, destructors, conversion operators

QgsDataDefinedSizeLegendNode(QgsLayerTreeLayer* nodeLayer, const QgsDataDefinedSizeLegend& settings, QObject* parent = nullptr)
Construct the node using QgsDataDefinedSizeLegend as definition of the node's appearance.

Public functions

auto data(int role) const -> QVariant override
Returns data associated with the item. Must be implemented in derived class.
auto draw(const QgsLegendSettings& settings, ItemContext* ctx) -> ItemMetrics override
Entry point called from QgsLegendRenderer to do the rendering.

Function documentation

ItemMetrics QgsDataDefinedSizeLegendNode::draw(const QgsLegendSettings& settings, ItemContext* ctx) override

Entry point called from QgsLegendRenderer to do the rendering.

Default implementation calls drawSymbol() and drawSymbolText() methods.

If ctx is null, this is just first stage when preparing layout - without actual rendering.