15 #ifndef QGSRENDERERV2REGISTRY_H 16 #define QGSRENDERERV2REGISTRY_H 18 #include "qgis_core.h" 22 #include <QStringList> 23 #include <QDomElement> 53 All = PointLayer | LineLayer | PolygonLayer,
59 , mVisibleName( visibleName )
64 QString
name()
const {
return mName; }
67 QIcon
icon()
const {
return mIcon; }
68 void setIcon(
const QIcon &icon ) { mIcon = icon; }
90 { Q_UNUSED( layer ); Q_UNUSED( style ); Q_UNUSED( oldRenderer );
return nullptr; }
93 { Q_UNUSED( elem ); Q_UNUSED( geomType );
return nullptr; }
105 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsRendererAbstractMetadata::LayerTypes )
125 const QString &visibleName,
127 const QIcon &icon = QIcon(),
130 : QgsRendererAbstractMetadata( name, visibleName, icon )
131 , mCreateFunc( pfCreate )
132 , mWidgetFunc( pfWidget )
133 , mCreateFromSldFunc(
nullptr )
134 , mLayerTypes( layerTypes )
139 const QString &visibleName,
142 const QIcon &icon = QIcon(),
145 : QgsRendererAbstractMetadata( name, visibleName, icon )
146 , mCreateFunc( pfCreate )
147 , mWidgetFunc( pfWidget )
148 , mCreateFromSldFunc( pfCreateFromSld )
149 , mLayerTypes( layerTypes )
153 {
return mCreateFunc ? mCreateFunc( elem, context ) :
nullptr; }
155 {
return mWidgetFunc ? mWidgetFunc( layer, style, renderer ) :
nullptr; }
157 {
return mCreateFromSldFunc ? mCreateFromSldFunc( elem, geomType ) :
nullptr; }
184 QgsRendererAbstractMetadata::LayerTypes mLayerTypes;
216 bool addRenderer( QgsRendererAbstractMetadata *metadata
SIP_TRANSFER );
224 bool removeRenderer(
const QString &rendererName );
230 QgsRendererAbstractMetadata *rendererMetadata(
const QString &rendererName );
243 QStringList renderersList(
const QgsVectorLayer *layer )
const;
251 QMap<QString, QgsRendererAbstractMetadata *> mRenderers;
254 QStringList mRenderersOrder;
257 #endif // QGSRENDERERV2REGISTRY_H The class is used as a container of context for various read/write operations on other objects...
Handles storage of information regarding WKB types and their properties.
QgsRendererWidget *(* QgsRendererWidgetFunc)(QgsVectorLayer *, QgsStyle *, QgsFeatureRenderer *)
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
QgsFeatureRenderer *(* QgsRendererCreateFunc)(QDomElement &, const QgsReadWriteContext &)
Represents a vector layer which manages a vector based data sets.
QgsFeatureRenderer *(* QgsRendererCreateFromSldFunc)(QDomElement &, QgsWkbTypes::GeometryType geomType)