2
class QgsMapCanvasItem : QGraphicsItem
5
#include <qgsmapcanvasitem.h>
10
//! protected constructor: cannot be constructed directly
11
QgsMapCanvasItem(QgsMapCanvas* mapCanvas /TransferThis/);
13
virtual ~QgsMapCanvasItem();
15
//! function to be implemented by derived classes
16
virtual void paint(QPainter * painter) = 0;
18
//! paint function called by map canvas
19
virtual void paint(QPainter * painter,
20
const QStyleOptionGraphicsItem * option,
21
QWidget * widget = 0);
23
//! schedules map canvas for repaint
29
//! called on changed extent or resize event to update position of the item
30
virtual void updatePosition();
32
//! default implementation for canvas items
33
virtual QRectF boundingRect() const;
35
//! sets current offset, to be called from QgsMapCanvas
36
void setPanningOffset(const QPoint& point);
38
//! returns canvas item rectangle
39
QgsRectangle rect() const;
41
//! sets canvas item rectangle
42
void setRect(const QgsRectangle& r);
44
//! transformation from screen coordinates to map coordinates
45
QgsPoint toMapCoordinates(const QPoint& point);
47
//! transformation from map coordinates to screen coordinates
48
QPointF toCanvasCoordinates(const QgsPoint& point);