QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsMapCanvas Class Reference

Map canvas is a class for displaying all GIS data types on a canvas. More...

#include <qgsmapcanvas.h>

Inheritance diagram for QgsMapCanvas:
Inheritance graph
[legend]

Classes

class  CanvasProperties
 

Public Types

enum  WheelAction { WheelZoom, WheelZoomAndRecenter, WheelZoomToMouseCursor, WheelNothing }
 

Public Slots

void refresh ()
 Repaints the canvas map. More...
 
void selectionChangedSlot ()
 Receives signal about selection change, and pass it on with layer info. More...
 
void saveAsImage (QString theFileName, QPixmap *QPixmap=0, QString="PNG")
 Save the convtents of the map canvas to disk as an image. More...
 
void layerStateChange ()
 This slot is connected to the visibility change of one or more layers. More...
 
void setRenderFlag (bool theFlag)
 Whether to suppress rendering or not. More...
 
bool renderFlag ()
 State of render suppression flag. More...
 

Signals

Q_DECL_DEPRECATED void setProgress (int, int)
 Let the owner know how far we are with render operations. More...
 
void xyCoordinates (const QgsPoint &p)
 emits current mouse position More...
 
void scaleChanged (double)
 Emitted when the scale of the map changes. More...
 
void extentsChanged ()
 Emitted when the extents of the map change. More...
 
void renderComplete (QPainter *)
 Emitted when the canvas has rendered. More...
 
void mapCanvasRefreshed ()
 Emitted when canvas finished a refresh request. More...
 
void renderStarting ()
 Emitted when the canvas is about to be rendered. More...
 
void layersChanged ()
 Emitted when a new set of layers has been received. More...
 
void keyPressed (QKeyEvent *e)
 Emit key press event. More...
 
void keyReleased (QKeyEvent *e)
 Emit key release event. More...
 
void mapToolSet (QgsMapTool *tool)
 Emit map tool changed event. More...
 
void mapToolSet (QgsMapTool *newTool, QgsMapTool *oldTool)
 Emit map tool changed with the old tool. More...
 
void selectionChanged (QgsMapLayer *layer)
 Emitted when selection in any layer gets changed. More...
 
void zoomLastStatusChanged (bool)
 Emitted when zoom last status changed. More...
 
void zoomNextStatusChanged (bool)
 Emitted when zoom next status changed. More...
 
void hasCrsTransformEnabledChanged (bool flag)
 Emitted when on-the-fly projection has been turned on/off. More...
 
void destinationCrsChanged ()
 Emitted when map CRS has changed. More...
 
void mapUnitsChanged ()
 Emmitted when map units are changed. More...
 

Public Member Functions

 QgsMapCanvas (QWidget *parent=0, const char *name=0)
 Constructor. More...
 
 ~QgsMapCanvas ()
 Destructor. More...
 
void setLayerSet (QList< QgsMapCanvasLayer > &layers)
 
void setCurrentLayer (QgsMapLayer *layer)
 
void updateOverview ()
 
void enableOverviewMode (QgsMapOverviewCanvas *overview)
 
const QgsMapSettingsmapSettings () const
 Get access to properties used for map rendering. More...
 
void setCrsTransformEnabled (bool enabled)
 sets whether to use projections for this layer set More...
 
void setDestinationCrs (const QgsCoordinateReferenceSystem &crs)
 sets destination coordinate reference system More...
 
const QgsLabelingResultslabelingResults () const
 Get access to the labeling results (may be null) More...
 
void setCachingEnabled (bool enabled)
 Set whether to cache images of rendered layers. More...
 
bool isCachingEnabled () const
 Check whether images of rendered layers are curerently being cached. More...
 
void clearCache ()
 Make sure to remove any rendered images from cache (does nothing if cache is not enabled) More...
 
void setParallelRenderingEnabled (bool enabled)
 Set whether the layers are rendered in parallel or sequentially. More...
 
