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
QgsSymbolV2LegendNode Class Reference

Implementation of legend node interface for displaying preview of vector symbols and their labels and allowing interaction with the symbol / renderer. More...

#include <qgslayertreemodellegendnode.h>

Inheritance diagram for QgsSymbolV2LegendNode:
Inheritance graph
[legend]

Public Member Functions

 QgsSymbolV2LegendNode (QgsLayerTreeLayer *nodeLayer, const QgsLegendSymbolItemV2 &item, QObject *parent=0)
 ~QgsSymbolV2LegendNode ()
virtual QVariant data (int role) const override
 Return data associated with the item.
QSizeF drawSymbol (const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight) const override
 Draws symbol on the left side of the item.
virtual Qt::ItemFlags flags () const override
 Return item flags associated with the item.
virtual void invalidateMapBasedData () override
 Notification from model that information from associated map view has changed.
virtual bool isScaleOK (double scale) const override
virtual bool setData (const QVariant &value, int role) override
 Set some data associated with the item.
virtual void setEmbeddedInParent (bool embedded) override
void setUserLabel (const QString &userLabel) override
- 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 drawSymbolText (const QgsLegendSettings &settings, ItemContext *ctx, const QSizeF &symbolSize) const
 Draws label on the right side of the item.
virtual bool isEmbeddedInParent () const
QgsLayerTreeLayerlayerNode () const
 Return pointer to the parent layer node.
QgsLayerTreeModelmodel () const
 Return pointer to model owning this legend node.
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 preview of vector symbols and their labels and allowing interaction with the symbol / renderer.

Note
added in 2.6

Definition at line 145 of file qgslayertreemodellegendnode.h.

Constructor & Destructor Documentation

QgsSymbolV2LegendNode::QgsSymbolV2LegendNode ( QgsLayerTreeLayer nodeLayer,
const QgsLegendSymbolItemV2 item,
QObject *  parent = 0 
)

Definition at line 134 of file qgslayertreemodellegendnode.cpp.

QgsSymbolV2LegendNode::~QgsSymbolV2LegendNode ( )

Definition at line 145 of file qgslayertreemodellegendnode.cpp.

Member Function Documentation

QVariant QgsSymbolV2LegendNode::data ( int  role) const
overridevirtual

Return data associated with the item.

Must be implemented in derived class.

Implements QgsLayerTreeModelLegendNode.

Definition at line 158 of file qgslayertreemodellegendnode.cpp.

QSizeF QgsSymbolV2LegendNode::drawSymbol ( const QgsLegendSettings settings,
ItemContext ctx,
double  itemHeight 
) const
overridevirtual

Draws symbol on the left side of the item.

Parameters
settingsLegend layout configuration
ctxContext for rendering - may be null if only doing layout without actual rendering
itemHeightMinimal 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)

Reimplemented from QgsLayerTreeModelLegendNode.

Definition at line 263 of file qgslayertreemodellegendnode.cpp.

Qt::ItemFlags QgsSymbolV2LegendNode::flags ( ) const
overridevirtual

Return item flags associated with the item.

Default implementation returns Qt::ItemIsEnabled.

Reimplemented from QgsLayerTreeModelLegendNode.

Definition at line 149 of file qgslayertreemodellegendnode.cpp.

void QgsSymbolV2LegendNode::invalidateMapBasedData ( )
overridevirtual

Notification from model that information from associated map view has changed.

Default implementation does nothing.

Reimplemented from QgsLayerTreeModelLegendNode.

Definition at line 357 of file qgslayertreemodellegendnode.cpp.

virtual bool QgsSymbolV2LegendNode::isScaleOK ( double  scale) const
inlineoverridevirtual

Reimplemented from QgsLayerTreeModelLegendNode.

Definition at line 161 of file qgslayertreemodellegendnode.h.

bool QgsSymbolV2LegendNode::setData ( const QVariant &  value,
int  role 
)
overridevirtual

Set some data associated with the item.

Default implementation does nothing and returns false.

Reimplemented from QgsLayerTreeModelLegendNode.

Definition at line 240 of file qgslayertreemodellegendnode.cpp.

void QgsSymbolV2LegendNode::setEmbeddedInParent ( bool  embedded)
overridevirtual

Reimplemented from QgsLayerTreeModelLegendNode.

Definition at line 350 of file qgslayertreemodellegendnode.cpp.

void QgsSymbolV2LegendNode::setUserLabel ( const QString &  userLabel)
inlineoverridevirtual

Reimplemented from QgsLayerTreeModelLegendNode.

Definition at line 159 of file qgslayertreemodellegendnode.h.


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