Class: QgsCategorizedSymbolRendererWidget¶
A widget for configuring a QgsCategorizedSymbolRenderer
.

QgsCategorizedSymbolRendererWidget¶
Class Hierarchy¶
Base classes¶
Base class for renderer settings widgets. |
|
Base class for any widget that can be shown as an inline panel. |
|
Abstract interface for generating an expression context. |
Enums
Custom model roles. |
|
alias of |
Methods
Applies current symbol to selected categories, or to all categories if none is selected |
|
Applies the color ramp passed on by the color ramp button |
|
Changes the selected symbols alone for the change button, if there is a selection |
|
Returns row index for the currently selected category (-1 if on no selection) |
|
Deletes unused categories from the widget which are not used by the layer renderer. |
|
Returns the list of unique values in the current widget's layer for attribute name attrName. |
|
Replaces category symbols with the symbols from a style that have a matching name. |
|
Replaces category symbols with the symbols from the users' symbol library that have a matching name. |
|
Prompts for selection of an xml file, then replaces category symbols with the symbols from the XML file with a matching name. |
|
Returns a list of indexes for the categories under selection |
|
- class qgis.gui.QgsCategorizedSymbolRendererWidget[source]¶
Bases:
QgsRendererWidget
- class CustomRole(*values)¶
Bases:
IntEnum
Custom model roles.
Note
Prior to QGIS 3.36 this was available as QgsCategorizedSymbolRendererWidget.CustomRoles
Added in version 3.36.
Value
: Category valueAvailable as
QgsCategorizedSymbolRendererWidget.ValueRole
in older QGIS releases.
- CustomRoles¶
alias of
CustomRole
- applyChangeToSymbol(self)[source]¶
Applies current symbol to selected categories, or to all categories if none is selected
- changeSelectedSymbols(self)[source]¶
Changes the selected symbols alone for the change button, if there is a selection
- currentCategoryRow(self) int [source]¶
Returns row index for the currently selected category (-1 if on no selection)
- Return type:
int
- deleteUnusedCategories(self)[source]¶
Deletes unused categories from the widget which are not used by the layer renderer.
- layerUniqueValues(self, attrName: str | None) List[Any] ¶
Returns the list of unique values in the current widget’s layer for attribute name
attrName
.Called by
addCategories()
anddeleteUnusedCategories()
- Parameters:
attrName (Optional[str])
- Return type:
List[Any]
- matchToSymbols(self, style: QgsStyle | None) int [source]¶
Replaces category symbols with the symbols from a style that have a matching name.
- Parameters:
style (Optional[QgsStyle]) – style containing symbols to match with
- Return type:
int
- Returns:
number of symbols matched
See also
See also
- matchToSymbolsFromLibrary(self)[source]¶
Replaces category symbols with the symbols from the users’ symbol library that have a matching name.
See also
See also
- matchToSymbolsFromXml(self)[source]¶
Prompts for selection of an xml file, then replaces category symbols with the symbols from the XML file with a matching name.
See also
See also
- selectedCategories(self) List[int] ¶
Returns a list of indexes for the categories under selection
- Return type:
List[int]
- selectedCategoryList(self) List[QgsRendererCategory] [source]¶
- Return type:
List[QgsRendererCategory]