Class: QgsLayoutItemMarker

A layout item for showing marker symbols.

Added in version 3.14.

Class Hierarchy

Inheritance diagram of qgis.core.QgsLayoutItemMarker

Base classes

QgsLayoutItem

Base class for graphical items within a QgsLayout.

QgsLayoutObject

A base class for objects which belong to a layout.

QObject

QgsExpressionContextGenerator

Abstract interface for generating an expression context.

QGraphicsRectItem

QAbstractGraphicsShapeItem

QGraphicsItem

QgsLayoutUndoObjectInterface

Interface for layout objects which support undo/redo commands.

Methods

linkedMap

Returns the linked rotation map, if set.

northArrowRotation

When the marker is linked to a map in north arrow rotation mode, returns the current north arrow rotation for the marker.

northMode

Returns the mode used to align the marker to a map's North.

northOffset

Returns the offset added to the marker's rotation from a map's North.

setLinkedMap

Sets the map object for rotation.

setNorthMode

Sets the mode used to align the marker to a map's North.

setNorthOffset

Sets the offset added to the marker's rotation from a map's North.

setSymbol

Sets the marker symbol used to draw the shape.

symbol

Returns the marker symbol used to draw the shape.

Static Methods

create

Returns a new marker item for the specified layout.

class qgis.core.QgsLayoutItemMarker[source]

Bases: QgsLayoutItem

__init__(layout: QgsLayout | None)

Constructor for QgsLayoutItemMarker, with the specified parent layout.

Parameters:

layout (Optional[QgsLayout])

static create(layout: QgsLayout | None) QgsLayoutItemMarker | None[source]

Returns a new marker item for the specified layout.

The caller takes responsibility for deleting the returned object.

Parameters:

layout (Optional[QgsLayout])

Return type:

Optional[QgsLayoutItemMarker]

linkedMap(self) QgsLayoutItemMap | None[source]

Returns the linked rotation map, if set. An None means map rotation is disabled. If this is set then the marker is rotated by the same amount as the specified map object.

See also

setLinkedMap()

Return type:

Optional[QgsLayoutItemMap]

northArrowRotation(self) float[source]

When the marker is linked to a map in north arrow rotation mode, returns the current north arrow rotation for the marker.

See also

setLinkedMap()

Return type:

float

northMode(self) QgsLayoutNorthArrowHandler.NorthMode[source]

Returns the mode used to align the marker to a map’s North.

See also

setNorthMode()

See also

northOffset()

Return type:

QgsLayoutNorthArrowHandler.NorthMode

northOffset(self) float[source]

Returns the offset added to the marker’s rotation from a map’s North.

See also

setNorthOffset()

See also

northMode()

Return type:

float

setLinkedMap(self, map: QgsLayoutItemMap | None)[source]

Sets the map object for rotation.

If this is set then the marker will be rotated by the same amount as the specified map object. This is useful especially for syncing north arrows with a map item.

See also

linkedMap()

Parameters:

map (Optional[QgsLayoutItemMap])

setNorthMode(self, mode: QgsLayoutNorthArrowHandler.NorthMode)[source]

Sets the mode used to align the marker to a map’s North.

See also

northMode()

See also

setNorthOffset()

Parameters:

mode (QgsLayoutNorthArrowHandler.NorthMode)

setNorthOffset(self, offset: float)[source]

Sets the offset added to the marker’s rotation from a map’s North.

See also

northOffset()

See also

setNorthMode()

Parameters:

offset (float)

setSymbol(self, symbol: QgsMarkerSymbol | None)[source]

Sets the marker symbol used to draw the shape. Ownership is transferred.

See also

symbol()

Parameters:

symbol (Optional[QgsMarkerSymbol])

symbol(self) QgsMarkerSymbol | None[source]

Returns the marker symbol used to draw the shape.

See also

setSymbol()

Return type:

Optional[QgsMarkerSymbol]