Class: QgsMapLayerConfigWidget

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

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: apply()

Class Hierarchy

Inheritance diagram of qgis.gui.QgsMapLayerConfigWidget

Base classes

QgsPanelWidget

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

QWidget

QObject

QPaintDevice

Subclasses

QgsMapLayerStyleManagerWidget

A widget which is used to visually manage the layer styles.

QgsPointCloudRendererPropertiesWidget

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

QgsRasterHistogramWidget

A widget for display and configuring a raster layer histogram.

QgsRasterTransparencyWidget

A widget for controlling a raster layer’s transparency and related options.

QgsRendererRasterPropertiesWidget

A widget for configuring properties of a raster layer renderer.

QgsTiledSceneRendererPropertiesWidget

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

Abstract Methods

apply

Called when changes to the layer need to be made.

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsMapLayerConfigWidget. See the FAQ for more details.

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.

abstract apply(self)[source]

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

virtual focusDefaultWidget(self)[source]

Focuses the default widget for the page.

Added in version 3.22.

virtual 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)

virtual 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

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

Reset to original (vector layer) values

Added in version 3.14.

Parameters:

layer (Optional[QgsMapLayer])