Class: QgsMapDecoration

Interface for map decorations.

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: render()

Abstract Methods

render

Renders a map decoration.

Methods

displayName

Returns the map decoration display name.

setDisplayName

Sets the map decoration display name.

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsMapDecoration. See the FAQ for more details.

hasFixedMapPosition

Returns True if the decoration is attached to a fixed map position (e.g grid, layout extent), or False if the annotation uses a position relative to the map canvas (e.g. title, copyright...).

class qgis.core.QgsMapDecoration[source]

Bases: object

displayName(self) str[source]

Returns the map decoration display name.

Added in version 3.14.

Return type:

str

virtual hasFixedMapPosition(self) bool[source]

Returns True if the decoration is attached to a fixed map position (e.g grid, layout extent), or False if the annotation uses a position relative to the map canvas (e.g. title, copyright…)

Added in version 3.34.

Return type:

bool

abstract render(self, mapSettings: QgsMapSettings, context: QgsRenderContext)[source]

Renders a map decoration.

Parameters:
setDisplayName(self, name: str | None)[source]

Sets the map decoration display name.

Added in version 3.14.

Parameters:

name (Optional[str])