QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | List of all members
QgsSimpleLegendNode Class Reference

Implementation of legend node interface for displaying arbitrary label with icon. More...

#include <qgslayertreemodellegendnode.h>

Inheritance diagram for QgsSimpleLegendNode:
Inheritance graph
[legend]

Public Member Functions

 QgsSimpleLegendNode (QgsLayerTreeLayer *nodeLayer, const QString &label, const QIcon &icon=QIcon(), QObject *parent=0)
virtual QVariant data (int role) const override
 Return data associated with the item.
- Public Member Functions inherited from QgsLayerTreeModelLegendNode
 ~QgsLayerTreeModelLegendNode ()
virtual ItemMetrics draw (const QgsLegendSettings &settings, ItemContext *ctx)
 Entry point called from QgsLegendRenderer to do the rendering.
virtual QSizeF drawSymbol (const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight) const
 Draws symbol on the left side of the item.
virtual QSizeF drawSymbolText (const QgsLegendSettings &settings, ItemContext *ctx, const QSizeF &symbolSize) const
 Draws label on the right side of the item.
virtual Qt::ItemFlags flags () const
 Return item flags associated with the item.
virtual void invalidateMapBasedData ()
 Notification from model that information from associated map view has changed.
virtual bool isEmbeddedInParent () const
virtual bool isScaleOK (double scale) const
QgsLayerTreeLayerlayerNode () const
 Return pointer to the parent layer node.
QgsLayerTreeModelmodel () const
 Return pointer to model owning this legend node.
virtual bool setData (const QVariant &value, int role)
 Set some data associated with the item.
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, SymbolV2LegacyRuleKeyRole, ParentRuleKeyRole }
- Signals inherited from QgsLayerTreeModelLegendNode
void dataChanged ()
 Emitted on internal data change so the layer tree model can forward the signal to views.
- Protected Member Functions inherited from QgsLayerTreeModelLegendNode
 QgsLayerTreeModelLegendNode (QgsLayerTreeLayer *nodeL, QObject *parent=0)
 Construct the node with pointer to its parent layer node.
- Protected Attributes inherited from QgsLayerTreeModelLegendNode
bool mEmbeddedInParent
QgsLayerTreeLayermLayerNode
QString mUserLabel

Detailed Description

Implementation of legend node interface for displaying arbitrary label with icon.

Note
added in 2.6

Definition at line 181 of file qgslayertreemodellegendnode.h.

Constructor & Destructor Documentation

QgsSimpleLegendNode::QgsSimpleLegendNode ( QgsLayerTreeLayer nodeLayer,
const QString &  label,
const QIcon &  icon = QIcon(),
QObject *  parent = 0 
)

Definition at line 395 of file qgslayertreemodellegendnode.cpp.

Member Function Documentation

QVariant QgsSimpleLegendNode::data ( int  role) const
overridevirtual

Return data associated with the item.

Must be implemented in derived class.

Implements QgsLayerTreeModelLegendNode.

Definition at line 402 of file qgslayertreemodellegendnode.cpp.


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