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.

New in version 3.0.

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

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

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

New in version 3.0.

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