Class: QgsRendererAbstractMetadata

class qgis.core.QgsRendererAbstractMetadata

Bases: sip.wrapper

Stores metadata about one renderer class.

Note

It’s necessary to implement createRenderer() function. In C++ you can use QgsRendererMetadata convenience class.

Methods

compatibleLayerTypes Returns flags indicating the types of layer the renderer is compatible with.
createRenderer Returns new instance of the renderer given the DOM element.
createRendererFromSld
createRendererWidget Returns new instance of settings widget for the renderer.
icon
name
setIcon
visibleName

Signals

Attributes

All
LineLayer
PointLayer
PolygonLayer
All = 7
class LayerType

Bases: int

class LayerTypes

Bases: sip.wrapper

QgsRendererAbstractMetadata.LayerTypes(Union[QgsRendererAbstractMetadata.LayerTypes, QgsRendererAbstractMetadata.LayerType]) QgsRendererAbstractMetadata.LayerTypes(QgsRendererAbstractMetadata.LayerTypes)

LineLayer = 2
PointLayer = 1
PolygonLayer = 4
compatibleLayerTypes(self) → QgsRendererAbstractMetadata.LayerTypes

Returns flags indicating the types of layer the renderer is compatible with.

New in version 2.16.

createRenderer(self, elem: QDomElement, context: QgsReadWriteContext) → QgsFeatureRenderer

Returns new instance of the renderer given the DOM element. Returns NULL on error. Pure virtual function: must be implemented in derived classes. *

createRendererFromSld(self, elem: QDomElement, geomType: QgsWkbTypes.GeometryType) → QgsFeatureRenderer
createRendererWidget(self, layer: QgsVectorLayer, style: QgsStyle, oldRenderer: QgsFeatureRenderer) → QgsRendererWidget

Returns new instance of settings widget for the renderer. Returns NULL on error.

The oldRenderer argument may refer to previously used renderer (or it is null). If not null, 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(). When using oldRenderer make sure to make a copy of it - it will be deleted afterwards.

icon(self) → QIcon
name(self) → str
setIcon(self, icon: QIcon)
visibleName(self) → str