15 #ifndef QGSRENDERERREGISTRY_H 16 #define QGSRENDERERREGISTRY_H 18 #include "qgis_core.h" 22 #include <QStringList> 23 #include <QDomElement> 54 All = PointLayer | LineLayer | PolygonLayer,
60 , mVisibleName( visibleName )
65 QString
name()
const {
return mName; }
68 QIcon
icon()
const {
return mIcon; }
69 void setIcon(
const QIcon &icon ) { mIcon = icon; }
91 { Q_UNUSED( layer ) Q_UNUSED( style ); Q_UNUSED( oldRenderer );
return nullptr; }
94 { Q_UNUSED( elem ) Q_UNUSED( geomType );
return nullptr; }
106 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsRendererAbstractMetadata::LayerTypes )
126 const QString &visibleName,
128 const QIcon &icon = QIcon(),
131 : QgsRendererAbstractMetadata( name, visibleName, icon )
132 , mCreateFunc( pfCreate )
133 , mWidgetFunc( pfWidget )
134 , mCreateFromSldFunc(
nullptr )
135 , mLayerTypes( layerTypes )
140 const QString &visibleName,
143 const QIcon &icon = QIcon(),
146 : QgsRendererAbstractMetadata( name, visibleName, icon )
147 , mCreateFunc( pfCreate )
148 , mWidgetFunc( pfWidget )
149 , mCreateFromSldFunc( pfCreateFromSld )
150 , mLayerTypes( layerTypes )
154 {
return mCreateFunc ? mCreateFunc( elem, context ) :
nullptr; }
156 {
return mWidgetFunc ? mWidgetFunc( layer, style, renderer ) :
nullptr; }
158 {
return mCreateFromSldFunc ? mCreateFromSldFunc( elem, geomType ) :
nullptr; }
185 QgsRendererAbstractMetadata::LayerTypes mLayerTypes;
217 bool addRenderer( QgsRendererAbstractMetadata *metadata
SIP_TRANSFER );
225 bool removeRenderer(
const QString &rendererName );
231 QgsRendererAbstractMetadata *rendererMetadata(
const QString &rendererName );
244 QStringList renderersList(
const QgsVectorLayer *layer )
const;
252 QMap<QString, QgsRendererAbstractMetadata *> mRenderers;
255 QStringList mRenderersOrder;
258 #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)