Class: QgsRendererAbstractMetadata

class qgis.core.QgsRendererAbstractMetadata(name: str, visibleName: str, icon: QIcon = QIcon())

Bases: sip.wrapper

Constructor for QgsRendererAbstractMetadata, with the specified name.

The visibleName argument gives a translated, user friendly string identifying the renderer type.

The icon argument can be used to specify an icon representing the renderer.

QgsRendererAbstractMetadata(QgsRendererAbstractMetadata)

Stores metadata about one renderer class.

Note

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

Enums

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

Returns an icon representing the renderer.

name

Returns the unique name of the renderer.

setIcon

Sets an icon representing the renderer.

visibleName

Returns a friendly display name of the renderer.

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 None 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 None on error.

The oldRenderer argument may refer to previously used renderer (or it is None). If not None, 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().

icon(self) → QIcon

Returns an icon representing the renderer.

See also

setIcon()

name(self) → str

Returns the unique name of the renderer. This value is not translated.

See also

visibleName()

setIcon(self, icon: QIcon)

Sets an icon representing the renderer.

See also

icon()

visibleName(self) → str

Returns a friendly display name of the renderer. This value is translated.

See also

name()