15 #ifndef QGSRENDERERV2REGISTRY_H 16 #define QGSRENDERERV2REGISTRY_H 20 #include <QStringList> 21 #include <QDomElement> 47 All = PointLayer | LineLayer | PolygonLayer,
53 , mVisibleName( visibleName )
80 { Q_UNUSED( layer ); Q_UNUSED( style ); Q_UNUSED( oldRenderer );
return nullptr; }
83 { Q_UNUSED( elem ); Q_UNUSED( geomType );
return nullptr; }
95 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsRendererV2AbstractMetadata::LayerTypes )
117 : QgsRendererV2AbstractMetadata( name, visibleName, icon )
118 , mCreateFunc( pfCreate )
119 , mWidgetFunc( pfWidget )
120 , mCreateFromSldFunc(
nullptr )
121 , mLayerTypes( layerTypes )
132 : QgsRendererV2AbstractMetadata( name, visibleName, icon )
133 , mCreateFunc( pfCreate )
134 , mWidgetFunc( pfWidget )
135 , mCreateFromSldFunc( pfCreateFromSld )
136 , mLayerTypes( layerTypes )
141 virtual QgsFeatureRendererV2*
createRenderer( QDomElement& elem )
override {
return mCreateFunc ? mCreateFunc( elem ) :
nullptr; }
143 {
return mWidgetFunc ? mWidgetFunc( layer, style, renderer ) :
nullptr; }
145 {
return mCreateFromSldFunc ? mCreateFromSldFunc( elem, geomType ) :
nullptr; }
157 virtual QgsRendererV2AbstractMetadata::LayerTypes
compatibleLayerTypes()
const override {
return mLayerTypes; }
169 QgsRendererV2AbstractMetadata::LayerTypes mLayerTypes;
191 bool addRenderer( QgsRendererV2AbstractMetadata* metadata );
197 bool removeRenderer(
const QString& rendererName );
201 QgsRendererV2AbstractMetadata* rendererMetadata(
const QString& rendererName );
210 QStringList renderersList(
const QgsVectorLayer* layer )
const;
228 #endif // QGSRENDERERV2REGISTRY_H QgsFeatureRendererV2 *(* QgsRendererV2CreateFromSldFunc)(QDomElement &, QGis::GeometryType geomType)
QMap< QString, QgsRendererV2AbstractMetadata * > mRenderers
Map of name to renderer.
QgsFeatureRendererV2 *(* QgsRendererV2CreateFunc)(QDomElement &)
The QGis class provides global constants for use throughout the application.
QStringList mRenderersOrder
List of renderers, maintained in the order that they have been added.
Represents a vector layer which manages a vector based data sets.
QgsRendererV2Widget *(* QgsRendererV2WidgetFunc)(QgsVectorLayer *, QgsStyleV2 *, QgsFeatureRendererV2 *)