QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
|
Convenience metadata class that uses static functions to create renderer and its widget. More...
#include <qgsrendererregistry.h>
Public Member Functions | |
QgsRendererMetadata (const QString &name, const QString &visibleName, QgsRendererCreateFunc pfCreate, const QIcon &icon=QIcon(), QgsRendererWidgetFunc pfWidget=nullptr, QgsRendererAbstractMetadata::LayerTypes layerTypes=QgsRendererAbstractMetadata::All) | |
Construct metadata. More... | |
QgsRendererMetadata (const QString &name, const QString &visibleName, QgsRendererCreateFunc pfCreate, QgsRendererCreateFromSldFunc pfCreateFromSld, const QIcon &icon=QIcon(), QgsRendererWidgetFunc pfWidget=nullptr, QgsRendererAbstractMetadata::LayerTypes layerTypes=QgsRendererAbstractMetadata::All) | |
QgsRendererAbstractMetadata::LayerTypes | compatibleLayerTypes () const override |
Returns flags indicating the types of layer the renderer is compatible with. More... | |
QgsRendererCreateFromSldFunc | createFromSldFunction () const |
QgsRendererCreateFunc | createFunction () const |
QgsFeatureRenderer * | createRenderer (QDomElement &elem, const QgsReadWriteContext &context) override |
Returns new instance of the renderer given the DOM element. More... | |
QgsFeatureRenderer * | createRendererFromSld (QDomElement &elem, Qgis::GeometryType geomType) override |
Returns a new instance of the renderer, converted from an SLD XML element. More... | |
QgsRendererWidget * | createRendererWidget (QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer) override |
Returns new instance of settings widget for the renderer. More... | |
void | setWidgetFunction (QgsRendererWidgetFunc f) |
QgsRendererWidgetFunc | widgetFunction () const |
![]() | |
QgsRendererAbstractMetadata (const QString &name, const QString &visibleName, const QIcon &icon=QIcon()) | |
Constructor for QgsRendererAbstractMetadata, with the specified name. More... | |
virtual | ~QgsRendererAbstractMetadata ()=default |
virtual QgsRendererAbstractMetadata::LayerTypes | compatibleLayerTypes () const |
Returns flags indicating the types of layer the renderer is compatible with. More... | |
virtual QgsFeatureRenderer * | createRenderer (QDomElement &elem, const QgsReadWriteContext &context)=0 |
Returns new instance of the renderer given the DOM element. More... | |
virtual QgsFeatureRenderer * | createRendererFromSld (QDomElement &elem, Qgis::GeometryType geomType) |
Returns a new instance of the renderer, converted from an SLD XML element. More... | |
virtual QgsRendererWidget * | createRendererWidget (QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *oldRenderer) |
Returns new instance of settings widget for the renderer. More... | |
QIcon | icon () const |
Returns an icon representing the renderer. More... | |
QString | name () const |
Returns the unique name of the renderer. More... | |
void | setIcon (const QIcon &icon) |
Sets an icon representing the renderer. More... | |
QString | visibleName () const |
Returns a friendly display name of the renderer. More... | |
Protected Attributes | |
QgsRendererCreateFromSldFunc | mCreateFromSldFunc |
pointer to function that creates an instance of the renderer from SLD More... | |
QgsRendererCreateFunc | mCreateFunc |
pointer to function that creates an instance of the renderer when loading project / style More... | |
QgsRendererWidgetFunc | mWidgetFunc |
pointer to function that creates a widget for configuration of renderer's params More... | |
![]() | |
QIcon | mIcon |
icon to be shown in the renderer properties dialog More... | |
QString | mName |
name used within QGIS for identification (the same what renderer's type() returns) More... | |
QString | mVisibleName |
name visible for users (translatable) More... | |
Additional Inherited Members | |
![]() | |
enum | LayerType { PointLayer = 1 , LineLayer = 2 , PolygonLayer = 4 , All = PointLayer | LineLayer | PolygonLayer } |
Layer types the renderer is compatible with. More... | |
Convenience metadata class that uses static functions to create renderer and its widget.
Definition at line 145 of file qgsrendererregistry.h.
|
inline |
Construct metadata.
Definition at line 153 of file qgsrendererregistry.h.
|
inline |
Definition at line 167 of file qgsrendererregistry.h.
|
inlineoverridevirtual |
Returns flags indicating the types of layer the renderer is compatible with.
Reimplemented from QgsRendererAbstractMetadata.
Definition at line 198 of file qgsrendererregistry.h.
|
inline |
Definition at line 193 of file qgsrendererregistry.h.
|
inline |
Definition at line 189 of file qgsrendererregistry.h.
|
inlineoverridevirtual |
Returns new instance of the renderer given the DOM element.
Returns nullptr
on error. Pure virtual function: must be implemented in derived classes.
Implements QgsRendererAbstractMetadata.
Definition at line 181 of file qgsrendererregistry.h.
|
inlineoverridevirtual |
Returns a new instance of the renderer, converted from an SLD XML element.
Reimplemented from QgsRendererAbstractMetadata.
Definition at line 185 of file qgsrendererregistry.h.
|
inlineoverridevirtual |
Returns new instance of settings widget for the renderer.
Returns nullptr
on error.
The oldRenderer argument may refer to previously used renderer (or it is nullptr
). If not nullptr
, it may be used to initialize GUI of the widget from the previous settings. The old renderer does not have to be of the same type as returned by createRenderer().
Reimplemented from QgsRendererAbstractMetadata.
Definition at line 183 of file qgsrendererregistry.h.
|
inline |
Definition at line 196 of file qgsrendererregistry.h.
|
inline |
Definition at line 191 of file qgsrendererregistry.h.
|
protected |
pointer to function that creates an instance of the renderer from SLD
Definition at line 206 of file qgsrendererregistry.h.
|
protected |
pointer to function that creates an instance of the renderer when loading project / style
Definition at line 202 of file qgsrendererregistry.h.
|
protected |
pointer to function that creates a widget for configuration of renderer's params
Definition at line 204 of file qgsrendererregistry.h.