bool isParallelRenderingEnabled () const
 Check whether the layers are rendered in parallel or sequentially. More...
 
void setMapUpdateInterval (int timeMiliseconds)
 Set how often map preview should be updated while it is being rendered (in milliseconds) More...
 
int mapUpdateInterval () const
 Find out how often map preview should be updated while it is being rendered (in milliseconds) More...
 
QgsMapCanvasMapmap ()
 
Q_DECL_DEPRECATED QgsMapRenderermapRenderer ()
 
Q_DECL_DEPRECATED QPaintDevice & canvasPaintDevice ()
 Accessor for the canvas paint device. More...
 
double scale ()
 Get the last reported scale of the canvas. More...
 
Q_DECL_DEPRECATED void clear ()
 Clear the map canvas. More...
 
double mapUnitsPerPixel () const
 Returns the mapUnitsPerPixel (map units per pixel) for the canvas. More...
 
QgsRectangle extent () const
 Returns the current zoom exent of the map canvas. More...
 
QgsRectangle fullExtent () const
 Returns the combined exent for all layers on the map canvas. More...
 
void setExtent (const QgsRectangle &r)
 Set the extent of the map canvas. More...
 
void zoomToFullExtent ()
 Zoom to the full extent of all layers. More...
 
void zoomToPreviousExtent ()
 Zoom to the previous extent (view) More...
 
void zoomToNextExtent ()
 Zoom to the next extent (view) More...
 
void clearExtentHistory ()
 
void zoomToSelected (QgsVectorLayer *layer=NULL)
 Zoom to the extent of the selected features of current (vector) layer. More...
 
void panToSelected (QgsVectorLayer *layer=NULL)
 Pan to the selected features of current (vector) layer keeping same extent. More...
 
void setMapTool (QgsMapTool *mapTool)
 Sets the map tool currently being used on the canvas. More...
 
void unsetMapTool (QgsMapTool *mapTool)
 Unset the current map tool or last non zoom tool. More...
 
QgsMapToolmapTool ()
 Returns the currently active tool. More...
 
virtual void setCanvasColor (const QColor &_newVal)
 Write property of QColor bgColor. More...
 
virtual QColor canvasColor () const
 Read property of QColor bgColor. More...
 
void setSelectionColor (const QColor &color)
 Set color of selected vector features. More...
 
void updateScale ()
 Emits signal scaleChanged to update scale in main window. More...
 
Q_DECL_DEPRECATED void updateFullExtent ()
 Updates the full extent. More...
 
QgsMapLayerlayer (int index)
 return the map layer at position index in the layer stack More...
 
int layerCount () const
 return number of layers on the map More...
 
QList< QgsMapLayer * > layers () const
 return list of layers within map canvas. Added in v1.5 More...
 
void freeze (bool frz=true)
 
bool isFrozen ()
 
Q_DECL_DEPRECATED void setDirty (bool _dirty)
 Flag the canvas as dirty and needed a refresh. More...
 
Q_DECL_DEPRECATED bool isDirty () const
 Return the state of the canvas (dirty or not) More...
 
void setMapUnits (QGis::UnitType mapUnits)
 Set map units (needed by project properties dialog) More...
 
QGis::UnitType mapUnits () const
 Get the current canvas map units. More...
 
const QgsMapToPixelgetCoordinateTransform ()
 Get the current coordinate transform. More...
 
bool isDrawing ()
 Find out whether rendering is in progress. More...
 
QgsMapLayercurrentLayer ()
 returns current layer (set by legend widget) More...
 
void setWheelAction (WheelAction action, double factor=2)
 set wheel action and zoom factor (should be greater than 1) More...
 
void zoomIn ()
 Zoom in with fixed factor. More...
 
void zoomOut ()
 Zoom out with fixed factor. More...
 
void zoomScale (double scale)
 Zoom to a specific scale. More...
 
void zoomByFactor (double scaleFactor, const QgsPoint *center=0)
 Zoom with the factor supplied. More...
 
