QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
18 #ifndef QGSLABELSINK_H
19 #define QGSLABELSINK_H
99 #endif // QGSLABELSINK_H
Implements a derived label provider for rule based labels for use with QgsLabelSink.
LabelPosition is a candidate feature label position.
Abstract base class that can be used to intercept rendered labels from a labeling / rendering job.
Contains information about the context of a rendering operation.
QgsRuleBasedLabelSinkProvider(const QgsRuleBasedLabeling &rules, QgsVectorLayer *layer, QgsLabelSink *sink)
Creates a rule based label sink provider which will draw/register labels in sink.
The QgsVectorLayerLabelProvider class implements a label provider for vector layers.
const QgsPalLayerSettings & settings() const
Returns the layer's settings.
virtual ~QgsLabelSink()=default
void drawLabel(QgsRenderContext &context, pal::LabelPosition *label) const override
Draw this label at the position determined by the labeling engine.
QgsLabelSinkProvider(QgsVectorLayer *layer, const QString &providerId, QgsLabelSink *sink, const QgsPalLayerSettings *settings)
Creates a rule based label sink provider which will draw/register labels in sink.
Q_DECL_DEPRECATED void reinit(QgsVectorLayer *layer)
Reinitialize the subproviders with QgsLabelSinkProviders.
QString providerId() const
Returns provider ID - useful in case there is more than one label provider within a layer (e....
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.
void drawLabel(QgsRenderContext &context, pal::LabelPosition *label) const override
Draw this label at the position determined by the labeling engine.
Represents a vector layer which manages a vector based data sets.
Implements a derived label provider for use with QgsLabelSink.
QgsMapLayer * layer() const
Returns the associated layer, or nullptr if no layer is associated with the provider.
QgsVectorLayerLabelProvider * createProvider(QgsVectorLayer *layer, const QString &providerId, bool withFeatureLoop, const QgsPalLayerSettings *settings) override
Creates a QgsRuleBasedLabelSinkProvider.