Class: QgsMapLayerDependency

class qgis.core.QgsMapLayerDependency

Bases: sip.wrapper

This class models dependencies with or between map layers.

A dependency is defined by a layer ID, a type and an origin. The two combinations of type/origin that are currently supported are:

  • PresenceDependency && FromProvider: virtual layers for instance which may depend on other layers already loaded to work

  • DataDependency && FromUser: dependencies given by the user, mainly to represent database triggers

New in version 3.0.

QgsMapLayerDependency(layerId: str, type: QgsMapLayerDependency.Type = QgsMapLayerDependency.DataDependency, origin: QgsMapLayerDependency.Origin = QgsMapLayerDependency.FromUser) Standard constructor

QgsMapLayerDependency(QgsMapLayerDependency)

Methods

layerId

Returns the ID of the layer this dependency depends on

origin

Returns the dependency origin

type

Returns the dependency type

Attributes

DataDependency

FromProvider

FromUser

PresenceDependency

DataDependency = 2
FromProvider = 0
FromUser = 1
class Origin

Bases: int

PresenceDependency = 1
class Type

Bases: int

layerId(self)str

Returns the ID of the layer this dependency depends on

Return type

str

origin(self)QgsMapLayerDependency.Origin

Returns the dependency origin

Return type

QgsMapLayerDependency.Origin

type(self)QgsMapLayerDependency.Type

Returns the dependency type

Return type

QgsMapLayerDependency.Type