Class: QgsCategorizedSymbolRendererWidget

A widget for configuring a QgsCategorizedSymbolRenderer.

QgsCategorizedSymbolRendererWidget

QgsCategorizedSymbolRendererWidget

Class Hierarchy

Inheritance diagram of qgis.gui.QgsCategorizedSymbolRendererWidget

Base classes

QgsRendererWidget

Base class for renderer settings widgets.

QgsPanelWidget

Base class for any widget that can be shown as an inline panel.

QWidget

QObject

QPaintDevice

QgsExpressionContextGenerator

Abstract interface for generating an expression context.

Enums

CustomRole

Custom model roles.

CustomRoles

alias of CustomRole

Methods

addCategories

addCategory

applyChangeToSymbol

Applies current symbol to selected categories, or to all categories if none is selected

applyColorRamp

Applies the color ramp passed on by the color ramp button

categoriesDoubleClicked

categoryColumnChanged

changeCategorizedSymbol

changeCategorySymbol

changeSelectedSymbols

Changes the selected symbols alone for the change button, if there is a selection

currentCategoryRow

Returns row index for the currently selected category (-1 if on no selection)

deleteAllCategories

deleteCategories

deleteUnusedCategories

Deletes unused categories from the widget which are not used by the layer renderer.

layerUniqueValues

Returns the list of unique values in the current widget's layer for attribute name attrName.

matchToSymbols

Replaces category symbols with the symbols from a style that have a matching name.

matchToSymbolsFromLibrary

Replaces category symbols with the symbols from the users' symbol library that have a matching name.

matchToSymbolsFromXml

Prompts for selection of an xml file, then replaces category symbols with the symbols from the XML file with a matching name.

populateCategories

rowsMoved

selectedCategories

Returns a list of indexes for the categories under selection

selectedCategoryList

showSymbolLevels

updateUiFromRenderer

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 value

    Available as QgsCategorizedSymbolRendererWidget.ValueRole in older QGIS releases.

CustomRoles

alias of CustomRole

addCategories(self)[source]
addCategory(self)[source]
applyChangeToSymbol(self)[source]

Applies current symbol to selected categories, or to all categories if none is selected

applyColorRamp(self)[source]

Applies the color ramp passed on by the color ramp button

categoriesDoubleClicked(self, idx: QModelIndex)[source]
Parameters:

idx (QModelIndex)

categoryColumnChanged(self, field: str | None)[source]
Parameters:

field (Optional[str])

changeCategorizedSymbol(self)[source]
changeCategorySymbol(self)[source]
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

deleteAllCategories(self)[source]
deleteCategories(self)[source]
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() and deleteUnusedCategories()

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

matchToSymbolsFromLibrary(self)[source]

Replaces category symbols with the symbols from the users’ symbol library that have a matching name.

See also

matchToSymbols()

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

matchToSymbols()

populateCategories(self)[source]
rowsMoved(self)[source]
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]

showSymbolLevels(self)[source]
updateUiFromRenderer(self)[source]