Class: QgsMapCanvasAnnotationItem¶
An interactive map canvas item which displays a
QgsAnnotation
.
Class Hierarchy¶
Base classes¶
An abstract class for items that can be placed on the map canvas. |
|
Methods
Returns the item's annotation. |
|
Returns matching cursor shape for a mouse move action. |
|
Returns the mouse move behavior for a given position in scene coordinates |
Attributes
- class qgis.gui.QgsMapCanvasAnnotationItem[source]¶
Bases:
QObject
,QgsMapCanvasItem
- __init__(annotation: QgsAnnotation | None, mapCanvas: QgsMapCanvas | None)
Constructor for QgsMapCanvasAnnotationItem.
- Parameters:
annotation (Optional[QgsAnnotation])
mapCanvas (Optional[QgsMapCanvas])
- 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 [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 | QPoint) QgsMapCanvasAnnotationItem.MouseMoveAction [source]¶
Returns the mouse move behavior for a given position in scene coordinates
- Parameters:
pos (Union[QPointF, QPoint])
- Return type: