Class: QgsCategorizedSymbolRendererWidget¶
- class qgis.gui.QgsCategorizedSymbolRendererWidget(layer: QgsVectorLayer | None, style: QgsStyle | None, renderer: QgsFeatureRenderer | None)¶
Bases:
QgsRendererWidget
Enums
Bases:
enum.IntEnum
alias of
CustomRole
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
- param idx:
- param field:
Changes the selected symbols alone for the change button, if there is a selection
Change marker angles of selected symbols
Change color of selected symbols
Change opacity of selected symbols
Change marker sizes of selected symbols
Change units mm/map units of selected symbols
Change line widths of selected symbols
- param layer:
Creates widget to setup data-defined size legend.
- rtype:
QgsExpressionContext
Returns row index for the currently selected category (-1 if on no selection)
- param event:
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.
Registers a data defined override button.
- rtype:
Optional[QgsFeatureRenderer]
Returns a list of indexes for the categories under selection
- rtype:
List[QgsRendererCategory]
- rtype:
List[QgsSymbol]
- param context:
- param levels:
- class CustomRole(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
enum.IntEnum
Custom model roles.
Note
Prior to QGIS 3.36 this was available as QgsCategorizedSymbolRendererWidget.CustomRoles
Added in version 3.36.
ValueRole
: Category value
- baseClass¶
alias of
QgsCategorizedSymbolRendererWidget
- CustomRoles¶
alias of
CustomRole
- actionEvent(self, a0: QActionEvent | None)¶
- addCategories(self)¶
- addCategory(self)¶
- applyChangeToSymbol(self)¶
Applies current symbol to selected categories, or to all categories if none is selected
- applyColorRamp(self)¶
Applies the color ramp passed on by the color ramp button
- categoriesDoubleClicked(self, idx: QModelIndex)¶
- Parameters:
idx (QModelIndex)
- categoryColumnChanged(self, field: str | None)¶
- Parameters:
field (Optional[str])
- changeCategorizedSymbol(self)¶
- changeCategorySymbol(self)¶
- changeEvent(self, a0: QEvent | None)¶
- changeSelectedSymbols(self)¶
Changes the selected symbols alone for the change button, if there is a selection
- changeSymbolAngle(self)¶
Change marker angles of selected symbols
- changeSymbolColor(self)¶
Change color of selected symbols
- changeSymbolOpacity(self)¶
Change opacity of selected symbols
- changeSymbolSize(self)¶
Change marker sizes of selected symbols
- changeSymbolUnit(self)¶
Change units mm/map units of selected symbols
- changeSymbolWidth(self)¶
Change line widths of selected symbols
- childEvent(self, a0: QChildEvent | None)¶
- closeEvent(self, a0: QCloseEvent | None)¶
- connectNotify(self, signal: QMetaMethod)¶
- contextMenuEvent(self, a0: QContextMenuEvent | None)¶
- contextMenuViewCategories(self, p: QPoint)¶
- copy(self)¶
- create(layer: QgsVectorLayer | None, style: QgsStyle | None, renderer: QgsFeatureRenderer | None) QgsRendererWidget | None ¶
- Parameters:
layer (Optional[QgsVectorLayer])
style (Optional[QgsStyle])
renderer (Optional[QgsFeatureRenderer])
- Return type:
Optional[QgsRendererWidget]
- createDataDefinedSizeLegendWidget(self, symbol: QgsMarkerSymbol | None, ddsLegend: QgsDataDefinedSizeLegend | None) QgsDataDefinedSizeLegendWidget | None ¶
Creates widget to setup data-defined size legend. Returns newly created panel - may be
None
if it could not be opened. Ownership is transferred to the caller.
- createExpressionContext(self) QgsExpressionContext ¶
- Return type:
- currentCategoryRow(self) int ¶
Returns row index for the currently selected category (-1 if on no selection)
- Return type:
int
- customEvent(self, a0: QEvent | None)¶
- deleteAllCategories(self)¶
- deleteCategories(self)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, signal: QMetaMethod)¶
- dragEnterEvent(self, a0: QDragEnterEvent | None)¶
- dragLeaveEvent(self, a0: QDragLeaveEvent | None)¶
- dragMoveEvent(self, a0: QDragMoveEvent | None)¶
- dropEvent(self, a0: QDropEvent | None)¶
- enterEvent(self, a0: QEvent | None)¶
- event(self, a0: QEvent | None) bool ¶
- focusInEvent(self, a0: QFocusEvent | None)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, next: bool) bool ¶
- focusOutEvent(self, a0: QFocusEvent | None)¶
- focusPreviousChild(self) bool ¶
- hideEvent(self, a0: QHideEvent | None)¶
- initPainter(self, painter: QPainter | None)¶
- inputMethodEvent(self, a0: QInputMethodEvent | None)¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- keyPressEvent(self, event: QKeyEvent | None)¶
- Parameters:
event (Optional[QKeyEvent])
- keyReleaseEvent(self, a0: QKeyEvent | None)¶
- leaveEvent(self, a0: QEvent | None)¶
- matchToSymbols(self, style: QgsStyle | None) int ¶
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)¶
Replaces category symbols with the symbols from the users’ symbol library that have a matching name.
See also
See also
- matchToSymbolsFromXml(self)¶
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
- metric(self, a0: QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, a0: QMouseEvent | None)¶
- mouseMoveEvent(self, a0: QMouseEvent | None)¶
- mousePressEvent(self, a0: QMouseEvent | None)¶
- mouseReleaseEvent(self, a0: QMouseEvent | None)¶
- moveEvent(self, a0: QMoveEvent | None)¶
- nativeEvent(self, eventType: QByteArray | bytes | bytearray, message: PyQt5.sip.voidptr | None)¶
- paintEvent(self, a0: QPaintEvent | None)¶
- paste(self)¶
- pasteSymbolToSelection(self)¶
- populateCategories(self)¶
- receivers(self, signal: PYQT_SIGNAL) int ¶
- refreshSymbolView(self)¶
- registerDataDefinedButton(self, button: QgsPropertyOverrideButton | None, key: QgsFeatureRenderer.Property)¶
Registers a data defined override button. Handles setting up connections for the button and initializing the button to show the correct descriptions and help text for the associated property.
- renderer(self) QgsFeatureRenderer | None ¶
- Return type:
Optional[QgsFeatureRenderer]
- resizeEvent(self, a0: QResizeEvent | None)¶
- rowsMoved(self)¶
- selectedCategories(self) List[int] ¶
Returns a list of indexes for the categories under selection
- Return type:
List[int]
- selectedCategoryList(self) List[QgsRendererCategory] ¶
- Return type:
List[QgsRendererCategory]
- sender(self) QObject | None ¶
- senderSignalIndex(self) int ¶
- setContext(self, context: QgsSymbolWidgetContext)¶
- Parameters:
context (QgsSymbolWidgetContext)
- setSymbolLevels(self, levels: Iterable[QgsLegendSymbolItem], enabled: bool)¶
- Parameters:
levels (Iterable[QgsLegendSymbolItem])
enabled (bool)
- showEvent(self, a0: QShowEvent | None)¶
- showSymbolLevels(self)¶
- tabletEvent(self, a0: QTabletEvent | None)¶
- timerEvent(self, a0: QTimerEvent | None)¶
- updateMicroFocus(self)¶
- updateUiFromRenderer(self)¶
- wheelEvent(self, a0: QWheelEvent | None)¶