QGIS API Documentation  3.6.0-Noosa (5873452)
Public Member Functions | List of all members
QgsDataDefinedSizeLegendNode Class Reference

Produces legend node with a marker symbol. More...

#include <qgslayertreemodellegendnode.h>

Inheritance diagram for QgsDataDefinedSizeLegendNode:
Inheritance graph
[legend]

Public Member Functions

 QgsDataDefinedSizeLegendNode (QgsLayerTreeLayer *nodeLayer, const QgsDataDefinedSizeLegend &settings, QObject *parent=nullptr)
 Construct the node using QgsDataDefinedSizeLegend as definition of the node's appearance. More...
 
 ~QgsDataDefinedSizeLegendNode () override
 
QVariant data (int role) const override
 Returns data associated with the item. Must be implemented in derived class. More...
 
ItemMetrics draw (const QgsLegendSettings &settings, ItemContext *ctx) override
 Entry point called from QgsLegendRenderer to do the rendering. More...
 
- Public Member Functions inherited from QgsLayerTreeModelLegendNode
virtual QSizeF drawSymbol (const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight) const
 Draws symbol on the left side of the item. More...
 
virtual QSizeF drawSymbolText (const QgsLegendSettings &settings, ItemContext *ctx, QSizeF symbolSize) const
 Draws label on the right side of the item. More...
 
virtual Qt::ItemFlags flags () const
 Returns item flags associated with the item. Default implementation returns Qt::ItemIsEnabled. More...
 
virtual void invalidateMapBasedData ()
 Notification from model that information from associated map view has changed. More...
 
virtual bool isEmbeddedInParent () const
 
virtual bool isScaleOK (double scale) const
 
QgsLayerTreeLayerlayerNode () const
 Returns pointer to the parent layer node. More...
 
QgsLayerTreeModelmodel () const
 Returns pointer to model owning this legend node. More...
 
virtual bool setData (const QVariant &value, int role)
 Sets some data associated with the item. Default implementation does nothing and returns false. More...
 
virtual void setEmbeddedInParent (bool embedded)
 
virtual void setUserLabel (const QString &userLabel)
 
virtual QString userLabel () const
 

Additional Inherited Members

- Public Types inherited from QgsLayerTreeModelLegendNode
enum  LegendNodeRoles { RuleKeyRole = Qt::UserRole, ParentRuleKeyRole }
 
- Signals inherited from QgsLayerTreeModelLegendNode
void dataChanged ()
 Emitted on internal data change so the layer tree model can forward the signal to views. More...
 
- Protected Member Functions inherited from QgsLayerTreeModelLegendNode
 QgsLayerTreeModelLegendNode (QgsLayerTreeLayer *nodeL, QObject *parent=nullptr)
 Construct the node with pointer to its parent layer node. More...
 
QgsRenderContextcreateTemporaryRenderContext () const
 Returns a temporary context or null if legendMapViewData are not valid. More...
 
- Protected Attributes inherited from QgsLayerTreeModelLegendNode
bool mEmbeddedInParent
 
QgsLayerTreeLayermLayerNode = nullptr
 
QString mUserLabel
 

Detailed Description

Produces legend node with a marker symbol.

Since
QGIS 3.0

Definition at line 444 of file qgslayertreemodellegendnode.h.

Constructor & Destructor Documentation

◆ QgsDataDefinedSizeLegendNode()

QgsDataDefinedSizeLegendNode::QgsDataDefinedSizeLegendNode ( QgsLayerTreeLayer nodeLayer,
const QgsDataDefinedSizeLegend settings,
QObject *  parent = nullptr 
)

Construct the node using QgsDataDefinedSizeLegend as definition of the node's appearance.

Definition at line 798 of file qgslayertreemodellegendnode.cpp.

◆ ~QgsDataDefinedSizeLegendNode()

QgsDataDefinedSizeLegendNode::~QgsDataDefinedSizeLegendNode ( )
override

Definition at line 804 of file qgslayertreemodellegendnode.cpp.

Member Function Documentation

◆ data()

QVariant QgsDataDefinedSizeLegendNode::data ( int  role) const
overridevirtual

Returns data associated with the item. Must be implemented in derived class.

Implements QgsLayerTreeModelLegendNode.

Definition at line 809 of file qgslayertreemodellegendnode.cpp.

◆ draw()

QgsLayerTreeModelLegendNode::ItemMetrics QgsDataDefinedSizeLegendNode::draw ( const QgsLegendSettings settings,
QgsLayerTreeModelLegendNode::ItemContext ctx 
)
overridevirtual

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.

Reimplemented from QgsLayerTreeModelLegendNode.

Definition at line 824 of file qgslayertreemodellegendnode.cpp.


The documentation for this class was generated from the following files: