QGIS API Documentation  2.6.0-Brighton
 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)
 Construct item. Does not take ownership of symbol (makes internal clone)
 ~QgsLegendSymbolItemV2 ()
 QgsLegendSymbolItemV2 (const QgsLegendSymbolItemV2 &other)
QgsLegendSymbolItemV2operator= (const QgsLegendSymbolItemV2 &other)
QgsSymbolV2symbol () const
 Return associated symbol. May be null.
QString label () const
 Return text label.
QString ruleKey () const
 Return unique identifier of the rule for identification of the item within renderer.
bool isCheckable () const
 Return whether the item is user-checkable - whether renderer supports enabling/disabling it.
QgsSymbolV2legacyRuleKey () const
 Used for older code that identifies legend entries from symbol pointer within renderer.
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)
int scaleMinDenom () const
 Min scale denominator of the scale range.
int scaleMaxDenom () const
 Max scale denominator of the scale range.
int level () const
 Identation level that tells how deep the item is in a hierarchy of items. For flat lists level is 0.

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

Constructor & Destructor Documentation

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

Construct item. Does not take ownership of symbol (makes internal clone)

QgsLegendSymbolItemV2::~QgsLegendSymbolItemV2 ( )
QgsLegendSymbolItemV2::QgsLegendSymbolItemV2 ( const QgsLegendSymbolItemV2 other)

Member Function Documentation

bool QgsLegendSymbolItemV2::isCheckable ( ) const
inline

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

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)

QString QgsLegendSymbolItemV2::label ( ) const
inline

Return text label.

QgsSymbolV2* QgsLegendSymbolItemV2::legacyRuleKey ( ) const
inline

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

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.

QgsLegendSymbolItemV2 & QgsLegendSymbolItemV2::operator= ( const QgsLegendSymbolItemV2 other)
QString QgsLegendSymbolItemV2::ruleKey ( ) const
inline

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

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

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

void QgsLegendSymbolItemV2::setSymbol ( QgsSymbolV2 s)
protected

Set symbol of the item. Takes ownership of symbol.

QgsSymbolV2* QgsLegendSymbolItemV2::symbol ( ) const
inline

Return associated symbol. May be null.


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