Class: QgsMapCanvasAnnotationItem

class qgis.gui.QgsMapCanvasAnnotationItem(annotation: QgsAnnotation, mapCanvas: QgsMapCanvas)

Bases: PyQt5.QtCore.QObject, QgsMapCanvasItem

Constructor for QgsMapCanvasAnnotationItem.

An interactive map canvas item which displays a QgsAnnotation.

New in version 3.0.

Parameters
class MouseMoveAction

Bases: int

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

Returns the item’s annotation.

Return type

QgsAnnotation

boundingRect(self) → QRectF
Return type

QRectF

childEvent()
connectNotify()
contextMenuEvent()
cursorShapeForAction(self, moveAction: QgsMapCanvasAnnotationItem.MouseMoveAction) → Qt.CursorShape

Returns matching cursor shape for a mouse move action.

Parameters

moveAction (QgsMapCanvasAnnotationItem.MouseMoveAction) –

Return type

Qt.CursorShape

customEvent()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
focusInEvent()
focusOutEvent()
hoverEnterEvent()
hoverLeaveEvent()
hoverMoveEvent()
inputMethodEvent()
inputMethodQuery()
isSignalConnected()
itemChange()
keyPressEvent()
keyReleaseEvent()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveActionForPosition(self, pos: Union[QPointF, QPoint]) → QgsMapCanvasAnnotationItem.MouseMoveAction

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

Parameters

pos (Union[QPointF) –

Return type

QgsMapCanvasAnnotationItem.MouseMoveAction

paint(self, painter: QPainter)
Parameters

painter (QPainter) –

prepareGeometryChange()
receivers()
sceneEvent()
sceneEventFilter()
sender()
senderSignalIndex()
setRenderContextVariables()
timerEvent()
updateCanvas()
updateMicroFocus()
updatePosition(self)
wheelEvent()