Class: QgsAbstractMeshLayerLabeling

class qgis.core.QgsAbstractMeshLayerLabeling

Bases: sip.wrapper

Abstract base class - its implementations define different approaches to the labeling of a mesh layer.

Added in version 3.36.

QgsAbstractMeshLayerLabeling() Default constructor

Methods

accept

Accepts the specified symbology visitor, causing it to visit all symbols associated with the labeling.

clone

Returns a new copy of the object

create

Try to create instance of an implementation based on the XML data

defaultSettingsForLayer

Returns the default layer settings to use for the specified mesh layer.

multiplyOpacity

Multiply opacity by opacityFactor.

requiresAdvancedEffects

Returns True if drawing labels requires advanced effects like composition modes, which could prevent it being used as an isolated cached image or exported to a vector format.

save

Returns labeling configuration as XML element

setSettings

Set pal settings for a specific provider (takes ownership).

settings

Gets associated label settings.

subProviders

Gets list of sub-providers within the layer's labeling.

toSld

Writes the SE 1.1 TextSymbolizer element based on the current layer labeling settings

type

Unique type string of the labeling configuration implementation

accept(self, visitor: QgsStyleEntityVisitorInterface) bool

Accepts the specified symbology visitor, causing it to visit all symbols associated with the labeling.

Returns True if the visitor should continue visiting other objects, or False if visiting should be canceled.

Parameters:

visitor (QgsStyleEntityVisitorInterface)

Return type:

bool

clone(self) QgsAbstractMeshLayerLabeling

Returns a new copy of the object

Return type:

QgsAbstractMeshLayerLabeling

create(element: QDomElement, context: QgsReadWriteContext) QgsAbstractMeshLayerLabeling

Try to create instance of an implementation based on the XML data

Parameters:
Return type:

QgsAbstractMeshLayerLabeling

defaultSettingsForLayer(layer: QgsMeshLayer) QgsPalLayerSettings

Returns the default layer settings to use for the specified mesh layer.

Parameters:

layer (QgsMeshLayer)

Return type:

QgsPalLayerSettings

multiplyOpacity(self, opacityFactor: float)

Multiply opacity by opacityFactor.

This method multiplies the opacity of the labeling elements (text, shadow, buffer etc.) by opacity effectively changing the opacity of the whole labeling elements.

Parameters:

opacityFactor (float)

requiresAdvancedEffects(self) bool

Returns True if drawing labels requires advanced effects like composition modes, which could prevent it being used as an isolated cached image or exported to a vector format.

Return type:

bool

save(self, doc: QDomDocument, context: QgsReadWriteContext) QDomElement

Returns labeling configuration as XML element

Parameters:
Return type:

QDomElement

setSettings(self, settings: QgsPalLayerSettings, providerId: str = '')

Set pal settings for a specific provider (takes ownership).

Parameters:
  • settings (QgsPalLayerSettings) – Pal layer settings

  • providerId (str = '') – The id of the provider

settings(self, providerId: str = '') QgsPalLayerSettings

Gets associated label settings. In case of multiple sub-providers with different settings, they are identified by their ID.

Parameters:

providerId (str = '')

Return type:

QgsPalLayerSettings

subProviders(self) List[str]

Gets list of sub-providers within the layer’s labeling.

Return type:

List[str]

toSld(self, parent: QDomNode, props: Dict[str, Any])

Writes the SE 1.1 TextSymbolizer element based on the current layer labeling settings

Parameters:
  • parent (QDomNode)

  • props (Dict[str)

type(self) str

Unique type string of the labeling configuration implementation

Return type:

str