15 #ifndef QGSRENDERERREGISTRY_H 16 #define QGSRENDERERREGISTRY_H 18 #include "qgis_core.h" 22 #include <QStringList> 23 #include <QDomElement> 54 All = PointLayer | LineLayer | PolygonLayer,
67 , mVisibleName( visibleName )
76 QString
name()
const {
return mName; }
88 QIcon
icon()
const {
return mIcon; }
94 void setIcon(
const QIcon &icon ) { mIcon = icon; }
115 { Q_UNUSED( layer ) Q_UNUSED( style ); Q_UNUSED( oldRenderer );
return nullptr; }
118 { Q_UNUSED( elem ) Q_UNUSED( geomType );
return nullptr; }
130 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsRendererAbstractMetadata::LayerTypes )
150 const QString &visibleName,
152 const QIcon &icon = QIcon(),
155 : QgsRendererAbstractMetadata( name, visibleName, icon )
156 , mCreateFunc( pfCreate )
157 , mWidgetFunc( pfWidget )
158 , mCreateFromSldFunc(
nullptr )
159 , mLayerTypes( layerTypes )
164 const QString &visibleName,
167 const QIcon &icon = QIcon(),
170 : QgsRendererAbstractMetadata( name, visibleName, icon )
171 , mCreateFunc( pfCreate )
172 , mWidgetFunc( pfWidget )
173 , mCreateFromSldFunc( pfCreateFromSld )
174 , mLayerTypes( layerTypes )
178 {
return mCreateFunc ? mCreateFunc( elem, context ) :
nullptr; }
180 {
return mWidgetFunc ? mWidgetFunc( layer, style, renderer ) :
nullptr; }
182 {
return mCreateFromSldFunc ? mCreateFromSldFunc( elem, geomType ) :
nullptr; }
209 QgsRendererAbstractMetadata::LayerTypes mLayerTypes;
241 bool addRenderer( QgsRendererAbstractMetadata *metadata
SIP_TRANSFER );
249 bool removeRenderer(
const QString &rendererName );
255 QgsRendererAbstractMetadata *rendererMetadata(
const QString &rendererName );
268 QStringList renderersList(
const QgsVectorLayer *layer )
const;
276 QMap<QString, QgsRendererAbstractMetadata *> mRenderers;
279 QStringList mRenderersOrder;
282 #endif // QGSRENDERERREGISTRY_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)