QgsRuleBasedLabeling class
Contents
Base classes
- class QgsAbstractVectorLayerLabeling
- Abstract base class - its implementations define different approaches to the labeling of a vector layer.
Public types
- class Rule
Public static functions
- static auto create(const QDomElement& element, const QgsReadWriteContext& context) -> QgsRuleBasedLabeling*
- Create the instance from a DOM element with saved configuration.
Constructors, destructors, conversion operators
-
QgsRuleBasedLabeling(QgsRuleBasedLabeling::
Rule* root) explicit - Constructs the labeling from given tree of rules (takes ownership)
Public functions
- auto clone() const -> QgsRuleBasedLabeling* override
- Returns a new copy of the object.
- auto provider(QgsVectorLayer* layer) const -> QgsVectorLayerLabelProvider* override
- auto requiresAdvancedEffects() const -> bool 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.
- auto save(QDomDocument& doc, const QgsReadWriteContext& context) const -> QDomElement override
- Returns labeling configuration as XML element.
- void setSettings(QgsPalLayerSettings* settings, const QString& providerId = QString()) override
- Set pal settings for a specific provider (takes ownership).
- auto settings(const QString& providerId = QString()) const -> QgsPalLayerSettings override
- Gets associated label settings.
- auto subProviders() const -> QStringList override
- Gets list of sub-providers within the layer's labeling.
- void toSld(QDomNode& parent, const QgsStringMap& props) const override
- Writes the SE 1.1 TextSymbolizer element based on the current layer labeling settings.
- auto type() const -> QString override
- Unique type string of the labeling configuration implementation.
Function documentation
QgsVectorLayerLabelProvider* QgsRuleBasedLabeling:: provider(QgsVectorLayer* layer) const override
bool QgsRuleBasedLabeling:: 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.
void QgsRuleBasedLabeling:: setSettings(QgsPalLayerSettings* settings,
const QString& providerId = QString()) override
Set pal settings for a specific provider (takes ownership).
| Parameters | |
|---|---|
| settings | Pal layer settings |
| providerId | The id of the provider |
QgsPalLayerSettings QgsRuleBasedLabeling:: settings(const QString& providerId = QString()) const override
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)