Class: QgsSymbolSelectorWidget

Symbol selector widget that can be used to select and build a symbol.

QgsSymbolSelectorWidget

QgsSymbolSelectorWidget

Class Hierarchy

Inheritance diagram of qgis.gui.QgsSymbolSelectorWidget

Base classes

QgsPanelWidget

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

QWidget

QObject

QPaintDevice

Methods

addLayer

Add a symbol layer to the bottom of the stack.

advancedMenu

Returns menu for "advanced" button - create it if doesn't exist and show the advanced button

changeLayer

Alters tree and sets proper widget when Layer Type is changed

context

Returns the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.

duplicateLayer

Duplicates the current symbol layer and places the duplicated layer above the current symbol layer

layerChanged

Called when the layer changes in the widget.

lockLayer

Lock the current active symbol layer.

moveLayerDown

Move the active symbol layer down.

moveLayerUp

Move the active symbol layer up.

removeLayer

Remove the current active symbol layer.

setContext

Sets the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.

symbol

Returns the symbol that is currently active in the widget.

symbolChanged

Slot to update tree when a new symbol from style

updateLayerPreview

Update the single symbol layer preview in the widget.

updatePreview

Update the preview of the whole symbol in the interface.

Signals

symbolModified

Emitted when a symbol is modified in the widget.

class qgis.gui.QgsSymbolSelectorWidget[source]

Bases: QgsPanelWidget

__init__(symbol: QgsSymbol | None, style: QgsStyle | None, vl: QgsVectorLayer | None, parent: QWidget | None = None)

Symbol selector widget that can be used to select and build a symbol

Parameters:
  • symbol (Optional[QgsSymbol]) – The symbol to load into the widget as a start point.

  • style (Optional[QgsStyle]) – The style used by the widget.

  • vl (Optional[QgsVectorLayer]) – The vector layer for the symbol.

  • parent (Optional[QWidget] = None)

Note

The ownership of the symbol is not transferred and must exist for the lifetime of the widget.

addLayer(self)[source]

Add a symbol layer to the bottom of the stack.

advancedMenu(self) QMenu | None[source]

Returns menu for “advanced” button - create it if doesn’t exist and show the advanced button

Return type:

Optional[QMenu]

changeLayer(self, layer: QgsSymbolLayer | None)[source]

Alters tree and sets proper widget when Layer Type is changed

Note

The layer is received from the LayerPropertiesWidget

Parameters:

layer (Optional[QgsSymbolLayer])

context(self) QgsSymbolWidgetContext[source]

Returns the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.

See also

setContext()

Return type:

QgsSymbolWidgetContext

duplicateLayer(self)[source]

Duplicates the current symbol layer and places the duplicated layer above the current symbol layer

layerChanged(self)[source]

Called when the layer changes in the widget. Updates the active properties for active symbol layer.

lockLayer(self)[source]

Lock the current active symbol layer.

moveLayerDown(self)[source]

Move the active symbol layer down.

moveLayerUp(self)[source]

Move the active symbol layer up.

removeLayer(self)[source]

Remove the current active symbol layer.

setContext(self, context: QgsSymbolWidgetContext)[source]

Sets the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.

Parameters:

context (QgsSymbolWidgetContext) – symbol widget context

See also

context()

symbol(self) QgsSymbol | None[source]

Returns the symbol that is currently active in the widget. Can be None.

Return type:

Optional[QgsSymbol]

Returns:

The active symbol.

symbolChanged(self)[source]

Slot to update tree when a new symbol from style

signal symbolModified[source]

Emitted when a symbol is modified in the widget.

updateLayerPreview(self)[source]

Update the single symbol layer preview in the widget.

updatePreview(self)[source]

Update the preview of the whole symbol in the interface.