@@ -9,33 +9,43 @@ class QgsSymbolV2;
9
9
* The class stores information about one class/rule of a vector layer renderer in a unified way
10
10
* that can be used by legend model for rendering of legend.
11
11
*
12
+ * @see QgsSymbolV2LegendNode
12
13
* @note added in 2.6
13
14
*/
14
15
class CORE_EXPORT QgsLegendSymbolItemV2
15
16
{
16
17
public:
17
18
QgsLegendSymbolItemV2 ();
18
- // ! construct item, does not take ownership of symbol (makes internal clone)
19
+ // ! Construct item. Does not take ownership of symbol (makes internal clone)
19
20
QgsLegendSymbolItemV2 ( QgsSymbolV2* symbol, const QString& label, const QString& ruleKey, bool checkable = false , int scaleMinDenom = -1 , int scaleMaxDenom = -1 );
20
21
~QgsLegendSymbolItemV2 ();
21
22
QgsLegendSymbolItemV2 ( const QgsLegendSymbolItemV2& other );
22
23
QgsLegendSymbolItemV2& operator =( const QgsLegendSymbolItemV2& other );
23
24
25
+ // ! Return associated symbol. May be null.
24
26
QgsSymbolV2* symbol () const { return mSymbol ; }
27
+ // ! Return text label
25
28
QString label () const { return mLabel ; }
29
+ // ! Return unique identifier of the rule for identification of the item within renderer
26
30
QString ruleKey () const { return mKey ; }
31
+ // ! Return whether the item is user-checkable - whether renderer supports enabling/disabling it
27
32
bool isCheckable () const { return mCheckable ; }
28
33
29
- // ! used for older code that identifies legend entries from symbol pointer within renderer
34
+ // ! Used for older code that identifies legend entries from symbol pointer within renderer
30
35
QgsSymbolV2* legacyRuleKey () const { return mOriginalSymbolPointer ; }
31
36
37
+ // ! Determine whether given scale is within the scale range. Returns true if scale or scale range is invalid (value <= 0)
32
38
bool isScaleOK ( double scale ) const ;
39
+ // ! Min scale denominator of the scale range. For range 1:1000 to 1:2000 this will return 1000.
40
+ // ! Value <= 0 means the range is unbounded on this side
33
41
int scaleMinDenom () const { return mScaleMinDenom ; }
42
+ // ! Max scale denominator of the scale range. For range 1:1000 to 1:2000 this will return 2000.
43
+ // ! Value <= 0 means the range is unbounded on this side
34
44
int scaleMaxDenom () const { return mScaleMaxDenom ; }
35
45
36
- // ! takes ownership of symbol
46
+ protected:
47
+ // ! Set symbol of the item. Takes ownership of symbol.
37
48
void setSymbol ( QgsSymbolV2* s );
38
- void setLabel ( const QString& label ) { mLabel = label; }
39
49
40
50
private:
41
51
// ! symbol. owned by the struct. can be null.
0 commit comments