Class: QgsLayerPropertiesWidget

A widget which allows configuration of the properties of a single QgsSymbolLayer.

This widget includes a combobox box for selection of the symbol layer type, and a panel for showing configuration properties for the selected symbol layer type.

QgsLayerPropertiesWidget showing a simple fill symbol layer

QgsLayerPropertiesWidget showing a simple fill symbol layer

Class Hierarchy

Inheritance diagram of qgis.gui.QgsLayerPropertiesWidget

Base classes

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.

Methods

context

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

emitSignalChanged

layerTypeChanged

populateLayerTypes

registerDataDefinedButton

Registers a data defined override button.

setContext

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

updateSymbolLayerWidget

Signals

changeLayer

Emitted when the symbol layer is changed in the widget.

changed

Emitted when the symbol layer configuration is changed in the widget.

class qgis.gui.QgsLayerPropertiesWidget[source]

Bases: QgsPanelWidget, QgsExpressionContextGenerator

__init__(layer: QgsSymbolLayer | None, symbol: QgsSymbol | None, vl: QgsVectorLayer | None, parent: QWidget | None = None)

Constructor for QgsLayerPropertiesWidget.

Parameters:
  • layer (Optional[QgsSymbolLayer]) – the symbol layer

  • symbol (Optional[QgsSymbol]) – the symbol

  • vl (Optional[QgsVectorLayer]) – associated vector layer

  • parent (Optional[QWidget] = None) – parent widget

signal changeLayer(layer: QgsSymbolLayer)[source]

Emitted when the symbol layer is changed in the widget.

Parameters:

layer (QgsSymbolLayer)

signal changed[source]

Emitted when the symbol layer configuration is changed in the widget.

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

emitSignalChanged(self)[source]
layerTypeChanged(self)[source]
populateLayerTypes(self)[source]
registerDataDefinedButton(self, button: QgsPropertyOverrideButton | None, key: QgsSymbolLayer.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:
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()

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

layer (Optional[QgsSymbolLayer])