Class: QgsPluginLayer

Base class for plugin layers. These can be implemented by plugins and registered in QgsPluginLayerRegistry.

In order to be readable from project files, they should set these attributes in layer DOM node: “type” = “plugin” “name” = “your_layer_type”

Class Hierarchy

Inheritance diagram of qgis.core.QgsPluginLayer

Base classes

QgsMapLayer

Base class for all map layer types. This is the base class for all map layer types (vector, raster).

QObject

Methods

clone

Returns a new instance equivalent to this one.

icon

Returns an icon for the layer.

pluginLayerType

Returns plugin layer type (the same as used in QgsPluginLayerRegistry)

setExtent

Sets extent of the layer

setSource

Set source string.

class qgis.core.QgsPluginLayer[source]

Bases: QgsMapLayer

clone(self) QgsPluginLayer | None[source]

Returns a new instance equivalent to this one.

Return type:

Optional[QgsPluginLayer]

Returns:

a new layer instance

icon(self) QIcon[source]

Returns an icon for the layer.

Added in version 3.42.

Return type:

QIcon

pluginLayerType(self) str[source]

Returns plugin layer type (the same as used in QgsPluginLayerRegistry)

Return type:

str

setExtent(self, extent: QgsRectangle)[source]

Sets extent of the layer

Parameters:

extent (QgsRectangle)

setSource(self, source: str | None)[source]

Set source string. This is used for example in layer tree to show tooltip.

Parameters:

source (Optional[str])