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:

Optional[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 | None) bool
Parameters:

visitor (Optional[QgsStyleEntityVisitorInterface])

Return type:

bool

clone(self) QgsAbstractVectorLayerLabeling | None
Return type:

Optional[QgsAbstractVectorLayerLabeling]

create(element: QDomElement, context: QgsReadWriteContext) QgsVectorLayerSimpleLabeling | None

Create the instance from a DOM element with saved configuration

Parameters:
Return type:

Optional[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 | None, providerId: str | None = '')

Set pal settings (takes ownership).

Parameters:
  • settings (Optional[QgsPalLayerSettings]) – Pal layer settings

  • providerId (Optional[str] = '') – Unused parameter

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

providerId (Optional[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