Class: QgsLayoutItemMarker

class qgis.core.QgsLayoutItemMarker

Bases: QgsLayoutItem

A layout item for showing marker symbols.

New in version 3.14.

QgsLayoutItemMarker(layout: QgsLayout) Constructor for QgsLayoutItemMarker, with the specified parent layout.

Methods

accept

param visitor

boundingRect

rtype

QRectF

childEvent

connectNotify

contextMenuEvent

create

Returns a new marker item for the specified layout.

customEvent

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

draw

param context

dropEvent

finalizeRestoreFromXml

fixedSize

rtype

QgsLayoutSize

focusInEvent

focusOutEvent

hoverEnterEvent

hoverLeaveEvent

hoverMoveEvent

icon

rtype

QIcon

inputMethodEvent

inputMethodQuery

isSignalConnected

itemChange

keyPressEvent

keyReleaseEvent

linkedMap

Returns the linked rotation map, if set.

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

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.

prepareGeometryChange

readPropertiesFromElement

param element

receivers

sceneEvent

sceneEventFilter

sender

senderSignalIndex

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.

timerEvent

type

rtype

int

updateMicroFocus

wheelEvent

writePropertiesToElement

param element

accept(self, visitor: QgsStyleEntityVisitorInterface) bool
Parameters

visitor (QgsStyleEntityVisitorInterface) –

Return type

bool

boundingRect(self) QRectF
Return type

QRectF

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QGraphicsSceneContextMenuEvent)
create(layout: QgsLayout) QgsLayoutItemMarker

Returns a new marker item for the specified layout.

The caller takes responsibility for deleting the returned object.

Parameters

layout (QgsLayout) –

Return type

QgsLayoutItemMarker

customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QGraphicsSceneDragDropEvent)
dragLeaveEvent(self, QGraphicsSceneDragDropEvent)
dragMoveEvent(self, QGraphicsSceneDragDropEvent)
draw(self, context: QgsLayoutItemRenderContext)
Parameters

context (QgsLayoutItemRenderContext) –

dropEvent(self, QGraphicsSceneDragDropEvent)
finalizeRestoreFromXml(self)
fixedSize(self) QgsLayoutSize
Return type

QgsLayoutSize

focusInEvent(self, QFocusEvent)
focusOutEvent(self, QFocusEvent)
hoverEnterEvent(self, QGraphicsSceneHoverEvent)
hoverLeaveEvent(self, QGraphicsSceneHoverEvent)
hoverMoveEvent(self, QGraphicsSceneHoverEvent)
icon(self) QIcon
Return type

QIcon

inputMethodEvent(self, QInputMethodEvent)
inputMethodQuery(self, Qt.InputMethodQuery) Any
isSignalConnected(self, QMetaMethod) bool
itemChange(self, QGraphicsItem.GraphicsItemChange, Any) Any
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
linkedMap(self) QgsLayoutItemMap

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

QgsLayoutItemMap

mouseDoubleClickEvent(self, QGraphicsSceneMouseEvent)
mouseMoveEvent(self, QGraphicsSceneMouseEvent)
mousePressEvent(self, QGraphicsSceneMouseEvent)
mouseReleaseEvent(self, QGraphicsSceneMouseEvent)
northArrowRotation(self) float

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

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

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

See also

setNorthOffset()

See also

northMode()

Return type

float

prepareGeometryChange(self)
readPropertiesFromElement(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool
Parameters
Return type

bool

receivers(self, PYQT_SIGNAL) int
sceneEvent(self, QEvent) bool
sceneEventFilter(self, QGraphicsItem, QEvent) bool
sender(self) QObject
senderSignalIndex(self) int
setLinkedMap(self, map: QgsLayoutItemMap)

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 (QgsLayoutItemMap) –

setNorthMode(self, mode: QgsLayoutNorthArrowHandler.NorthMode)

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)

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)

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

See also

symbol()

Parameters

symbol (QgsMarkerSymbol) –

symbol(self) QgsMarkerSymbol

Returns the marker symbol used to draw the shape.

See also

setSymbol()

Return type

QgsMarkerSymbol

timerEvent(self, QTimerEvent)
type(self) int
Return type

int

updateMicroFocus(self)
wheelEvent(self, QGraphicsSceneWheelEvent)
writePropertiesToElement(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool
Parameters
Return type

bool