void zoomWithCenter (int x, int y, bool zoomIn)
 Zooms in/out with a given center. More...
 
void enableAntiAliasing (bool theFlag)
 used to determine if anti-aliasing is enabled or not More...
 
bool antiAliasingEnabled () const
 true if antialising is enabled More...
 
Q_DECL_DEPRECATED void useImageToRender (bool theFlag)
 Select which Qt class to render with. More...
 
void panActionEnd (QPoint releasePoint)
 Ends pan action and redraws the canvas. More...
 
void panAction (QMouseEvent *event)
 Called when mouse is moving and pan is activated. More...
 
QPoint mouseLastXY ()
 returns last position of mouse cursor More...
 
void setPreviewModeEnabled (bool previewEnabled)
 Enables a preview mode for the map canvas. More...
 
bool previewModeEnabled () const
 Returns whether a preview mode is enabled for the map canvas. More...
 
void setPreviewMode (QgsPreviewEffect::PreviewMode mode)
 Sets a preview mode for the map canvas. More...
 
QgsPreviewEffect::PreviewMode previewMode () const
 Returns the current preview mode for the map canvas. More...
 
bool hasCrsTransformEnabled ()
 A simple helper method to find out if on the fly projections are enabled or not. More...
 
Q_DECL_DEPRECATED void updateMap ()
 
void stopRendering ()
 stop rendering (if there is any right now) More...
 
Q_DECL_DEPRECATED void showError (QgsMapLayer *mapLayer)
 
void readProject (const QDomDocument &)
 called to read map canvas settings from project More...
 
void writeProject (QDomDocument &)
 called to write map canvas settings to project More...
 
void getDatumTransformInfo (const QgsMapLayer *ml, const QString &srcAuthId, const QString &destAuthId)
 ask user about datum transformation More...
 

Protected Member Functions

void keyPressEvent (QKeyEvent *e)
 Overridden key press event. More...
 
void keyReleaseEvent (QKeyEvent *e)
 Overridden key release event. More...
 
void mouseDoubleClickEvent (QMouseEvent *e)
 Overridden mouse double click event. More...
 
void mouseMoveEvent (QMouseEvent *e)
 Overridden mouse move event. More...
 
void mousePressEvent (QMouseEvent *e)
 Overridden mouse press event. More...
 
void mouseReleaseEvent (QMouseEvent *e)
 Overridden mouse release event. More...
 
void wheelEvent (QWheelEvent *e)
 Overridden mouse wheel event. More...
 
void resizeEvent (QResizeEvent *e)
 Overridden resize event. More...
 
void paintEvent (QPaintEvent *e)
 Overridden paint event. More...
 
void dragEnterEvent (QDragEnterEvent *e)
 Overridden drag enter event. More...
 
void moveCanvasContents (bool reset=false)
 called when panning is in action, reset indicates end of panning More...
 
void updateCanvasItemPositions ()
 called on resize or changed extent to notify canvas items to change their rectangle More...
 
void connectNotify (const char *signal)
 debugging member invoked when a connect() is made to this object More...
 
void updateDatumTransformEntries ()
 Make sure the datum transform store is properly populated. More...
 

Protected Attributes

std::auto_ptr< CanvasPropertiesmCanvasProperties
 Handle pattern for implementation object. More...
 

Detailed Description

Map canvas is a class for displaying all GIS data types on a canvas.

Constructor & Destructor Documentation

QgsMapCanvas::QgsMapCanvas ( QWidget *  parent = 0,
const char *  name = 0 
)

Constructor.

QgsMapCanvas::~QgsMapCanvas ( )

Destructor.

Member Function Documentation

bool QgsMapCanvas::antiAliasingEnabled ( ) const
inline

true if antialising is enabled

QColor QgsMapCanvas::canvasColor ( ) const
virtual

Read property of QColor bgColor.

QPaintDevice & QgsMapCanvas::canvasPaintDevice ( )

