QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
Public Member Functions | Static Public Member Functions | List of all members
QgsVectorLayerSimpleLabeling Class Reference

Basic implementation of the labeling interface. More...

#include <qgsvectorlayerlabeling.h>

Inheritance diagram for QgsVectorLayerSimpleLabeling:
Inheritance graph
[legend]

Public Member Functions

 QgsVectorLayerSimpleLabeling (const QgsPalLayerSettings &settings)
 Constructs simple labeling configuration with given initial settings. More...
 
bool accept (QgsStyleEntityVisitorInterface *visitor) const override
 Accepts the specified symbology visitor, causing it to visit all symbols associated with the labeling. More...
 
QgsAbstractVectorLayerLabelingclone () const override
 Returns a new copy of the object. More...
 
void multiplyOpacity (double opacityFactor) override
 Multiply opacity by opacityFactor. More...
 
QgsVectorLayerLabelProviderprovider (QgsVectorLayer *layer) const override
 
bool requiresAdvancedEffects () const override
 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. More...
 
QDomElement save (QDomDocument &doc, const QgsReadWriteContext &context) const override
 Returns labeling configuration as XML element. More...
 
void setSettings (QgsPalLayerSettings *settings, const QString &providerId=QString()) override
 Set pal settings (takes ownership). More...
 
QgsPalLayerSettings settings (const QString &providerId=QString()) const override
 Gets associated label settings. More...
 
void toSld (QDomNode &parent, const QVariantMap &props) const override
 Writes the SE 1.1 TextSymbolizer element based on the current layer labeling settings. More...
 
QString type () const override
 Unique type string of the labeling configuration implementation. More...
 
- Public Member Functions inherited from QgsAbstractVectorLayerLabeling
 QgsAbstractVectorLayerLabeling ()=default
 Default constructor. More...
 
virtual ~QgsAbstractVectorLayerLabeling ()=default
 
virtual bool accept (QgsStyleEntityVisitorInterface *visitor) const
 Accepts the specified symbology visitor, causing it to visit all symbols associated with the labeling. More...
 
virtual QgsAbstractVectorLayerLabelingclone () const =0
 Returns a new copy of the object. More...
 
virtual void multiplyOpacity (double opacityFactor)
 Multiply opacity by opacityFactor. More...
 
virtual QgsVectorLayerLabelProviderprovider (QgsVectorLayer *layer) const
 Factory for label provider implementation. More...
 
virtual bool requiresAdvancedEffects () const =0
 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. More...
 
virtual QDomElement save (QDomDocument &doc, const QgsReadWriteContext &context) const =0
 Returns labeling configuration as XML element. More...
 
virtual void setSettings (QgsPalLayerSettings *settings, const QString &providerId=QString())=0
 Set pal settings for a specific provider (takes ownership). More...
 
virtual QgsPalLayerSettings settings (const QString &providerId=QString()) const =0
 Gets associated label settings. More...
 
virtual QStringList subProviders () const
 Gets list of sub-providers within the layer's labeling. More...
 
virtual void toSld (QDomNode &parent, const QVariantMap &props) const
 Writes the SE 1.1 TextSymbolizer element based on the current layer labeling settings. More...
 
virtual QString type () const =0
 Unique type string of the labeling configuration implementation. More...
 

Static Public Member Functions

static QgsVectorLayerSimpleLabelingcreate (const QDomElement &element, const QgsReadWriteContext &context)
 Create the instance from a DOM element with saved configuration. More...
 
- Static Public Member Functions inherited from QgsAbstractVectorLayerLabeling
static QgsAbstractVectorLayerLabelingcreate (const QDomElement &element, const QgsReadWriteContext &context)
 Try to create instance of an implementation based on the XML data. More...
 
static QgsPalLayerSettings defaultSettingsForLayer (const QgsVectorLayer *layer)
 Returns the default layer settings to use for the specified vector layer. More...
 

Additional Inherited Members

- Protected Member Functions inherited from QgsAbstractVectorLayerLabeling
virtual void writeTextSymbolizer (QDomNode &parent, QgsPalLayerSettings &settings, const QVariantMap &props) const
 Writes a TextSymbolizer element contents based on the provided labeling settings. More...
 

Detailed Description

Basic implementation of the labeling interface.

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

