QGIS API Documentation  3.14.0-Pi (9f7028fd23)
Public Member Functions | Protected Attributes | List of all members
QgsRendererMetadata Class Reference

#include <qgsrendererregistry.h>

Inheritance diagram for QgsRendererMetadata:
Inheritance graph
[legend]

Public Member Functions

 QgsRendererMetadata (const QString &name, const QString &visibleName, QgsRendererCreateFunc pfCreate, const QIcon &icon=QIcon(), QgsRendererWidgetFunc pfWidget=nullptr, QgsRendererAbstractMetadata::LayerTypes layerTypes=QgsRendererAbstractMetadata::All)
 Construct metadata. More...
 
 QgsRendererMetadata (const QString &name, const QString &visibleName, QgsRendererCreateFunc pfCreate, QgsRendererCreateFromSldFunc pfCreateFromSld, const QIcon &icon=QIcon(), QgsRendererWidgetFunc pfWidget=nullptr, QgsRendererAbstractMetadata::LayerTypes layerTypes=QgsRendererAbstractMetadata::All)
 
QgsRendererAbstractMetadata::LayerTypes compatibleLayerTypes () const override
 Returns flags indicating the types of layer the renderer is compatible with. More...
 
QgsRendererCreateFromSldFunc createFromSldFunction () const
 
QgsRendererCreateFunc createFunction () const
 
QgsFeatureRenderercreateRenderer (QDomElement &elem, const QgsReadWriteContext &context) override
 Returns new instance of the renderer given the DOM element. More...
 
QgsFeatureRenderercreateRendererFromSld (QDomElement &elem, QgsWkbTypes::GeometryType geomType) override
 
QgsRendererWidgetcreateRendererWidget (QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer) override
 Returns new instance of settings widget for the renderer. More...
 
void setWidgetFunction (QgsRendererWidgetFunc f)
 
QgsRendererWidgetFunc widgetFunction () const
 

Protected Attributes

QgsRendererCreateFromSldFunc mCreateFromSldFunc
 pointer to function that creates an instance of the renderer from SLD More...
 
QgsRendererCreateFunc mCreateFunc
 pointer to function that creates an instance of the renderer when loading project / style More...
 
QgsRendererWidgetFunc mWidgetFunc
 pointer to function that creates a widget for configuration of renderer's params More...
 

Additional Inherited Members

 Layer types the renderer is compatible with. More...

Detailed Description

Convenience metadata class that uses static functions to create renderer and its widget.

Definition at line 141 of file qgsrendererregistry.h.

Constructor & Destructor Documentation

◆ QgsRendererMetadata() [1/2]

QgsRendererMetadata::QgsRendererMetadata ( const QString &  name,
const QString &  visibleName,
QgsRendererCreateFunc  pfCreate,
const QIcon &  icon = QIcon(),
QgsRendererWidgetFunc  pfWidget = nullptr,
QgsRendererAbstractMetadata::LayerTypes  layerTypes = QgsRendererAbstractMetadata::All 
)
inline

Construct metadata.

Note
not available in Python bindings

Definition at line 149 of file qgsrendererregistry.h.

◆ QgsRendererMetadata() [2/2]

QgsRendererMetadata::QgsRendererMetadata ( const QString &  name,
const QString &  visibleName,
QgsRendererCreateFunc  pfCreate,
QgsRendererCreateFromSldFunc  pfCreateFromSld,
const QIcon &  icon = QIcon(),
QgsRendererWidgetFunc  pfWidget = nullptr,
QgsRendererAbstractMetadata::LayerTypes  layerTypes = QgsRendererAbstractMetadata::All 
)
inline
Note
not available in Python bindings

Definition at line 163 of file qgsrendererregistry.h.

Member Function Documentation

◆ compatibleLayerTypes()

QgsRendererAbstractMetadata::LayerTypes QgsRendererMetadata::compatibleLayerTypes ( ) const
inlineoverridevirtual

Returns flags indicating the types of layer the renderer is compatible with.

Since
QGIS 2.16

Reimplemented from QgsRendererAbstractMetadata.

Definition at line 194 of file qgsrendererregistry.h.

◆ createFromSldFunction()

QgsRendererCreateFromSldFunc QgsRendererMetadata::createFromSldFunction ( ) const
inline
Note
not available in Python bindings

Definition at line 189 of file qgsrendererregistry.h.

◆ createFunction()

QgsRendererCreateFunc QgsRendererMetadata::createFunction ( ) const
inline
Note
not available in Python bindings

Definition at line 185 of file qgsrendererregistry.h.

◆ createRenderer()

QgsFeatureRenderer* QgsRendererMetadata::createRenderer ( QDomElement &  elem,
const QgsReadWriteContext context 
)
inlineoverridevirtual

Returns new instance of the renderer given the DOM element.

Returns nullptr on error. Pure virtual function: must be implemented in derived classes.

Implements QgsRendererAbstractMetadata.

Definition at line 177 of file qgsrendererregistry.h.

◆ createRendererFromSld()

QgsFeatureRenderer* QgsRendererMetadata::createRendererFromSld ( QDomElement &  elem,
QgsWkbTypes::GeometryType  geomType 
)
inlineoverridevirtual

Reimplemented from QgsRendererAbstractMetadata.

Definition at line 181 of file qgsrendererregistry.h.

◆ createRendererWidget()

QgsRendererWidget* QgsRendererMetadata::createRendererWidget ( QgsVectorLayer layer,
QgsStyle style,
QgsFeatureRenderer oldRenderer 
)
inlineoverridevirtual

Returns new instance of settings widget for the renderer.

Returns nullptr on error.

The oldRenderer argument may refer to previously used renderer (or it is nullptr). If not nullptr, it may be used to initialize GUI of the widget from the previous settings. The old renderer does not have to be of the same type as returned by createRenderer().

Reimplemented from QgsRendererAbstractMetadata.

Definition at line 179 of file qgsrendererregistry.h.

◆ setWidgetFunction()

void QgsRendererMetadata::setWidgetFunction ( QgsRendererWidgetFunc  f)
inline
Note
not available in Python bindings

Definition at line 192 of file qgsrendererregistry.h.

◆ widgetFunction()

QgsRendererWidgetFunc QgsRendererMetadata::widgetFunction ( ) const
inline
Note
not available in Python bindings

Definition at line 187 of file qgsrendererregistry.h.

Member Data Documentation

◆ mCreateFromSldFunc

QgsRendererCreateFromSldFunc QgsRendererMetadata::mCreateFromSldFunc
protected

pointer to function that creates an instance of the renderer from SLD

Definition at line 202 of file qgsrendererregistry.h.

◆ mCreateFunc

QgsRendererCreateFunc QgsRendererMetadata::mCreateFunc
protected

pointer to function that creates an instance of the renderer when loading project / style

Definition at line 198 of file qgsrendererregistry.h.

◆ mWidgetFunc

QgsRendererWidgetFunc QgsRendererMetadata::mWidgetFunc
protected

pointer to function that creates a widget for configuration of renderer's params

Definition at line 200 of file qgsrendererregistry.h.


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