Accessor for the canvas paint device.

Deprecated:
since 2.4
void QgsMapCanvas::clear ( )

Clear the map canvas.

Deprecated:
since 2.4 - use refresh() - clear does the same thing
void QgsMapCanvas::clearCache ( )

Make sure to remove any rendered images from cache (does nothing if cache is not enabled)

Note
added in 2.4
void QgsMapCanvas::clearExtentHistory ( )
void QgsMapCanvas::connectNotify ( const char *  signal)
protected

debugging member invoked when a connect() is made to this object

QgsMapLayer * QgsMapCanvas::currentLayer ( )

returns current layer (set by legend widget)

void QgsMapCanvas::destinationCrsChanged ( )
signal

Emitted when map CRS has changed.

Note
added in 2.4
void QgsMapCanvas::dragEnterEvent ( QDragEnterEvent *  e)
protected

Overridden drag enter event.

void QgsMapCanvas::enableAntiAliasing ( bool  theFlag)

used to determine if anti-aliasing is enabled or not

void QgsMapCanvas::enableOverviewMode ( QgsMapOverviewCanvas overview)
QgsRectangle QgsMapCanvas::extent ( ) const

Returns the current zoom exent of the map canvas.

void QgsMapCanvas::extentsChanged ( )
signal

Emitted when the extents of the map change.

void QgsMapCanvas::freeze ( bool  frz = true)

Freeze/thaw the map canvas. This is used to prevent the canvas from responding to events while layers are being added/removed etc.

Parameters
frzBoolean specifying if the canvas should be frozen (true) or thawed (false). Default is true.
QgsRectangle QgsMapCanvas::fullExtent ( ) const

Returns the combined exent for all layers on the map canvas.

const QgsMapToPixel * QgsMapCanvas::getCoordinateTransform ( )

Get the current coordinate transform.

void QgsMapCanvas::getDatumTransformInfo ( const QgsMapLayer ml,
const QString &  srcAuthId,
const QString &  destAuthId 
)

ask user about datum transformation

Ask user which datum transform to use.

bool QgsMapCanvas::hasCrsTransformEnabled ( )

A simple helper method to find out if on the fly projections are enabled or not.

void QgsMapCanvas::hasCrsTransformEnabledChanged ( bool  flag)
signal

Emitted when on-the-fly projection has been turned on/off.

Note
added in 2.4
bool QgsMapCanvas::isCachingEnabled ( ) const

Check whether images of rendered layers are curerently being cached.

Note
added in 2.4
bool QgsMapCanvas::isDirty ( ) const

Return the state of the canvas (dirty or not)

Deprecated:
since 2.4 - dirty flag is not kept anymore - always returns false
bool QgsMapCanvas::isDrawing ( )

Find out whether rendering is in progress.

bool QgsMapCanvas::isFrozen ( )

Accessor for frozen status of canvas

bool QgsMapCanvas::isParallelRenderingEnabled ( ) const

Check whether the layers are rendered in parallel or sequentially.

Note
added in 2.4
void QgsMapCanvas::keyPressed ( QKeyEvent *  e)
signal

Emit key press event.

void QgsMapCanvas::keyPressEvent ( QKeyEvent *  e)
protected

Overridden key press event.

void QgsMapCanvas::keyReleased ( QKeyEvent *  e)
signal

Emit key release event.

void QgsMapCanvas::keyReleaseEvent ( QKeyEvent *  e)
protected

Overridden key release event.

const QgsLabelingResults * QgsMapCanvas::labelingResults ( ) const

Get access to the labeling results (may be null)

Note
added in 2.4
QgsMapLayer * QgsMapCanvas::layer ( int  index)

return the map layer at position index in the layer stack

int QgsMapCanvas::layerCount ( ) const

return number of layers on the map

QList< QgsMapLayer * > QgsMapCanvas::layers ( ) const

return list of layers within map canvas. Added in v1.5

