QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
15 #ifndef QGSRENDERERREGISTRY_H
16 #define QGSRENDERERREGISTRY_H
18 #include "qgis_core.h"
22 #include <QStringList>
23 #include <QDomElement>
54 All = PointLayer | LineLayer | PolygonLayer,
56 Q_DECLARE_FLAGS( LayerTypes, LayerType )
67 , mVisibleName( visibleName )
76 QString
name()
const {
return mName; }
88 QIcon
icon()
const {
return mIcon; }
94 void setIcon(
const QIcon &icon ) { mIcon = icon; }
116 { Q_UNUSED( layer ) Q_UNUSED( style ); Q_UNUSED( oldRenderer );
return nullptr; }
119 { Q_UNUSED( elem ) Q_UNUSED( geomType );
return nullptr; }
151 const QString &visibleName,
153 const QIcon &icon = QIcon(),
157 , mCreateFunc( pfCreate )
158 , mWidgetFunc( pfWidget )
159 , mCreateFromSldFunc(
nullptr )
160 , mLayerTypes( layerTypes )
165 const QString &visibleName,
168 const QIcon &icon = QIcon(),
172 , mCreateFunc( pfCreate )
173 , mWidgetFunc( pfWidget )
174 , mCreateFromSldFunc( pfCreateFromSld )
175 , mLayerTypes( layerTypes )
179 {
return mCreateFunc ? mCreateFunc( elem, context ) :
nullptr; }
181 {
return mWidgetFunc ? mWidgetFunc( layer, style, renderer ) :
nullptr; }
183 {
return mCreateFromSldFunc ? mCreateFromSldFunc( elem, geomType ) :
nullptr; }
210 QgsRendererAbstractMetadata::LayerTypes mLayerTypes;
250 bool removeRenderer(
const QString &rendererName );
277 QMap<QString, QgsRendererAbstractMetadata *> mRenderers;
280 QStringList mRenderersOrder;
283 #endif // QGSRENDERERREGISTRY_H
The class is used as a container of context for various read/write operations on other objects.
QgsRendererWidget *(* QgsRendererWidgetFunc)(QgsVectorLayer *, QgsStyle *, QgsFeatureRenderer *)
QgsRendererRegistry(const QgsRendererRegistry &rh)=delete
QgsRendererRegistry cannot be copied.
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Represents a vector layer which manages a vector based data sets.
Handles storage of information regarding WKB types and their properties.
QgsRendererRegistry & operator=(const QgsRendererRegistry &rh)=delete
QgsRendererRegistry cannot be copied.
QgsFeatureRenderer *(* QgsRendererCreateFunc)(QDomElement &, const QgsReadWriteContext &)
QgsFeatureRenderer *(* QgsRendererCreateFromSldFunc)(QDomElement &, QgsWkbTypes::GeometryType geomType)