Class: QgsMapLayerDependency

class qgis.core.QgsMapLayerDependency(layerId: str, type: QgsMapLayerDependency.Type = QgsMapLayerDependency.DataDependency, origin: QgsMapLayerDependency.Origin = QgsMapLayerDependency.FromUser)

Bases: sip.wrapper

Standard constructor

QgsMapLayerDependency(QgsMapLayerDependency)

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.

Parameters
  • layerId (str) –

  • type (QgsMapLayerDependency.Type = QgsMapLayerDependency.DataDependency) –

  • origin

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