void QgsMapCanvas::layersChanged ( )
signal

Emitted when a new set of layers has been received.

void QgsMapCanvas::layerStateChange ( )
slot

This slot is connected to the visibility change of one or more layers.

QgsMapCanvasMap * QgsMapCanvas::map ( )
Deprecated:
since 2.4 - there could be more than just one "map" items
void QgsMapCanvas::mapCanvasRefreshed ( )
signal

Emitted when canvas finished a refresh request.

Note
Added in 2.0
QgsMapRenderer * QgsMapCanvas::mapRenderer ( )
Deprecated:
since 2.4 - use mapSettings() for anything related to current renderer settings / SIP: removed /Transfer/ because it crashes after few calls to iface.mapCanvas().mapRenderer().hasCrsTransformEnabled() / and in fact there is no transfer of ownership from c++ to python! / Actually the problem comes from the fact that "hasCrsTransformEnabled" is both a signal and a normal method / /KeepReference/ is necessary because otherwise mapRenderer().hasCrsTransformEnabled() was crashing
const QgsMapSettings & QgsMapCanvas::mapSettings ( ) const

Get access to properties used for map rendering.

Note
added in 2.4
QgsMapTool * QgsMapCanvas::mapTool ( )

Returns the currently active tool.

void QgsMapCanvas::mapToolSet ( QgsMapTool tool)
signal

Emit map tool changed event.

void QgsMapCanvas::mapToolSet ( QgsMapTool newTool,
QgsMapTool oldTool 
)
signal

Emit map tool changed with the old tool.

Note
added in 2.3
QGis::UnitType QgsMapCanvas::mapUnits ( ) const

Get the current canvas map units.

void QgsMapCanvas::mapUnitsChanged ( )
signal

Emmitted when map units are changed.

Note
added in 2.4
double QgsMapCanvas::mapUnitsPerPixel ( ) const

Returns the mapUnitsPerPixel (map units per pixel) for the canvas.

int QgsMapCanvas::mapUpdateInterval ( ) const

Find out how often map preview should be updated while it is being rendered (in milliseconds)

Note
added in 2.4
void QgsMapCanvas::mouseDoubleClickEvent ( QMouseEvent *  e)
protected

Overridden mouse double click event.

QPoint QgsMapCanvas::mouseLastXY ( )

returns last position of mouse cursor

void QgsMapCanvas::mouseMoveEvent ( QMouseEvent *  e)
protected

Overridden mouse move event.

void QgsMapCanvas::mousePressEvent ( QMouseEvent *  e)
protected

Overridden mouse press event.

void QgsMapCanvas::mouseReleaseEvent ( QMouseEvent *  e)
protected

Overridden mouse release event.

void QgsMapCanvas::moveCanvasContents ( bool  reset = false)
protected

called when panning is in action, reset indicates end of panning

void QgsMapCanvas::paintEvent ( QPaintEvent *  e)
protected

Overridden paint event.

void QgsMapCanvas::panAction ( QMouseEvent *  event)

Called when mouse is moving and pan is activated.

void QgsMapCanvas::panActionEnd ( QPoint  releasePoint)

Ends pan action and redraws the canvas.

void QgsMapCanvas::panToSelected ( QgsVectorLayer layer = NULL)

Pan to the selected features of current (vector) layer keeping same extent.

Note
added in 2.0
QgsPreviewEffect::PreviewMode QgsMapCanvas::previewMode ( ) const

Returns the current preview mode for the map canvas.

This setting only has an effect if previewModeEnabled is true.

Returns
preview mode for map canvas
See also
setPreviewMode
previewModeEnabled
Note
added in 2.3
bool QgsMapCanvas::previewModeEnabled ( ) const

Returns whether a preview mode is enabled for the map canvas.

Returns
true if a preview mode is currently enabled
See also
setPreviewModeEnabled
previewMode
Note
added in 2.3
void QgsMapCanvas::readProject ( const QDomDocument &  doc)

