QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
Public Member Functions | List of all members
QgsFeatureRendererGenerator Class Referenceabstract

An interface for objects which generate feature renderers for vector layers. More...

#include <qgsfeaturerenderergenerator.h>

Public Member Functions

virtual ~QgsFeatureRendererGenerator ()=default
 
virtual QgsFeatureRenderercreateRenderer () const =0
 Creates a new feature renderer to use when rendering a vector layer. More...
 
virtual QString id () const =0
 Returns a unique ID string identifying the renderer generator. More...
 
virtual double level () const
 Returns a double value which dictates the stacking or z order level associated with the returned renderer. More...
 

Detailed Description

An interface for objects which generate feature renderers for vector layers.

Since
QGIS 3.18

Definition at line 31 of file qgsfeaturerenderergenerator.h.

Constructor & Destructor Documentation

◆ ~QgsFeatureRendererGenerator()

virtual QgsFeatureRendererGenerator::~QgsFeatureRendererGenerator ( )
virtualdefault

Member Function Documentation

◆ createRenderer()

virtual QgsFeatureRenderer * QgsFeatureRendererGenerator::createRenderer ( ) const
pure virtual

Creates a new feature renderer to use when rendering a vector layer.

Caller takes ownership of the returned renderer.

◆ id()

virtual QString QgsFeatureRendererGenerator::id ( ) const
pure virtual

Returns a unique ID string identifying the renderer generator.

◆ level()

double QgsFeatureRendererGenerator::level ( ) const
virtual

Returns a double value which dictates the stacking or z order level associated with the returned renderer.

A value > 0 will always be rendered AFTER the normal renderer for a vector layer (i.e. the renderer will be drawn on top of the normal feature renderer), while a value < 0 will always be rendered BEFORE the normal renderer (i.e. the rendered features will be drawn below the normal feature renderer).

Since a layer may potentially have multiple extra renderers created by QgsFeatureRendererGenerator subclasses, the level will always be used to control the order that these renderers are drawn. A renderer with a lower level() return value will always be drawn before those with a higher level() value.

The default implementation returns 1.0, i.e. features will be rendered ABOVE the normal vector layer renderer.

Note
If two QgsFeatureRendererGenerator implementations return the same level() value, then their ordering will be unpredictable.

Definition at line 18 of file qgsfeaturerenderergenerator.cpp.


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