QGIS API Documentation  2.15.0-Master (02a0ebe)
Public Types | Public Member Functions | Protected Attributes | List of all members
QgsRendererV2AbstractMetadata Class Referenceabstract

Stores metadata about one renderer class. More...

#include <qgsrendererv2registry.h>

Inheritance diagram for QgsRendererV2AbstractMetadata:
Inheritance graph
[legend]

Public Types

enum  LayerType { PointLayer = 1, LineLayer = 2, PolygonLayer = 4, All = PointLayer | LineLayer | PolygonLayer }
 Layer types the renderer is compatible with. More...
 

Public Member Functions

 QgsRendererV2AbstractMetadata (const QString &name, const QString &visibleName, const QIcon &icon=QIcon())
 
virtual ~QgsRendererV2AbstractMetadata ()
 
virtual LayerTypes compatibleLayerTypes () const
 Returns flags indicating the types of layer the renderer is compatible with. More...
 
virtual QgsFeatureRendererV2createRenderer (QDomElement &elem)=0
 Return new instance of the renderer given the DOM element. More...
 
virtual QgsFeatureRendererV2createRendererFromSld (QDomElement &elem, QGis::GeometryType geomType)
 
virtual QgsRendererV2WidgetcreateRendererWidget (QgsVectorLayer *layer, QgsStyleV2 *style, QgsFeatureRendererV2 *oldRenderer)
 Return new instance of settings widget for the renderer. More...
 
QIcon icon () const
 
QString name () const
 
void setIcon (const QIcon &icon)
 
QString visibleName () const
 

Protected Attributes

QIcon mIcon
 icon to be shown in the renderer properties dialog More...
 
QString mName
 name used within QGIS for identification (the same what renderer's type() returns) More...
 
QString mVisibleName
 name visible for users (translatable) More...
 

Detailed Description

Stores metadata about one renderer class.

Note
It's necessary to implement createRenderer() function. In C++ you can use QgsRendererV2Metadata convenience class.

Definition at line 36 of file qgsrendererv2registry.h.

Member Enumeration Documentation

Layer types the renderer is compatible with.

Note
added in QGIS 2.16
Enumerator
PointLayer 

Compatible with point layers.

LineLayer 

Compatible with line layers.

PolygonLayer 

Compatible with polygon layers.

All 

Compatible with all vector layers.

Definition at line 42 of file qgsrendererv2registry.h.

Constructor & Destructor Documentation

QgsRendererV2AbstractMetadata::QgsRendererV2AbstractMetadata ( const QString name,
const QString visibleName,
const QIcon icon = QIcon() 
)
inline

Definition at line 51 of file qgsrendererv2registry.h.

virtual QgsRendererV2AbstractMetadata::~QgsRendererV2AbstractMetadata ( )
inlinevirtual

Definition at line 56 of file qgsrendererv2registry.h.

Member Function Documentation

virtual LayerTypes QgsRendererV2AbstractMetadata::compatibleLayerTypes ( ) const
inlinevirtual

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

Note
added in QGIS 2.16

Reimplemented in QgsRendererV2Metadata.

Definition at line 67 of file qgsrendererv2registry.h.

virtual QgsFeatureRendererV2* QgsRendererV2AbstractMetadata::createRenderer ( QDomElement elem)
pure virtual

Return new instance of the renderer given the DOM element.

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

Implemented in QgsRendererV2Metadata.

virtual QgsFeatureRendererV2* QgsRendererV2AbstractMetadata::createRendererFromSld ( QDomElement elem,
QGis::GeometryType  geomType 
)
inlinevirtual

Reimplemented in QgsRendererV2Metadata.

Definition at line 82 of file qgsrendererv2registry.h.

virtual QgsRendererV2Widget* QgsRendererV2AbstractMetadata::createRendererWidget ( QgsVectorLayer layer,
QgsStyleV2 style,
QgsFeatureRendererV2 oldRenderer 
)
inlinevirtual

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 in QgsRendererV2Metadata.

Definition at line 79 of file qgsrendererv2registry.h.

QIcon QgsRendererV2AbstractMetadata::icon ( ) const
inline

Definition at line 61 of file qgsrendererv2registry.h.

QString QgsRendererV2AbstractMetadata::name ( ) const
inline

Definition at line 58 of file qgsrendererv2registry.h.

void QgsRendererV2AbstractMetadata::setIcon ( const QIcon icon)
inline

Definition at line 62 of file qgsrendererv2registry.h.

QString QgsRendererV2AbstractMetadata::visibleName ( ) const
inline

Definition at line 59 of file qgsrendererv2registry.h.

Member Data Documentation

QIcon QgsRendererV2AbstractMetadata::mIcon
protected

icon to be shown in the renderer properties dialog

Definition at line 91 of file qgsrendererv2registry.h.

QString QgsRendererV2AbstractMetadata::mName
protected

name used within QGIS for identification (the same what renderer's type() returns)

Definition at line 87 of file qgsrendererv2registry.h.

QString QgsRendererV2AbstractMetadata::mVisibleName
protected

name visible for users (translatable)

Definition at line 89 of file qgsrendererv2registry.h.


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