called to read map canvas settings from project

void QgsMapCanvas::refresh ( )
slot

Repaints the canvas map.

void QgsMapCanvas::renderComplete ( QPainter *  )
signal

Emitted when the canvas has rendered.

Passes a pointer to the painter on which the map was drawn. This is useful for plugins that wish to draw on the map after it has been rendered. Passing the painter allows plugins to work when the map is being rendered onto a pixmap other than the mapCanvas own pixmap member.TODO: deprecate when decorations are reimplemented as map canvas items

  • anything related to rendering progress is not visible outside of map canvas
  • additional drawing shall be done directly within the renderer job or independently as a map canvas item
bool QgsMapCanvas::renderFlag ( )
inlineslot

State of render suppression flag.

void QgsMapCanvas::renderStarting ( )
signal

Emitted when the canvas is about to be rendered.

Note
Added in 1.5
void QgsMapCanvas::resizeEvent ( QResizeEvent *  e)
protected

Overridden resize event.

void QgsMapCanvas::saveAsImage ( QString  theFileName,
QPixmap *  QPixmap = 0,
QString  theFormat = "PNG" 
)
slot

Save the convtents of the map canvas to disk as an image.

double QgsMapCanvas::scale ( )

Get the last reported scale of the canvas.

void QgsMapCanvas::scaleChanged ( double  )
signal

Emitted when the scale of the map changes.

void QgsMapCanvas::selectionChanged ( QgsMapLayer layer)
signal

Emitted when selection in any layer gets changed.

void QgsMapCanvas::selectionChangedSlot ( )
slot

Receives signal about selection change, and pass it on with layer info.

void QgsMapCanvas::setCachingEnabled ( bool  enabled)

Set whether to cache images of rendered layers.

Note
added in 2.4
void QgsMapCanvas::setCanvasColor ( const QColor &  theColor)
virtual

Write property of QColor bgColor.

void QgsMapCanvas::setCrsTransformEnabled ( bool  enabled)

sets whether to use projections for this layer set

Note
added in 2.4
void QgsMapCanvas::setCurrentLayer ( QgsMapLayer layer)
void QgsMapCanvas::setDestinationCrs ( const QgsCoordinateReferenceSystem crs)

sets destination coordinate reference system

Note
added in 2.4
void QgsMapCanvas::setDirty ( bool  _dirty)

Flag the canvas as dirty and needed a refresh.

Deprecated:
since 2.4 - use refresh() to trigger a refresh (clients should not decide explicitly whether canvas is dirty or not)
void QgsMapCanvas::setExtent ( const QgsRectangle r)

Set the extent of the map canvas.

void QgsMapCanvas::setLayerSet ( QList< QgsMapCanvasLayer > &  layers)
void QgsMapCanvas::setMapTool ( QgsMapTool mapTool)

Sets the map tool currently being used on the canvas.

void QgsMapCanvas::setMapUnits ( QGis::UnitType  mapUnits)

Set map units (needed by project properties dialog)

void QgsMapCanvas::setMapUpdateInterval ( int  timeMiliseconds)

Set how often map preview should be updated while it is being rendered (in milliseconds)

Note
added in 2.4
void QgsMapCanvas::setParallelRenderingEnabled ( bool  enabled)

Set whether the layers are rendered in parallel or sequentially.

Note
added in 2.4
void QgsMapCanvas::setPreviewMode ( QgsPreviewEffect::PreviewMode  mode)

Sets a preview mode for the map canvas.

This setting only has an effect if previewModeEnabled is true.

Parameters
modepreview mode for the canvas
See also
previewMode
setPreviewModeEnabled
previewModeEnabled
Note
added in 2.3
void QgsMapCanvas::setPreviewModeEnabled ( bool  previewEnabled)

Enables a preview mode for the map canvas.

Parameters
previewEnabledset to true to enable a preview mode
See also
setPreviewMode
Note
added in 2.3
Q_DECL_DEPRECATED void QgsMapCanvas::setProgress ( int  ,
int   
)
signal

