Class: QgsMapCanvasAnnotationItem

An interactive map canvas item which displays a QgsAnnotation.

List of all members, including inherited members

Class Hierarchy

Inheritance diagram of qgis.gui.QgsMapCanvasAnnotationItem

Base classes

QObject

QgsMapCanvasItem

An abstract class for items that can be placed on the map canvas.

QGraphicsItem

Enums

MouseMoveAction

Methods

annotation

Returns the item's annotation.

cursorShapeForAction

Returns matching cursor shape for a mouse move action.

moveActionForPosition

Returns the mouse move behavior for a given position in scene coordinates

class qgis.gui.QgsMapCanvasAnnotationItem[source]

Bases: QObject, QgsMapCanvasItem

__init__(annotation: QgsAnnotation | None, mapCanvas: QgsMapCanvas | None)

Constructor for QgsMapCanvasAnnotationItem.

Parameters:
class MouseMoveAction(*values)

Bases: IntEnum

MoveFramePosition = 2
MoveMapPosition = 1
NoAction = 0
ResizeFrameDown = 4
ResizeFrameLeft = 5
ResizeFrameLeftDown = 9
ResizeFrameLeftUp = 7
ResizeFrameRight = 6
ResizeFrameRightDown = 10
ResizeFrameRightUp = 8
ResizeFrameUp = 3
MoveFramePosition = 2
MoveMapPosition = 1
NoAction = 0
ResizeFrameDown = 4
ResizeFrameLeft = 5
ResizeFrameLeftDown = 9
ResizeFrameLeftUp = 7
ResizeFrameRight = 6
ResizeFrameRightDown = 10
ResizeFrameRightUp = 8
ResizeFrameUp = 3
annotation(self) QgsAnnotation | None[source]

Returns the item’s annotation.

Return type:

Optional[QgsAnnotation]

cursorShapeForAction(self, moveAction: QgsMapCanvasAnnotationItem.MouseMoveAction) Qt.CursorShape[source]

Returns matching cursor shape for a mouse move action.

Parameters:

moveAction (QgsMapCanvasAnnotationItem.MouseMoveAction)

Return type:

Qt.CursorShape

moveActionForPosition(self, pos: QPointF) QgsMapCanvasAnnotationItem.MouseMoveAction[source]

Returns the mouse move behavior for a given position in scene coordinates

Parameters:

pos (QPointF)

Return type:

QgsMapCanvasAnnotationItem.MouseMoveAction