QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
|
An interactive map canvas item which displays a QgsAnnotation. More...
#include <qgsmapcanvasannotationitem.h>
Public Types | |
enum | MouseMoveAction { NoAction , MoveMapPosition , MoveFramePosition , ResizeFrameUp , ResizeFrameDown , ResizeFrameLeft , ResizeFrameRight , ResizeFrameLeftUp , ResizeFrameRightUp , ResizeFrameLeftDown , ResizeFrameRightDown } |
Mouse actions for interacting with item. More... | |
Public Member Functions | |
QgsMapCanvasAnnotationItem (QgsAnnotation *annotation, QgsMapCanvas *mapCanvas) | |
Constructor for QgsMapCanvasAnnotationItem. More... | |
QgsAnnotation * | annotation () |
Returns the item's annotation. More... | |
const QgsAnnotation * | annotation () const |
Returns the item's annotation. More... | |
QRectF | boundingRect () const override |
Qt::CursorShape | cursorShapeForAction (MouseMoveAction moveAction) const |
Returns matching cursor shape for a mouse move action. More... | |
MouseMoveAction | moveActionForPosition (QPointF pos) const |
Returns the mouse move behavior for a given position in scene coordinates. More... | |
void | paint (QPainter *painter) override |
function to be implemented by derived classes More... | |
void | updatePosition () override |
called on changed extent or resize event to update position of the item More... | |
![]() | |
QRectF | boundingRect () const override |
QgsRectangle | rect () const |
returns canvas item rectangle in map units More... | |
void | setRect (const QgsRectangle &r, bool resetRotation=true) |
sets canvas item rectangle in map units More... | |
QPointF | toCanvasCoordinates (const QgsPointXY &point) const |
transformation from map coordinates to screen coordinates More... | |
QgsPointXY | toMapCoordinates (QPoint point) const |
transformation from screen coordinates to map coordinates More... | |
virtual void | updatePosition () |
called on changed extent or resize event to update position of the item More... | |
Additional Inherited Members | |
![]() | |
QgsMapCanvasItem (QgsMapCanvas *mapCanvas) | |
protected constructor: cannot be constructed directly More... | |
~QgsMapCanvasItem () override | |
virtual void | paint (QPainter *painter)=0 |
function to be implemented by derived classes More... | |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override |
bool | setRenderContextVariables (QPainter *p, QgsRenderContext &context) const |
Sets render context parameters. More... | |
void | updateCanvas () |
schedules map canvas for repaint More... | |
![]() | |
QSizeF | mItemSize |
cached size of the item (to return in boundingRect()) More... | |
QgsMapCanvas * | mMapCanvas = nullptr |
pointer to map canvas More... | |
QgsRectangle | mRect |
cached canvas item rectangle in map coordinates encodes position (xmin,ymax) and size (width/height) used to re-position and re-size the item on zoom/pan while waiting for the renderer to complete. More... | |
double | mRectRotation |
An interactive map canvas item which displays a QgsAnnotation.
Definition at line 39 of file qgsmapcanvasannotationitem.h.
Mouse actions for interacting with item.
Definition at line 58 of file qgsmapcanvasannotationitem.h.
QgsMapCanvasAnnotationItem::QgsMapCanvasAnnotationItem | ( | QgsAnnotation * | annotation, |
QgsMapCanvas * | mapCanvas | ||
) |
Constructor for QgsMapCanvasAnnotationItem.
Definition at line 34 of file qgsmapcanvasannotationitem.cpp.
|
inline |
Returns the item's annotation.
Definition at line 87 of file qgsmapcanvasannotationitem.h.
|
inline |
Returns the item's annotation.
Definition at line 82 of file qgsmapcanvasannotationitem.h.
|
override |
Definition at line 87 of file qgsmapcanvasannotationitem.cpp.
Qt::CursorShape QgsMapCanvasAnnotationItem::cursorShapeForAction | ( | MouseMoveAction | moveAction | ) | const |
Returns matching cursor shape for a mouse move action.
Definition at line 278 of file qgsmapcanvasannotationitem.cpp.
QgsMapCanvasAnnotationItem::MouseMoveAction QgsMapCanvasAnnotationItem::moveActionForPosition | ( | QPointF | pos | ) | const |
Returns the mouse move behavior for a given position in scene coordinates.
Definition at line 204 of file qgsmapcanvasannotationitem.cpp.
|
overridevirtual |
function to be implemented by derived classes
Implements QgsMapCanvasItem.
Definition at line 320 of file qgsmapcanvasannotationitem.cpp.
|
overridevirtual |
called on changed extent or resize event to update position of the item
Reimplemented from QgsMapCanvasItem.
Definition at line 59 of file qgsmapcanvasannotationitem.cpp.