Class: QgsRendererWidget¶
Base class for renderer settings widgets.
WORKFLOW:
open renderer dialog with some RENDERER (never null!)
find out which widget to use
instantiate it and set in stacked widget
on any change of renderer type, create some default (dummy?) version and change the stacked widget
when clicked OK/Apply, get the renderer from active widget and clone it for the layer
Class Hierarchy¶
Base classes¶
Base class for any widget that can be shown as a inline panel |
|
Abstract interface for generating an expression context. |
Subclasses¶
|
|
A widget used represent options of a |
|
|
|
A widget used represent options of a |
|
A widget used represent options of a |
|
Blank widget for customizing |
|
A widget which allows configuration of the properties for a |
|
Methods
This method should be called whenever the renderer is actually set on the layer. |
|
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 |
|
Returns the context in which the renderer widget is shown, e.g., the associated map canvas and expression contexts. |
|
Creates widget to setup data-defined size legend. |
|
Pastes the clipboard symbol over selected items. |
|
Registers a data defined override button. |
|
Returns pointer to the renderer (no transfer of ownership) |
|
Subclasses may provide the capability of changing multiple symbols at once by implementing the following two methods and by connecting the slot contextMenuViewCategories(const QPoint&). |
|
Sets the context in which the renderer widget is shown, e.g., the associated map canvas and expression contexts. |
|
Sets the symbol levels for the renderer defined in the widget. |
|
Show a dialog with renderer's symbol level settings. |
|
Returns the vector layer associated with the widget. |
Signals
Emitted when expression context variables on the associated vector layers have been changed. |
|
Emitted when the symbol levels settings have been changed. |
- class qgis.gui.QgsRendererWidget[source]¶
Bases:
QgsPanelWidget
,QgsExpressionContextGenerator
- applyChanges(self)[source]¶
This method should be called whenever the renderer is actually set on the layer.
- context(self) QgsSymbolWidgetContext [source]¶
Returns the context in which the renderer widget is shown, e.g., the associated map canvas and expression contexts.
See also
- Return type:
- createDataDefinedSizeLegendWidget(self, symbol: QgsMarkerSymbol | None, ddsLegend: QgsDataDefinedSizeLegend | None) QgsDataDefinedSizeLegendWidget | None [source]¶
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.- Parameters:
symbol (Optional[QgsMarkerSymbol])
ddsLegend (Optional[QgsDataDefinedSizeLegend])
- Return type:
Optional[QgsDataDefinedSizeLegendWidget]
- signal layerVariablesChanged[source]¶
Emitted when expression context variables on the associated vector layers have been changed. Will request the parent dialog to re-synchronize with the variables.
- pasteSymbolToSelection(self)[source]¶
Pastes the clipboard symbol over selected items.
Added in version 3.10.
- registerDataDefinedButton(self, button: QgsPropertyOverrideButton | None, key: QgsFeatureRenderer.Property)[source]¶
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.
- Parameters:
button (Optional[QgsPropertyOverrideButton])
- renderer(self) QgsFeatureRenderer | None [source]¶
Returns pointer to the renderer (no transfer of ownership)
- Return type:
Optional[QgsFeatureRenderer]
- selectedSymbols(self) List[QgsSymbol] ¶
Subclasses may provide the capability of changing multiple symbols at once by implementing the following two methods and by connecting the slot contextMenuViewCategories(const QPoint&).
- Return type:
List[QgsSymbol]
- setContext(self, context: QgsSymbolWidgetContext)[source]¶
Sets the context in which the renderer widget is shown, e.g., the associated map canvas and expression contexts.
- Parameters:
context (QgsSymbolWidgetContext) – symbol widget context
See also
- setSymbolLevels(self, levels: Iterable[QgsLegendSymbolItem], enabled: bool)[source]¶
Sets the symbol levels for the renderer defined in the widget.
The
levels
argument defines the updated list of symbols with rendering passes set.The
enabled
arguments specifies if symbol levels should be enabled for the renderer.Added in version 3.20.
- Parameters:
levels (Iterable[QgsLegendSymbolItem])
enabled (bool)
- showSymbolLevelsDialog(self, r: QgsFeatureRenderer | None)[source]¶
Show a dialog with renderer’s symbol level settings.
- Parameters:
r (Optional[QgsFeatureRenderer])
- signal symbolLevelsChanged[source]¶
Emitted when the symbol levels settings have been changed.
Deprecated since version 3.20: No longer emitted.
- vectorLayer(self) QgsVectorLayer | None [source]¶
Returns the vector layer associated with the widget.
- Return type:
Optional[QgsVectorLayer]