QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
|
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. More... | |
QgsLegendSymbolItemV2 (const QgsLegendSymbolItemV2 &other) | |
~QgsLegendSymbolItemV2 () | |
bool | isCheckable () const |
Return whether the item is user-checkable - whether renderer supports enabling/disabling it. More... | |
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) More... | |
QString | label () const |
Return text label. More... | |
QgsSymbolV2 * | legacyRuleKey () const |
Used for older code that identifies legend entries from symbol pointer within renderer. More... | |
int | level () const |
Identation level that tells how deep the item is in a hierarchy of items. For flat lists level is 0. More... | |
QgsLegendSymbolItemV2 & | operator= (const QgsLegendSymbolItemV2 &other) |
QString | parentRuleKey () const |
Key of the parent legend node. More... | |
QString | ruleKey () const |
Return unique identifier of the rule for identification of the item within renderer. More... | |
int | scaleMaxDenom () const |
Max scale denominator of the scale range. More... | |
int | scaleMinDenom () const |
Min scale denominator of the scale range. More... | |
void | setSymbol (QgsSymbolV2 *s) |
Set symbol of the item. Takes ownership of symbol. More... | |
QgsSymbolV2 * | symbol () const |
Return associated symbol. May be null. More... | |
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.
Definition at line 30 of file qgslegendsymbolitemv2.h.
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)
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.
|
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.
|
inline |
Return text label.
Definition at line 44 of file qgslegendsymbolitemv2.h.
|
inline |
Used for older code that identifies legend entries from symbol pointer within renderer.
Definition at line 51 of file qgslegendsymbolitemv2.h.
|
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.
|
inline |
Key of the parent legend node.
For legends with tree hierarchy
Definition at line 67 of file qgslegendsymbolitemv2.h.
|
inline |
Return unique identifier of the rule for identification of the item within renderer.
Definition at line 46 of file qgslegendsymbolitemv2.h.
|
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.
|
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 | ) |
Set symbol of the item. Takes ownership of symbol.
Definition at line 86 of file qgslegendsymbolitemv2.cpp.
|
inline |
Return associated symbol. May be null.
Definition at line 42 of file qgslegendsymbolitemv2.h.