QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Public Member Functions | Protected Attributes | List of all members
QgsRendererV2Metadata Class Reference

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

#include <qgsrendererv2registry.h>

Inheritance diagram for QgsRendererV2Metadata:
Inheritance graph
[legend]

Public Member Functions

 QgsRendererV2Metadata (const QString &name, const QString &visibleName, QgsRendererV2CreateFunc pfCreate, const QIcon &icon=QIcon(), QgsRendererV2WidgetFunc pfWidget=nullptr, QgsRendererV2AbstractMetadata::LayerTypes layerTypes=QgsRendererV2AbstractMetadata::All)
 Construct metadata. More...
 
 QgsRendererV2Metadata (const QString &name, const QString &visibleName, QgsRendererV2CreateFunc pfCreate, QgsRendererV2CreateFromSldFunc pfCreateFromSld, const QIcon &icon=QIcon(), QgsRendererV2WidgetFunc pfWidget=nullptr, QgsRendererV2AbstractMetadata::LayerTypes layerTypes=QgsRendererV2AbstractMetadata::All)
 
virtual ~QgsRendererV2Metadata ()
 
virtual QgsRendererV2AbstractMetadata::LayerTypes compatibleLayerTypes () const override
 Returns flags indicating the types of layer the renderer is compatible with. More...
 
QgsRendererV2CreateFromSldFunc createFromSldFunction () const
 
QgsRendererV2CreateFunc createFunction () const
 
virtual QgsFeatureRendererV2createRenderer (QDomElement &elem) override
 Return new instance of the renderer given the DOM element. More...
 
virtual QgsFeatureRendererV2createRendererFromSld (QDomElement &elem, QGis::GeometryType geomType) override
 
virtual QgsRendererV2WidgetcreateRendererWidget (QgsVectorLayer *layer, QgsStyleV2 *style, QgsFeatureRendererV2 *renderer) override
 Return new instance of settings widget for the renderer. More...
 
void setWidgetFunction (QgsRendererV2WidgetFunc f)
 
QgsRendererV2WidgetFunc widgetFunction () const
 

Protected Attributes

QgsRendererV2CreateFromSldFunc mCreateFromSldFunc
 pointer to function that creates an instance of the renderer from SLD More...
 
QgsRendererV2CreateFunc mCreateFunc
 pointer to function that creates an instance of the renderer when loading project / style More...
 
QgsRendererV2WidgetFunc 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 105 of file qgsrendererv2registry.h.

Constructor & Destructor Documentation

◆ QgsRendererV2Metadata() [1/2]

QgsRendererV2Metadata::QgsRendererV2Metadata ( const QString name,
const QString visibleName,
QgsRendererV2CreateFunc  pfCreate,
const QIcon icon = QIcon(),
QgsRendererV2WidgetFunc  pfWidget = nullptr,
QgsRendererV2AbstractMetadata::LayerTypes  layerTypes = QgsRendererV2AbstractMetadata::All 
)
inline

Construct metadata.

Note
not available in python bindings

Definition at line 111 of file qgsrendererv2registry.h.

◆ QgsRendererV2Metadata() [2/2]

QgsRendererV2Metadata::QgsRendererV2Metadata ( const QString name,
const QString visibleName,
QgsRendererV2CreateFunc  pfCreate,
QgsRendererV2CreateFromSldFunc  pfCreateFromSld,
const QIcon icon = QIcon(),
QgsRendererV2WidgetFunc  pfWidget = nullptr,
QgsRendererV2AbstractMetadata::LayerTypes  layerTypes = QgsRendererV2AbstractMetadata::All 
)
inline
Note
not available in python bindings

Definition at line 125 of file qgsrendererv2registry.h.

◆ ~QgsRendererV2Metadata()

QgsRendererV2Metadata::~QgsRendererV2Metadata ( )
virtual

Definition at line 122 of file qgsrendererv2registry.cpp.

Member Function Documentation

◆ compatibleLayerTypes()

virtual QgsRendererV2AbstractMetadata::LayerTypes QgsRendererV2Metadata::compatibleLayerTypes ( ) const
inlineoverridevirtual

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

Note
added in QGIS 2.16

Reimplemented from QgsRendererV2AbstractMetadata.

Definition at line 157 of file qgsrendererv2registry.h.

◆ createFromSldFunction()

QgsRendererV2CreateFromSldFunc QgsRendererV2Metadata::createFromSldFunction ( ) const
inline
Note
not available in python bindings

Definition at line 152 of file qgsrendererv2registry.h.

◆ createFunction()

QgsRendererV2CreateFunc QgsRendererV2Metadata::createFunction ( ) const
inline
Note
not available in python bindings

Definition at line 148 of file qgsrendererv2registry.h.

◆ createRenderer()

virtual QgsFeatureRendererV2* QgsRendererV2Metadata::createRenderer ( QDomElement elem)
inlineoverridevirtual

Return new instance of the renderer given the DOM element.

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

Implements QgsRendererV2AbstractMetadata.

Definition at line 141 of file qgsrendererv2registry.h.

◆ createRendererFromSld()

virtual QgsFeatureRendererV2* QgsRendererV2Metadata::createRendererFromSld ( QDomElement elem,
QGis::GeometryType  geomType 
)
inlineoverridevirtual

Reimplemented from QgsRendererV2AbstractMetadata.

Definition at line 144 of file qgsrendererv2registry.h.

◆ createRendererWidget()

virtual QgsRendererV2Widget* QgsRendererV2Metadata::createRendererWidget ( QgsVectorLayer layer,
QgsStyleV2 style,
QgsFeatureRendererV2 oldRenderer 
)
inlineoverridevirtual

Return new instance of settings widget for the renderer.

Returns NULL on error.

The oldRenderer argument may refer to previously used renderer (or it is null). If not null, 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(). When using oldRenderer make sure to make a copy of it - it will be deleted afterwards.

Reimplemented from QgsRendererV2AbstractMetadata.

Definition at line 142 of file qgsrendererv2registry.h.

◆ setWidgetFunction()

void QgsRendererV2Metadata::setWidgetFunction ( QgsRendererV2WidgetFunc  f)
inline
Note
not available in python bindings

Definition at line 155 of file qgsrendererv2registry.h.

◆ widgetFunction()

QgsRendererV2WidgetFunc QgsRendererV2Metadata::widgetFunction ( ) const
inline
Note
not available in python bindings

Definition at line 150 of file qgsrendererv2registry.h.

Member Data Documentation

◆ mCreateFromSldFunc

QgsRendererV2CreateFromSldFunc QgsRendererV2Metadata::mCreateFromSldFunc
protected

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

Definition at line 165 of file qgsrendererv2registry.h.

◆ mCreateFunc

QgsRendererV2CreateFunc QgsRendererV2Metadata::mCreateFunc
protected

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

Definition at line 161 of file qgsrendererv2registry.h.

◆ mWidgetFunc

QgsRendererV2WidgetFunc QgsRendererV2Metadata::mWidgetFunc
protected

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

Definition at line 163 of file qgsrendererv2registry.h.


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