Class: QgsMapCanvasAnnotationItem¶
- class qgis.gui.QgsMapCanvasAnnotationItem¶
Bases:
PyQt5.QtCore.QObject
,QgsMapCanvasItem
An interactive map canvas item which displays a
QgsAnnotation
.QgsMapCanvasAnnotationItem(annotation:
QgsAnnotation
, mapCanvas: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
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 ¶
Returns the item’s annotation.
- Return type:
- boundingRect(self) QRectF ¶
- Return type:
QRectF
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QGraphicsSceneContextMenuEvent)¶
- 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, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- dragEnterEvent(self, QGraphicsSceneDragDropEvent)¶
- dragLeaveEvent(self, QGraphicsSceneDragDropEvent)¶
- dragMoveEvent(self, QGraphicsSceneDragDropEvent)¶
- dropEvent(self, QGraphicsSceneDragDropEvent)¶
- focusInEvent(self, QFocusEvent)¶
- focusOutEvent(self, QFocusEvent)¶
- hoverEnterEvent(self, QGraphicsSceneHoverEvent)¶
- hoverLeaveEvent(self, QGraphicsSceneHoverEvent)¶
- hoverMoveEvent(self, QGraphicsSceneHoverEvent)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- inputMethodQuery(self, Qt.InputMethodQuery) Any ¶
- isSignalConnected(self, QMetaMethod) bool ¶
- itemChange(self, QGraphicsItem.GraphicsItemChange, Any) Any ¶
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- mouseDoubleClickEvent(self, QGraphicsSceneMouseEvent)¶
- mouseMoveEvent(self, QGraphicsSceneMouseEvent)¶
- mousePressEvent(self, QGraphicsSceneMouseEvent)¶
- mouseReleaseEvent(self, QGraphicsSceneMouseEvent)¶
- 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)¶
- Parameters:
painter (QPainter) –
- prepareGeometryChange(self)¶
- receivers(self, PYQT_SIGNAL) int ¶
- sceneEvent(self, QEvent) bool ¶
- sceneEventFilter(self, QGraphicsItem, QEvent) bool ¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setRenderContextVariables(self, p: QPainter, context: QgsRenderContext) bool ¶
Sets render context parameters
- Parameters:
p – painter for rendering
context – out: configured context
- Returns:
True
in case of success
- timerEvent(self, QTimerEvent)¶
- updateCanvas(self)¶
schedules map canvas for repaint
- updateMicroFocus(self)¶
- updatePosition(self)¶
- wheelEvent(self, QGraphicsSceneWheelEvent)¶