Let the owner know how far we are with render operations.

Deprecated:
since 2.4 - already unused in 2.0 anyway
void QgsMapCanvas::setRenderFlag ( bool  theFlag)
slot

Whether to suppress rendering or not.

void QgsMapCanvas::setSelectionColor ( const QColor &  color)

Set color of selected vector features.

Note
added in 2.4
void QgsMapCanvas::setWheelAction ( WheelAction  action,
double  factor = 2 
)

set wheel action and zoom factor (should be greater than 1)

void QgsMapCanvas::showError ( QgsMapLayer mapLayer)
Deprecated:
since 2.4 - does nothing - errors are reported by different means
void QgsMapCanvas::stopRendering ( )

stop rendering (if there is any right now)

Note
added in 2.4
void QgsMapCanvas::unsetMapTool ( QgsMapTool mapTool)

Unset the current map tool or last non zoom tool.

This is called from destructor of map tools to make sure that this map tool won't be used any more. You don't have to call it manualy, QgsMapTool takes care of it.

void QgsMapCanvas::updateCanvasItemPositions ( )
protected

called on resize or changed extent to notify canvas items to change their rectangle

void QgsMapCanvas::updateDatumTransformEntries ( )
protected

Make sure the datum transform store is properly populated.

Q_DECL_DEPRECATED void QgsMapCanvas::updateFullExtent ( )
inline

Updates the full extent.

Deprecated:
since v2.4 - does nothing
void QgsMapCanvas::updateMap ( )
Deprecated:
in 2.4 - does nothing - kept for API compatibility
void QgsMapCanvas::updateOverview ( )
void QgsMapCanvas::updateScale ( )

Emits signal scaleChanged to update scale in main window.

void QgsMapCanvas::useImageToRender ( bool  theFlag)

Select which Qt class to render with.

Deprecated:
since 2.4 - does nothing because now we always render to QImage
void QgsMapCanvas::wheelEvent ( QWheelEvent *  e)
protected

Overridden mouse wheel event.

void QgsMapCanvas::writeProject ( QDomDocument &  doc)

called to write map canvas settings to project

void QgsMapCanvas::xyCoordinates ( const QgsPoint p)
signal

emits current mouse position

Note
changed in 1.3
void QgsMapCanvas::zoomByFactor ( double  scaleFactor,
const QgsPoint center = 0 
)

Zoom with the factor supplied.

Factor > 1 zooms out, interval (0,1) zooms in If point is given, re-center on it

void QgsMapCanvas::zoomIn ( )

Zoom in with fixed factor.

void QgsMapCanvas::zoomLastStatusChanged ( bool  )
signal

Emitted when zoom last status changed.

Note
: this signal was added in version 1.4
void QgsMapCanvas::zoomNextStatusChanged ( bool  )
signal

Emitted when zoom next status changed.

Note
: this signal was added in version 1.4
void QgsMapCanvas::zoomOut ( )

Zoom out with fixed factor.

void QgsMapCanvas::zoomScale ( double  scale)

Zoom to a specific scale.

void QgsMapCanvas::zoomToFullExtent ( )

Zoom to the full extent of all layers.

void QgsMapCanvas::zoomToNextExtent ( )

Zoom to the next extent (view)

void QgsMapCanvas::zoomToPreviousExtent ( )

Zoom to the previous extent (view)

void QgsMapCanvas::zoomToSelected ( QgsVectorLayer layer = NULL)

Zoom to the extent of the selected features of current (vector) layer.

Added in version 1.2: optionally specify different than current layer

void QgsMapCanvas::zoomWithCenter ( int  x,
int  y,
bool  zoomIn 
)

Zooms in/out with a given center.

Member Data Documentation

std::auto_ptr<CanvasProperties> QgsMapCanvas::mCanvasProperties
protected

Handle pattern for implementation object.


The documentation for this class was generated from the following files: