@@ -135,6 +135,14 @@ class QgsCategorizedSymbolRenderer : QgsFeatureRenderer
135135 public:
136136
137137 QgsCategorizedSymbolRenderer( const QString &attrName = QString(), const QgsCategoryList &categories = QgsCategoryList() );
138+ %Docstring
139+ Constructor for QgsCategorizedSymbolRenderer.
140+
141+ The ``attrName`` argument specifies the layer's field name, or expression, which the categories will be matched against.
142+
143+ A list of renderer ``categories`` can optionally be specified. If no categories are specified in the constructor, they
144+ can be added later by calling addCategory().
145+ %End
138146
139147 virtual QgsSymbol *symbolForFeature( const QgsFeature &feature, QgsRenderContext &context ) const;
140148
@@ -171,15 +179,18 @@ symbol for the renderer.
171179%End
172180
173181 const QgsCategoryList &categories() const;
182+ %Docstring
183+ Returns a list of all categories recognized by the renderer.
184+ %End
174185
175186 int categoryIndexForValue( const QVariant &val );
176187%Docstring
177- Returns index of category with specified value (-1 if not found)
188+ Returns the index for the category with the specified value (or -1 if not found).
178189%End
179190
180191 int categoryIndexForLabel( const QString &val );
181192%Docstring
182- Returns index of category with specified label (-1 if not found or not unique)
193+ Returns the index of the category with the specified label (or -1 if the label was not found, or is not unique).
183194
184195.. versionadded:: 2.5
185196%End
@@ -193,6 +204,8 @@ If ``value`` is a list, then the category will match any of the values from this
193204.. seealso:: :py:func:`updateCategorySymbol`
194205
195206.. seealso:: :py:func:`updateCategoryLabel`
207+
208+ .. seealso:: :py:func:`updateCategoryRenderState`
196209%End
197210
198211 bool updateCategorySymbol( int catIndex, QgsSymbol *symbol /Transfer/ );
@@ -204,6 +217,8 @@ Ownership of ``symbol`` is transferred to the renderer.
204217.. seealso:: :py:func:`updateCategoryValue`
205218
206219.. seealso:: :py:func:`updateCategoryLabel`
220+
221+ .. seealso:: :py:func:`updateCategoryRenderState`
207222%End
208223
209224 bool updateCategoryLabel( int catIndex, const QString &label );
@@ -216,32 +231,87 @@ legends and the layer tree.
216231.. seealso:: :py:func:`updateCategoryValue`
217232
218233.. seealso:: :py:func:`updateCategoryLabel`
234+
235+ .. seealso:: :py:func:`updateCategoryRenderState`
219236%End
220237
221238 bool updateCategoryRenderState( int catIndex, bool render );
222239%Docstring
240+ Changes the render state for the category with the specified index.
241+
242+ The render state indicates whether or not the category will be rendered,
243+ and is reflected in whether the category is checked with the project's layer tree.
244+
245+ .. seealso:: :py:func:`updateCategoryValue`
246+
247+ .. seealso:: :py:func:`updateCategorySymbol`
248+
249+ .. seealso:: :py:func:`updateCategoryLabel`
223250
224251.. versionadded:: 2.5
225252%End
226253
227254 void addCategory( const QgsRendererCategory &category );
255+ %Docstring
256+ Adds a new ``category`` to the renderer.
257+
258+ .. seealso:: :py:func:`categories`
259+ %End
260+
228261 bool deleteCategory( int catIndex );
262+ %Docstring
263+ Deletes the category with the specified index from the renderer.
264+
265+ .. seealso:: :py:func:`deleteAllCategories`
266+ %End
267+
229268 void deleteAllCategories();
269+ %Docstring
270+ Deletes all existing categories from the renderer.
271+
272+ .. seealso:: :py:func:`deleteCategory`
273+ %End
230274
231275 void moveCategory( int from, int to );
232276%Docstring
233- Moves the category at index position from to index position to.
277+ Moves an existing category at index position from to index position to.
234278%End
235279
236280 void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
281+ %Docstring
282+ Sorts the existing categories by their value.
283+
284+ .. seealso:: :py:func:`sortByLabel`
285+ %End
286+
237287 void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
288+ %Docstring
289+ Sorts the existing categories by their label.
290+
291+ .. seealso:: :py:func:`sortByValue`
292+ %End
238293
239294 QString classAttribute() const;
295+ %Docstring
296+ Returns the class attribute for the renderer, which is the field name
297+ or expression string from the layer which will be matched against the
298+ renderer categories.
299+
300+ .. seealso:: :py:func:`setClassAttribute`
301+ %End
302+
240303 void setClassAttribute( const QString &attr );
304+ %Docstring
305+ Sets the class attribute for the renderer, which is the field name
306+ or expression string from the layer which will be matched against the
307+ renderer categories.
308+
309+ .. seealso:: :py:func:`classAttribute`
310+ %End
241311
242312 static QgsFeatureRenderer *create( QDomElement &element, const QgsReadWriteContext &context ) /Factory/;
243313%Docstring
244- create renderer from XML element
314+ Creates a categorized renderer from an XML `` element``.
245315%End
246316
247317 virtual QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context );
0 commit comments