Class: QgsCategorizedSymbolRendererWidget

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 a inline panel

QWidget

QObject

QPaintDevice

QgsExpressionContextGenerator

Abstract interface for generating an expression context.

class qgis.gui.QgsCategorizedSymbolRendererWidget(layer: QgsVectorLayer | None, style: QgsStyle | None, renderer: QgsFeatureRenderer | None)[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]
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]