QgsMapLayer * layer() const
Returns the associated layer, or nullptr if no layer is associated with the provider.
 
QString providerId() const
Returns provider ID - useful in case there is more than one label provider within a layer (e....
 
Implements a derived label provider for use with QgsLabelSink.
 
void drawUnplacedLabel(QgsRenderContext &context, pal::LabelPosition *label) const override
Draw an unplaced label.
 
void drawLabel(QgsRenderContext &context, pal::LabelPosition *label) const override
Draw this label at the position determined by the labeling engine.
 
Abstract base class that can be used to intercept rendered labels from a labeling / rendering job.
 
virtual void drawUnplacedLabel(const QString &layerId, QgsRenderContext &context, pal::LabelPosition *label, const QgsPalLayerSettings &settings)
The drawLabel method is called for each unplaced label.
 
virtual void drawLabel(const QString &layerId, QgsRenderContext &context, pal::LabelPosition *label, const QgsPalLayerSettings &settings)=0
The drawLabel method is called for each label that is being drawn.
 
virtual ~QgsLabelSink()=default
 
Contains settings for how a map layer will be labeled.
 
Contains information about the context of a rendering operation.
 
Label provider for rule based labeling.
 
Implements a derived label provider for rule based labels for use with QgsLabelSink.
 
void drawLabel(QgsRenderContext &context, pal::LabelPosition *label) const override
Draw this label at the position determined by the labeling engine.
 
Q_DECL_DEPRECATED void reinit(QgsVectorLayer *layer)
Reinitialize the subproviders with QgsLabelSinkProviders.
 
QgsVectorLayerLabelProvider * createProvider(QgsVectorLayer *layer, const QString &providerId, bool withFeatureLoop, const QgsPalLayerSettings *settings) override
Creates a QgsRuleBasedLabelSinkProvider.
 
void drawUnplacedLabel(QgsRenderContext &context, pal::LabelPosition *label) const override
Draw an unplaced label.
 
Rule based labeling for a vector layer.
 
Implements a label provider for vector layers.
 
const QgsPalLayerSettings & settings() const
Returns the layer's settings.
 
Represents a vector layer which manages a vector based dataset.
 
LabelPosition is a candidate feature label position.