Since
QGIS 3.0

Definition at line 175 of file qgsvectorlayerlabeling.h.

Constructor & Destructor Documentation

◆ QgsVectorLayerSimpleLabeling()

QgsVectorLayerSimpleLabeling::QgsVectorLayerSimpleLabeling ( const QgsPalLayerSettings settings)
explicit

Constructs simple labeling configuration with given initial settings.

Definition at line 80 of file qgsvectorlayerlabeling.cpp.

Member Function Documentation

◆ accept()

bool QgsVectorLayerSimpleLabeling::accept ( QgsStyleEntityVisitorInterface visitor) const
overridevirtual

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.

Since
QGIS 3.10

Reimplemented from QgsAbstractVectorLayerLabeling.

Definition at line 110 of file qgsvectorlayerlabeling.cpp.

◆ clone()

QgsAbstractVectorLayerLabeling * QgsVectorLayerSimpleLabeling::clone ( ) const
overridevirtual

Returns a new copy of the object.

Implements QgsAbstractVectorLayerLabeling.

Definition at line 91 of file qgsvectorlayerlabeling.cpp.

◆ create()

QgsVectorLayerSimpleLabeling * QgsVectorLayerSimpleLabeling::create ( const QDomElement &  element,
const QgsReadWriteContext context 
)
static

Create the instance from a DOM element with saved configuration.

Definition at line 126 of file qgsvectorlayerlabeling.cpp.

◆ multiplyOpacity()

void QgsVectorLayerSimpleLabeling::multiplyOpacity ( double  opacityFactor)
overridevirtual

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.

Since
QGIS 3.32

Reimplemented from QgsAbstractVectorLayerLabeling.

Definition at line 637 of file qgsvectorlayerlabeling.cpp.

◆ provider()

QgsVectorLayerLabelProvider * QgsVectorLayerSimpleLabeling::provider ( QgsVectorLayer layer) const
overridevirtual
Note
not available in Python bindings

Reimplemented from QgsAbstractVectorLayerLabeling.

Definition at line 75 of file qgsvectorlayerlabeling.cpp.

◆ requiresAdvancedEffects()

bool QgsVectorLayerSimpleLabeling::requiresAdvancedEffects ( ) const
overridevirtual

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.

Since
QGIS 3.0

Implements QgsAbstractVectorLayerLabeling.

Definition at line 121 of file qgsvectorlayerlabeling.cpp.

◆ save()

QDomElement QgsVectorLayerSimpleLabeling::save ( QDomDocument &  doc,
const QgsReadWriteContext context 
) const
overridevirtual

Returns labeling configuration as XML element.

Implements QgsAbstractVectorLayerLabeling.

Definition at line 96 of file qgsvectorlayerlabeling.cpp.

◆ setSettings()

void QgsVectorLayerSimpleLabeling::setSettings ( QgsPalLayerSettings settings,
const QString &  providerId = QString() 
)
overridevirtual

Set pal settings (takes ownership).

Parameters
settingsPal layer settings
providerIdUnused parameter
Since
QGIS 3.0

Implements QgsAbstractVectorLayerLabeling.

Definition at line 644 of file qgsvectorlayerlabeling.cpp.

◆ settings()

QgsPalLayerSettings QgsVectorLayerSimpleLabeling::settings ( const QString &  providerId = QString()) const
overridevirtual

Gets associated label settings.

In case of multiple sub-providers with different settings, they are identified by their ID (e.g. in case of rule-based labeling, provider ID == rule key)

Implements QgsAbstractVectorLayerLabeling.

Definition at line 104 of file qgsvectorlayerlabeling.cpp.

◆ toSld()

void QgsVectorLayerSimpleLabeling::toSld ( QDomNode &  parent,
const QVariantMap &  props 
) const
overridevirtual

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

Reimplemented from QgsAbstractVectorLayerLabeling.

Definition at line 611 of file qgsvectorlayerlabeling.cpp.

◆ type()

QString QgsVectorLayerSimpleLabeling::type ( ) const
overridevirtual

Unique type string of the labeling configuration implementation.

Implements QgsAbstractVectorLayerLabeling.

Definition at line 86 of file qgsvectorlayerlabeling.cpp.


The documentation for this class was generated from the following files: