QGIS API Documentation
2.6.0-Brighton
|
An abstract class for items that can be placed on the map canvas. More...
#include <qgsmapcanvasitem.h>
Public Member Functions | |
virtual void | updatePosition () |
called on changed extent or resize event to update position of the item | |
virtual QRectF | boundingRect () const |
default implementation for canvas items | |
Q_DECL_DEPRECATED void | setPanningOffset (const QPoint &point) |
sets current offset, to be called from QgsMapCanvas | |
QgsRectangle | rect () const |
returns canvas item rectangle | |
void | setRect (const QgsRectangle &r) |
sets canvas item rectangle | |
QgsPoint | toMapCoordinates (const QPoint &point) |
transformation from screen coordinates to map coordinates | |
QPointF | toCanvasCoordinates (const QgsPoint &point) |
transformation from map coordinates to screen coordinates |
Protected Member Functions | |
QgsMapCanvasItem (QgsMapCanvas *mapCanvas) | |
protected constructor: cannot be constructed directly | |
virtual | ~QgsMapCanvasItem () |
virtual void | paint (QPainter *painter)=0 |
function to be implemented by derived classes | |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) |
paint function called by map canvas | |
void | updateCanvas () |
schedules map canvas for repaint | |
bool | setRenderContextVariables (QPainter *p, QgsRenderContext &context) const |
Sets render context parameters. |
Protected Attributes | |
QgsMapCanvas * | mMapCanvas |
pointer to map canvas | |
QgsRectangle | mRect |
canvas item rectangle (in map coordinates) | |
QPoint | mPanningOffset |
offset from normal position due current panning operation, used when converting map coordinates to move map canvas items | |
QSizeF | mItemSize |
cached size of the item (to return in boundingRect()) |
An abstract class for items that can be placed on the map canvas.
|
protected |
protected constructor: cannot be constructed directly
|
protectedvirtual |
|
virtual |
default implementation for canvas items
Reimplemented in QgsAnnotationItem, and QgsVertexMarker.
|
protectedpure virtual |
function to be implemented by derived classes
Implemented in QgsRubberBand, QgsHighlight, QgsVertexMarker, QgsMapCanvasMap, QgsTextAnnotationItem, QgsHtmlAnnotationItem, QgsFormAnnotationItem, and QgsSvgAnnotationItem.
|
protectedvirtual |
paint function called by map canvas
Reimplemented in QgsHtmlAnnotationItem, and QgsFormAnnotationItem.
QgsRectangle QgsMapCanvasItem::rect | ( | ) | const |
returns canvas item rectangle
void QgsMapCanvasItem::setPanningOffset | ( | const QPoint & | point | ) |
sets current offset, to be called from QgsMapCanvas
Reimplemented in QgsMapCanvasMap.
void QgsMapCanvasItem::setRect | ( | const QgsRectangle & | r | ) |
sets canvas item rectangle
|
protected |
Sets render context parameters.
p | painter for rendering |
context | out: configured context |
QPointF QgsMapCanvasItem::toCanvasCoordinates | ( | const QgsPoint & | point | ) |
transformation from map coordinates to screen coordinates
QgsPoint QgsMapCanvasItem::toMapCoordinates | ( | const QPoint & | point | ) |
transformation from screen coordinates to map coordinates
|
protected |
schedules map canvas for repaint
|
virtual |
called on changed extent or resize event to update position of the item
Reimplemented in QgsVertexMarker, and QgsAnnotationItem.
|
protected |
cached size of the item (to return in boundingRect())
|
protected |
pointer to map canvas
|
protected |
offset from normal position due current panning operation, used when converting map coordinates to move map canvas items
|
protected |
canvas item rectangle (in map coordinates)