Class: QgsMapLayerConfigWidget

A panel widget that can be shown in the map style dock

Class Hierarchy

Inheritance diagram of qgis.gui.QgsMapLayerConfigWidget

Base classes

QgsPanelWidget

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

QWidget

QObject

QPaintDevice

Subclasses

QgsMapLayerStyleManagerWidget

The QgsMapLayerStyleManagerWidget class which is used to visually manage the layer styles.

QgsPointCloudRendererPropertiesWidget

A generic widget for setting the 2D renderer for a point cloud layer.

QgsRasterHistogramWidget

Histogram widget

QgsRasterTransparencyWidget

Widget to control a layers transparency and related options

QgsRendererRasterPropertiesWidget

A widget to hold the renderer properties for a raster layer.

QgsTiledSceneRendererPropertiesWidget

A generic widget for setting the 2D renderer for a tiled scene layer.

Methods

apply

Called when changes to the layer need to be made.

focusDefaultWidget

Focuses the default widget for the page.

setMapLayerConfigWidgetContext

Sets the context under which the widget is being shown.

shouldTriggerLayerRepaint

Whether this config widget changes map layer properties in a way that triggerRepaint() should be called for the layer after applying changes.

syncToLayer

Reset to original (vector layer) values

class qgis.gui.QgsMapLayerConfigWidget[source]

Bases: QgsPanelWidget

__init__(layer: QgsMapLayer | None, canvas: QgsMapCanvas | None, parent: QWidget | None = None)

A panel widget that can be shown in the map style dock

Parameters:
  • layer (Optional[QgsMapLayer]) – The layer active in the dock.

  • canvas (Optional[QgsMapCanvas]) – The canvas object.

  • parent (Optional[QWidget] = None) – The parent of the widget.

Note

The widget is created each time the panel is selected in the dock. Keep the loading light as possible for speed in the UI.

apply(self)[source]

Called when changes to the layer need to be made. Will be called when live update is enabled.

focusDefaultWidget(self)[source]

Focuses the default widget for the page.

Added in version 3.22.

setMapLayerConfigWidgetContext(self, context: QgsMapLayerConfigWidgetContext)[source]

Sets the context under which the widget is being shown.

Subclasses should take care to call the base class implementation when overriding this method.

Parameters:

context (QgsMapLayerConfigWidgetContext)

shouldTriggerLayerRepaint(self) bool[source]

Whether this config widget changes map layer properties in a way that triggerRepaint() should be called for the layer after applying changes. This is True by default, but some config widgets (for example 3D rendering config) do not need layer repaint as they do not modify 2D map rendering.

Added in version 3.8.

Return type:

bool

syncToLayer(self, layer: QgsMapLayer | None)[source]

Reset to original (vector layer) values

Added in version 3.14.

Parameters:

layer (Optional[QgsMapLayer])