Class: QgsMapLayerConfigWidgetFactory

class qgis.gui.QgsMapLayerConfigWidgetFactory

Bases: sip.wrapper

Constructor

QgsMapLayerConfigWidgetFactory(title: str, icon: QIcon) Constructor

QgsMapLayerConfigWidgetFactory(QgsMapLayerConfigWidgetFactory)

Factory class for creating custom map layer property pages

Methods

createWidget

Factory function to create the widget on demand as needed by the dock.

icon

The icon that will be shown in the UI for the panel.

setIcon

Set the icon for the factory object.

setSupportLayerPropertiesDialog

Set support flag for style dock

setSupportsStyleDock

Set support flag for style dock

setTitle

Set the title for the interface

supportLayerPropertiesDialog

Flag if widget is supported for use in layer properties dialog.

supportsLayer

Check if the layer is supported for this widget.

supportsStyleDock

Flag if widget is supported for use in style dock.

title

The title of the panel.

createWidget(self, layer: QgsMapLayer, canvas: QgsMapCanvas, dockWidget: bool = True, parent: QWidget = None) → QgsMapLayerConfigWidget

Factory function to create the widget on demand as needed by the dock.

Parameters
  • layer (QgsMapLayer) – The active layer in the dock.

  • canvas (QgsMapCanvas) – The map canvas.

  • dockWidget (bool = True) – True of the widget will be shown a dock style widget.

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

Return type

QgsMapLayerConfigWidget

Returns

A new QgsMapStylePanel which is shown in the map style dock.

Note

This function is called each time the panel is selected. Keep it light for better UX.

icon(self) → QIcon

The icon that will be shown in the UI for the panel.

Return type

QIcon

Returns

A QIcon for the panel icon.

setIcon(self, icon: QIcon)

Set the icon for the factory object.

Parameters

icon (QIcon) – The icon to show in the interface.

setSupportLayerPropertiesDialog(self, supports: bool)

Set support flag for style dock

Parameters

supports (bool) – True if this widget is supported in the style dock.

setSupportsStyleDock(self, supports: bool)

Set support flag for style dock

Parameters

supports (bool) – True if this widget is supported in the style dock.

setTitle(self, title: str)

Set the title for the interface

Note

Not all users may show this as a label e.g style dock uses this as a tooltip.

Parameters

title (str) – The title to set.

supportLayerPropertiesDialog(self) → bool

Flag if widget is supported for use in layer properties dialog. The default implementation returns False.

Return type

bool

Returns

True if supported

supportsLayer(self, layer: QgsMapLayer) → bool

Check if the layer is supported for this widget.

Return type

bool

Returns

True if this layer is supported for this widget

Parameters

layer (QgsMapLayer) –

supportsStyleDock(self) → bool

Flag if widget is supported for use in style dock. The default implementation returns False.

Return type

bool

Returns

True if supported

title(self) → str

The title of the panel.

Return type

str

Returns

Title of the panel

Note

This may or may not be shown to the user.