QgsPluginLayer class

Base class for plugin layers.

Contents

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"

Base classes

class QgsMapLayer
Base class for all map layer types.

Public functions

auto clone() const -> QgsPluginLayer* override
Returns a new instance equivalent to this one.
auto dataProvider() -> QgsDataProvider* override
Returns the layer's data provider, it may be null.
auto dataProvider() const -> const QgsDataProvider* override
Returns the layer's data provider in a const-correct manner, it may be null.
auto pluginLayerType() -> QString
Returns plugin layer type (the same as used in QgsPluginLayerRegistry)
void setExtent(const QgsRectangle& extent) override
Sets extent of the layer.
void setSource(const QString& source)
Set source string.

Function documentation

QgsPluginLayer* QgsPluginLayer::clone() const override

Returns a new instance equivalent to this one.

Returns a new layer instance

const QgsDataProvider* QgsPluginLayer::dataProvider() const override

Returns the layer's data provider in a const-correct manner, it may be null.

void QgsPluginLayer::setSource(const QString& source)

Set source string.

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