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

The class stores information about one class/rule of a vector layer renderer in a unified way that can be used by legend model for rendering of legend. More...

#include <qgslegendsymbolitemv2.h>

Public Member Functions

 QgsLegendSymbolItemV2 ()
 QgsLegendSymbolItemV2 (QgsSymbolV2 *symbol, const QString &label, const QString &ruleKey, bool checkable=false, int scaleMinDenom=-1, int scaleMaxDenom=-1, int level=0, const QString &parentRuleKey=QString())
 Construct item.
 QgsLegendSymbolItemV2 (const QgsLegendSymbolItemV2 &other)
 ~QgsLegendSymbolItemV2 ()
bool isCheckable () const
 Return whether the item is user-checkable - whether renderer supports enabling/disabling it.
bool isScaleOK (double scale) const
 Determine whether given scale is within the scale range. Returns true if scale or scale range is invalid (value <= 0)
QString label () const
 Return text label.
QgsSymbolV2legacyRuleKey () const
 Used for older code that identifies legend entries from symbol pointer within renderer.
int level () const
 Identation level that tells how deep the item is in a hierarchy of items. For flat lists level is 0.
QgsLegendSymbolItemV2operator= (const QgsLegendSymbolItemV2 &other)
QString parentRuleKey () const
 Key of the parent legend node.
QString ruleKey () const
 Return unique identifier of the rule for identification of the item within renderer.
int scaleMaxDenom () const
 Max scale denominator of the scale range.
int scaleMinDenom () const
 Min scale denominator of the scale range.
QgsSymbolV2symbol () const
 Return associated symbol. May be null.

Protected Member Functions

void setSymbol (QgsSymbolV2 *s)
 Set symbol of the item. Takes ownership of symbol.

Detailed Description

The class stores information about one class/rule of a vector layer renderer in a unified way that can be used by legend model for rendering of legend.

See Also
QgsSymbolV2LegendNode
Note
added in 2.6

Definition at line 30 of file qgslegendsymbolitemv2.h.

Constructor & Destructor Documentation

QgsLegendSymbolItemV2::QgsLegendSymbolItemV2 ( )

Definition at line 20 of file qgslegendsymbolitemv2.cpp.

QgsLegendSymbolItemV2::QgsLegendSymbolItemV2 ( QgsSymbolV2 symbol,
const QString &  label,
const QString &  ruleKey,
bool  checkable = false,
int  scaleMinDenom = -1,
int  scaleMaxDenom = -1,
int  level = 0,
const QString &  parentRuleKey = QString() 
)

Construct item.

Does not take ownership of symbol (makes internal clone)

Note
parentRuleKey added in 2.8

Definition at line 30 of file qgslegendsymbolitemv2.cpp.

QgsLegendSymbolItemV2::~QgsLegendSymbolItemV2 ( )

Definition at line 50 of file qgslegendsymbolitemv2.cpp.

QgsLegendSymbolItemV2::QgsLegendSymbolItemV2 ( const QgsLegendSymbolItemV2 other)

Definition at line 43 of file qgslegendsymbolitemv2.cpp.

Member Function Documentation

bool QgsLegendSymbolItemV2::isCheckable ( ) const
inline

Return whether the item is user-checkable - whether renderer supports enabling/disabling it.

Definition at line 48 of file qgslegendsymbolitemv2.h.

bool QgsLegendSymbolItemV2::isScaleOK ( double  scale) const

Determine whether given scale is within the scale range. Returns true if scale or scale range is invalid (value <= 0)

Definition at line 73 of file qgslegendsymbolitemv2.cpp.

QString QgsLegendSymbolItemV2::label ( ) const
inline

Return text label.

Definition at line 44 of file qgslegendsymbolitemv2.h.

QgsSymbolV2* QgsLegendSymbolItemV2::legacyRuleKey ( ) const
inline

Used for older code that identifies legend entries from symbol pointer within renderer.

Definition at line 51 of file qgslegendsymbolitemv2.h.

int QgsLegendSymbolItemV2::level ( ) const
inline

Identation level that tells how deep the item is in a hierarchy of items. For flat lists level is 0.

Definition at line 63 of file qgslegendsymbolitemv2.h.

QgsLegendSymbolItemV2 & QgsLegendSymbolItemV2::operator= ( const QgsLegendSymbolItemV2 other)

Definition at line 55 of file qgslegendsymbolitemv2.cpp.

QString QgsLegendSymbolItemV2::parentRuleKey ( ) const
inline

Key of the parent legend node.

For legends with tree hierarchy

Note
added in 2.8

Definition at line 67 of file qgslegendsymbolitemv2.h.

QString QgsLegendSymbolItemV2::ruleKey ( ) const
inline

Return unique identifier of the rule for identification of the item within renderer.

Definition at line 46 of file qgslegendsymbolitemv2.h.

int QgsLegendSymbolItemV2::scaleMaxDenom ( ) const
inline

Max scale denominator of the scale range.

For range 1:1000 to 1:2000 this will return 2000. Value <= 0 means the range is unbounded on this side

Definition at line 60 of file qgslegendsymbolitemv2.h.

int QgsLegendSymbolItemV2::scaleMinDenom ( ) const
inline

Min scale denominator of the scale range.

For range 1:1000 to 1:2000 this will return 1000. Value <= 0 means the range is unbounded on this side

Definition at line 57 of file qgslegendsymbolitemv2.h.

void QgsLegendSymbolItemV2::setSymbol ( QgsSymbolV2 s)
protected

Set symbol of the item. Takes ownership of symbol.

Definition at line 86 of file qgslegendsymbolitemv2.cpp.

QgsSymbolV2* QgsLegendSymbolItemV2::symbol ( ) const
inline

Return associated symbol. May be null.

Definition at line 42 of file qgslegendsymbolitemv2.h.


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