Subgroup: Legend
Class: QgsLegendSymbolItem¶
-
class
qgis.core.
QgsLegendSymbolItem
¶ Bases:
sip.wrapper
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
New in version 2.6: Methods
dataDefinedSizeLegendSettings
Returns extra information for data-defined size legend rendering. isCheckable
Return whether the item is user-checkable - whether renderer supports enabling/disabling it isScaleOK
Determine whether given scale is within the scale range. label
Return text label legacyRuleKey
Used for older code that identifies legend entries from symbol pointer within renderer level
Indentation level that tells how deep the item is in a hierarchy of items. parentRuleKey
Key of the parent legend node. ruleKey
Return unique identifier of the rule for identification of the item within renderer scaleMaxDenom
Max scale denominator of the scale range. scaleMinDenom
Min scale denominator of the scale range. setDataDefinedSizeLegendSettings
Sets extra information about data-defined size. setSymbol
Set symbol of the item. symbol
Return associated symbol. Attributes
-
dataDefinedSizeLegendSettings
(self) → QgsDataDefinedSizeLegend¶ Returns extra information for data-defined size legend rendering. Normally it returns null.
New in version 3.0.
-
isCheckable
(self) → bool¶ Return whether the item is user-checkable - whether renderer supports enabling/disabling it
-
isScaleOK
(self, scale: float) → bool¶ Determine whether given scale is within the scale range. Returns true if scale or scale range is invalid (value <= 0)
-
label
(self) → str¶ Return text label
-
legacyRuleKey
(self) → QgsSymbol¶ Used for older code that identifies legend entries from symbol pointer within renderer
-
level
(self) → int¶ Indentation level that tells how deep the item is in a hierarchy of items. For flat lists level is 0
-
parentRuleKey
(self) → str¶ Key of the parent legend node. For legends with tree hierarchy
Note
Parameter parentRuleKey added in QGIS 2.8
-
ruleKey
(self) → str¶ Return unique identifier of the rule for identification of the item within renderer
-
scaleMaxDenom
(self) → int¶ 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
-
scaleMinDenom
(self) → int¶ 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
-
setDataDefinedSizeLegendSettings
(self, settings: QgsDataDefinedSizeLegend)¶ Sets extra information about data-defined size. If set, this item should be converted to
QgsDataDefinedSizeLegendNode
rather than QgsSymbolLegendNode instance as usual. Passing null removes any data-defined size legend settings.Takes ownership of the settings object.
New in version 3.0.
-
setSymbol
(self, s: QgsSymbol)¶ Set symbol of the item. Takes ownership of symbol.
-
symbol
(self) → QgsSymbol¶ Return associated symbol. May be null.
-