Class: QgsMapCanvasAnnotationItem¶
- class qgis.gui.QgsMapCanvasAnnotationItem¶
Bases:
PyQt5.QtCore.QObject
,QgsMapCanvasItem
An interactive map canvas item which displays a
QgsAnnotation
.QgsMapCanvasAnnotationItem(annotation: Optional[QgsAnnotation], mapCanvas: Optional[QgsMapCanvas]) Constructor for QgsMapCanvasAnnotationItem.
Methods
Returns the item's annotation.
- rtype:
QRectF
Returns matching cursor shape for a mouse move action.
Returns the mouse move behavior for a given position in scene coordinates
- param painter:
Sets render context parameters
schedules map canvas for repaint
Signals
Attributes
- 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 | None ¶
Returns the item’s annotation.
- Return type:
Optional[QgsAnnotation]
- boundingRect(self) QRectF ¶
- Return type:
QRectF
- childEvent(self, a0: QChildEvent | None)¶
- connectNotify(self, signal: QMetaMethod)¶
- contextMenuEvent(self, event: QGraphicsSceneContextMenuEvent | None)¶
- 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(self, a0: QEvent | None)¶
- disconnectNotify(self, signal: QMetaMethod)¶
- dragEnterEvent(self, event: QGraphicsSceneDragDropEvent | None)¶
- dragLeaveEvent(self, event: QGraphicsSceneDragDropEvent | None)¶
- dragMoveEvent(self, event: QGraphicsSceneDragDropEvent | None)¶
- dropEvent(self, event: QGraphicsSceneDragDropEvent | None)¶
- focusInEvent(self, event: QFocusEvent | None)¶
- focusOutEvent(self, event: QFocusEvent | None)¶
- hoverEnterEvent(self, event: QGraphicsSceneHoverEvent | None)¶
- hoverLeaveEvent(self, event: QGraphicsSceneHoverEvent | None)¶
- hoverMoveEvent(self, event: QGraphicsSceneHoverEvent | None)¶
- inputMethodEvent(self, event: QInputMethodEvent | None)¶
- inputMethodQuery(self, query: Qt.InputMethodQuery) Any ¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- itemChange(self, change: QGraphicsItem.GraphicsItemChange, value: Any) Any ¶
- keyPressEvent(self, event: QKeyEvent | None)¶
- keyReleaseEvent(self, event: QKeyEvent | None)¶
- mouseDoubleClickEvent(self, event: QGraphicsSceneMouseEvent | None)¶
- mouseMoveEvent(self, event: QGraphicsSceneMouseEvent | None)¶
- mousePressEvent(self, event: QGraphicsSceneMouseEvent | None)¶
- mouseReleaseEvent(self, event: QGraphicsSceneMouseEvent | None)¶
- moveActionForPosition(self, pos: QPointF | QPoint) QgsMapCanvasAnnotationItem.MouseMoveAction ¶
Returns the mouse move behavior for a given position in scene coordinates
- Parameters:
pos (Union[QPointF)
- Return type:
- paint(self, painter: QPainter | None)¶
- Parameters:
painter (Optional[QPainter])
- prepareGeometryChange(self)¶
- receivers(self, signal: PYQT_SIGNAL) int ¶
- sceneEvent(self, event: QEvent | None) bool ¶
- sceneEventFilter(self, watched: QGraphicsItem | None, event: QEvent | None) bool ¶
- sender(self) QObject | None ¶
- senderSignalIndex(self) int ¶
- setRenderContextVariables(self, p: QPainter | None, context: QgsRenderContext) bool ¶
Sets render context parameters
- Parameters:
p – painter for rendering
context – out: configured context
- Returns:
True
in case of success
- timerEvent(self, a0: QTimerEvent | None)¶
- updateCanvas(self)¶
schedules map canvas for repaint
- updateMicroFocus(self)¶
- updatePosition(self)¶
- wheelEvent(self, event: QGraphicsSceneWheelEvent | None)¶