Skip to content

Commit be47fd5

Browse files
committedJan 11, 2019
Dox++
(cherry picked from commit 74b96ce)
1 parent 53dbb02 commit be47fd5

File tree

2 files changed

+102
-9
lines changed

2 files changed

+102
-9
lines changed
 

‎python/core/auto_generated/symbology/qgscategorizedsymbolrenderer.sip.in

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class QgsRendererCategory
1313
{
1414
%Docstring
15-
categorized renderer
15+
Represents an individual category (class) from a QgsCategorizedSymbolRenderer.
1616
%End
1717

1818
%TypeHeaderCode
@@ -27,22 +27,62 @@ Constructor for QgsRendererCategory.
2727

2828
QgsRendererCategory( const QVariant &value, QgsSymbol *symbol /Transfer/, const QString &label, bool render = true );
2929
%Docstring
30-
takes ownership of symbol
30+
Constructor for a new QgsRendererCategory, with the specified ``value`` and ``symbol``.
31+
32+
The ownership of ``symbol`` is transferred to the category.
33+
34+
The ``label`` argument specifies the label used for this category in legends and the layer tree.
35+
36+
The ``render`` argument indicates whether the category should initially be rendered and appear checked in the layer tree.
3137
%End
3238

3339
QgsRendererCategory( const QgsRendererCategory &cat );
40+
41+
QVariant value() const;
3442
%Docstring
35-
copy constructor
36-
%End
43+
Returns the value corresponding to this category.
3744

45+
.. seealso:: :py:func:`setValue`
46+
%End
3847

39-
QVariant value() const;
4048
QgsSymbol *symbol() const;
49+
%Docstring
50+
Returns the symbol which will be used to render this category.
51+
52+
.. seealso:: :py:func:`setSymbol`
53+
%End
54+
4155
QString label() const;
56+
%Docstring
57+
Returns the label for this category, which is used to represent the category within
58+
legends and the layer tree.
59+
60+
.. seealso:: :py:func:`setLabel`
61+
%End
4262

4363
void setValue( const QVariant &value );
64+
%Docstring
65+
Sets the ``value`` corresponding to this category.
66+
67+
.. seealso:: :py:func:`value`
68+
%End
69+
4470
void setSymbol( QgsSymbol *s /Transfer/ );
71+
%Docstring
72+
Sets the symbol which will be used to render this category.
73+
74+
Ownership of the symbol is transferred to the category.
75+
76+
.. seealso:: :py:func:`symbol`
77+
%End
78+
4579
void setLabel( const QString &label );
80+
%Docstring
81+
Sets the ``label`` for this category, which is used to represent the category within
82+
legends and the layer tree.
83+
84+
.. seealso:: :py:func:`label`
85+
%End
4686

4787
bool renderState() const;
4888
%Docstring
@@ -62,9 +102,16 @@ Sets whether the category is currently enabled and should be rendered.
62102
.. versionadded:: 2.5
63103
%End
64104

105+
65106
QString dump() const;
107+
%Docstring
108+
Returns a string representing the categories settings, used for debugging purposes only.
109+
%End
66110

67111
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
112+
%Docstring
113+
Converts the category to a matching SLD rule, within the specified DOM document and ``element``.
114+
%End
68115

69116
protected:
70117

‎src/core/symbology/qgscategorizedsymbolrenderer.h

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class QgsStyle;
3030

3131
/**
3232
* \ingroup core
33-
* \brief categorized renderer
33+
* \brief Represents an individual category (class) from a QgsCategorizedSymbolRenderer.
3434
*/
3535
class CORE_EXPORT QgsRendererCategory
3636
{
@@ -41,20 +41,59 @@ class CORE_EXPORT QgsRendererCategory
4141
*/
4242
QgsRendererCategory() = default;
4343

44-
//! takes ownership of symbol
44+
/**
45+
* Constructor for a new QgsRendererCategory, with the specified \a value and \a symbol.
46+
*
47+
* The ownership of \a symbol is transferred to the category.
48+
*
49+
* The \a label argument specifies the label used for this category in legends and the layer tree.
50+
*
51+
* The \a render argument indicates whether the category should initially be rendered and appear checked in the layer tree.
52+
*/
4553
QgsRendererCategory( const QVariant &value, QgsSymbol *symbol SIP_TRANSFER, const QString &label, bool render = true );
4654

47-
//! copy constructor
4855
QgsRendererCategory( const QgsRendererCategory &cat );
49-
5056
QgsRendererCategory &operator=( QgsRendererCategory cat );
5157

58+
/**
59+
* Returns the value corresponding to this category.
60+
* \see setValue()
61+
*/
5262
QVariant value() const;
63+
64+
/**
65+
* Returns the symbol which will be used to render this category.
66+
* \see setSymbol()
67+
*/
5368
QgsSymbol *symbol() const;
69+
70+
/**
71+
* Returns the label for this category, which is used to represent the category within
72+
* legends and the layer tree.
73+
* \see setLabel()
74+
*/
5475
QString label() const;
5576

77+
/**
78+
* Sets the \a value corresponding to this category.
79+
* \see value()
80+
*/
5681
void setValue( const QVariant &value );
82+
83+
/**
84+
* Sets the symbol which will be used to render this category.
85+
*
86+
* Ownership of the symbol is transferred to the category.
87+
*
88+
* \see symbol()
89+
*/
5790
void setSymbol( QgsSymbol *s SIP_TRANSFER );
91+
92+
/**
93+
* Sets the \a label for this category, which is used to represent the category within
94+
* legends and the layer tree.
95+
* \see label()
96+
*/
5897
void setLabel( const QString &label );
5998

6099
/**
@@ -72,8 +111,15 @@ class CORE_EXPORT QgsRendererCategory
72111
void setRenderState( bool render );
73112

74113
// debugging
114+
115+
/**
116+
* Returns a string representing the categories settings, used for debugging purposes only.
117+
*/
75118
QString dump() const;
76119

120+
/**
121+
* Converts the category to a matching SLD rule, within the specified DOM document and \a element.
122+
*/
77123
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
78124

79125
protected:

0 commit comments

Comments
 (0)
Please sign in to comment.