Class: QgsVectorLayerSimpleLabeling

class qgis.core.QgsVectorLayerSimpleLabeling

Bases: QgsAbstractVectorLayerLabeling

Basic implementation of the labeling interface.

The configuration is kept in layer’s custom properties for backward compatibility.

QgsVectorLayerSimpleLabeling(settings: QgsPalLayerSettings) Constructs simple labeling configuration with given initial settings

Methods

accept

param visitor:

clone

rtype:

QgsAbstractVectorLayerLabeling

create

Create the instance from a DOM element with saved configuration

multiplyOpacity

param opacityFactor:

requiresAdvancedEffects

rtype:

bool

save

param doc:

setSettings

Set pal settings (takes ownership).

settings

param providerId:

toSld

param parent:

type

rtype:

str

writeTextSymbolizer

Writes a TextSymbolizer element contents based on the provided labeling settings

accept(self, visitor: QgsStyleEntityVisitorInterface) bool
Parameters:

visitor (QgsStyleEntityVisitorInterface) –

Return type:

bool

clone(self) QgsAbstractVectorLayerLabeling
Return type:

QgsAbstractVectorLayerLabeling

create(element: QDomElement, context: QgsReadWriteContext) QgsVectorLayerSimpleLabeling

Create the instance from a DOM element with saved configuration

Parameters:
Return type:

QgsVectorLayerSimpleLabeling

multiplyOpacity(self, opacityFactor: float)
Parameters:

opacityFactor (float) –

requiresAdvancedEffects(self) bool
Return type:

bool

save(self, doc: QDomDocument, context: QgsReadWriteContext) QDomElement
Parameters:
Return type:

QDomElement

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

Set pal settings (takes ownership).

Parameters:
  • settings (QgsPalLayerSettings) – Pal layer settings

  • providerId (str = '') – Unused parameter

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

providerId (str = '') –

Return type:

QgsPalLayerSettings

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

  • props (Dict[str) –

type(self) str
Return type:

str

writeTextSymbolizer(self, parent: QDomNode, settings: QgsPalLayerSettings, props: Dict[str, Any])

Writes a TextSymbolizer element contents based on the provided labeling settings

Parameters:
  • parent – the node that will have the text symbolizer element added to it

  • settings – the settings getting translated to a TextSymbolizer

  • props – a open ended set of properties that can drive/inform the SLD encoding