QGIS API Documentation
2.8.2-Wien
|
Map canvas is a class for displaying all GIS data types on a canvas. More...
#include <qgsmapcanvas.h>
Classes | |
class | CanvasProperties |
Public Types | |
enum | WheelAction { WheelZoom, WheelZoomAndRecenter, WheelZoomToMouseCursor, WheelNothing } |
Public Slots | |
static void | enableRotation (bool enabled) |
change canvas rotation support | |
void | getDatumTransformInfo (const QgsMapLayer *ml, const QString &srcAuthId, const QString &destAuthId) |
ask user about datum transformation | |
bool | hasCrsTransformEnabled () |
A simple helper method to find out if on the fly projections are enabled or not. | |
void | layerCrsChange () |
This slot is connected to the layer's CRS change. | |
void | layerStateChange () |
This slot is connected to the visibility change of one or more layers. | |
void | readProject (const QDomDocument &) |
called to read map canvas settings from project | |
void | refresh () |
Repaints the canvas map. | |
bool | renderFlag () |
State of render suppression flag. | |
static bool | rotationEnabled () |
return if canvas rotation is enabled | |
void | saveAsImage (QString theFileName, QPixmap *QPixmap=0, QString="PNG") |
Save the convtents of the map canvas to disk as an image. | |
void | selectionChangedSlot () |
Receives signal about selection change, and pass it on with layer info. | |
void | setRenderFlag (bool theFlag) |
Whether to suppress rendering or not. | |
Q_DECL_DEPRECATED void | showError (QgsMapLayer *mapLayer) |
void | stopRendering () |
stop rendering (if there is any right now) | |
Q_DECL_DEPRECATED void | updateMap () |
void | writeProject (QDomDocument &) |
called to write map canvas settings to project |
Signals | |
void | currentLayerChanged (QgsMapLayer *layer) |
Emitted when the current layer is changed. | |
void | destinationCrsChanged () |
Emitted when map CRS has changed. | |
void | extentsChanged () |
Emitted when the extents of the map change. | |
void | hasCrsTransformEnabledChanged (bool flag) |
Emitted when on-the-fly projection has been turned on/off. | |
void | keyPressed (QKeyEvent *e) |
Emit key press event. | |
void | keyReleased (QKeyEvent *e) |
Emit key release event. | |
void | layersChanged () |
Emitted when a new set of layers has been received. | |
void | mapCanvasRefreshed () |
Emitted when canvas finished a refresh request. | |
void | mapToolSet (QgsMapTool *tool) |
Emit map tool changed event. | |
void | mapToolSet (QgsMapTool *newTool, QgsMapTool *oldTool) |
Emit map tool changed with the old tool. | |
void | mapUnitsChanged () |
Emmitted when map units are changed. | |
void | renderComplete (QPainter *) |
Emitted when the canvas has rendered. | |
void | renderStarting () |
Emitted when the canvas is about to be rendered. | |
void | rotationChanged (double) |
Emitted when the rotation of the map changes. | |
void | scaleChanged (double) |
Emitted when the scale of the map changes. | |
void | selectionChanged (QgsMapLayer *layer) |
Emitted when selection in any layer gets changed. | |
Q_DECL_DEPRECATED void | setProgress (int, int) |
Let the owner know how far we are with render operations. | |
void | xyCoordinates (const QgsPoint &p) |
emits current mouse position | |
void | zoomLastStatusChanged (bool) |
Emitted when zoom last status changed. | |
void | zoomNextStatusChanged (bool) |
Emitted when zoom next status changed. |
Public Member Functions | |
QgsMapCanvas (QWidget *parent=0, const char *name=0) | |
Constructor. | |
~QgsMapCanvas () | |
Destructor. | |
bool | antiAliasingEnabled () const |
true if antialising is enabled | |
virtual QColor | canvasColor () const |
Read property of QColor bgColor. | |
Q_DECL_DEPRECATED QPaintDevice & | canvasPaintDevice () |
Accessor for the canvas paint device. | |
QgsPoint | center () const |
Get map center, in geographical coordinates. | |
Q_DECL_DEPRECATED void | clear () |
Clear the map canvas. | |
void | clearCache () |
Make sure to remove any rendered images from cache (does nothing if cache is not enabled) | |
void | clearExtentHistory () |
QgsMapLayer * | currentLayer () |
returns current layer (set by legend widget) | |
void | enableAntiAliasing (bool theFlag) |
used to determine if anti-aliasing is enabled or not | |
void | enableOverviewMode (QgsMapOverviewCanvas *overview) |
QgsRectangle | extent () const |
Returns the current zoom exent of the map canvas. | |
void | freeze (bool frz=true) |
QgsRectangle | fullExtent () const |
Returns the combined exent for all layers on the map canvas. | |
const QgsMapToPixel * | getCoordinateTransform () |
Get the current coordinate transform. | |
bool | isCachingEnabled () const |
Check whether images of rendered layers are curerently being cached. | |
Q_DECL_DEPRECATED bool | isDirty () const |
Return the state of the canvas (dirty or not) | |
bool | isDrawing () |
Find out whether rendering is in progress. | |
bool | isFrozen () |
bool | isParallelRenderingEnabled () const |
Check whether the layers are rendered in parallel or sequentially. | |
const QgsLabelingResults * | labelingResults () const |
Get access to the labeling results (may be null) | |
QgsMapLayer * | layer (int index) |
return the map layer at position index in the layer stack | |
int | layerCount () const |
return number of layers on the map | |
QList< QgsMapLayer * > | layers () const |
return list of layers within map canvas. | |
QgsMapCanvasMap * | map () |
Q_DECL_DEPRECATED QgsMapRenderer * | mapRenderer () |
const QgsMapSettings & | mapSettings () const |
Get access to properties used for map rendering. | |
QgsMapTool * | mapTool () |
Returns the currently active tool. | |
QGis::UnitType | mapUnits () const |
Get the current canvas map units. | |
double | mapUnitsPerPixel () const |
Returns the mapUnitsPerPixel (map units per pixel) for the canvas. | |
int | mapUpdateInterval () const |
Find out how often map preview should be updated while it is being rendered (in milliseconds) | |
QPoint | mouseLastXY () |
returns last position of mouse cursor | |
void | panAction (QMouseEvent *event) |
Called when mouse is moving and pan is activated. | |
void | panActionEnd (QPoint releasePoint) |
Ends pan action and redraws the canvas. | |
void | panToSelected (QgsVectorLayer *layer=NULL) |
Pan to the selected features of current (vector) layer keeping same extent. | |
QgsPreviewEffect::PreviewMode | previewMode () const |
Returns the current preview mode for the map canvas. | |
bool | previewModeEnabled () const |
Returns whether a preview mode is enabled for the map canvas. | |
double | rotation () const |
Get the current map canvas rotation in clockwise degrees. | |
double | scale () |
Get the last reported scale of the canvas. | |
void | setCachingEnabled (bool enabled) |
Set whether to cache images of rendered layers. | |
virtual void | setCanvasColor (const QColor &_newVal) |
Write property of QColor bgColor. | |
void | setCenter (const QgsPoint ¢er) |
Set the center of the map canvas, in geographical coordinates. | |
void | setCrsTransformEnabled (bool enabled) |
sets whether to use projections for this layer set | |
void | setCurrentLayer (QgsMapLayer *layer) |
void | setDestinationCrs (const QgsCoordinateReferenceSystem &crs) |
sets destination coordinate reference system | |
Q_DECL_DEPRECATED void | setDirty (bool _dirty) |
Flag the canvas as dirty and needed a refresh. | |
void | setExtent (const QgsRectangle &r) |
Set the extent of the map canvas. | |
void | setLayerSet (QList< QgsMapCanvasLayer > &layers) |
void | setMapTool (QgsMapTool *mapTool) |
Sets the map tool currently being used on the canvas. | |
void | setMapUnits (QGis::UnitType mapUnits) |
Set map units (needed by project properties dialog) | |
void | setMapUpdateInterval (int timeMiliseconds) |
Set how often map preview should be updated while it is being rendered (in milliseconds) | |
void | setParallelRenderingEnabled (bool enabled) |
Set whether the layers are rendered in parallel or sequentially. | |
void | setPreviewMode (QgsPreviewEffect::PreviewMode mode) |
Sets a preview mode for the map canvas. | |
void | setPreviewModeEnabled (bool previewEnabled) |
Enables a preview mode for the map canvas. | |
void | setRotation (double degrees) |
Set the rotation of the map canvas in clockwise degrees. | |
void | setSelectionColor (const QColor &color) |
Set color of selected vector features. | |
void | setSnappingUtils (QgsSnappingUtils *utils) |
Assign an instance of snapping utils to the map canvas. | |
void | setWheelAction (WheelAction action, double factor=2) |
set wheel action and zoom factor (should be greater than 1) | |
QgsSnappingUtils * | snappingUtils () const |
Return snapping utility class that is associated with map canvas. | |
void | unsetMapTool (QgsMapTool *mapTool) |
Unset the current map tool or last non zoom tool. | |
Q_DECL_DEPRECATED void | updateFullExtent () |
Updates the full extent. | |
void | updateOverview () |
void | updateScale () |
Emits signal scaleChanged to update scale in main window. | |
Q_DECL_DEPRECATED void | useImageToRender (bool theFlag) |
Select which Qt class to render with. | |
void | zoomByFactor (double scaleFactor, const QgsPoint *center=0) |
Zoom with the factor supplied. | |
void | zoomIn () |
Zoom in with fixed factor. | |
void | zoomOut () |
Zoom out with fixed factor. | |
void | zoomScale (double scale) |
Zoom to a specific scale. | |
void | zoomToFullExtent () |
Zoom to the full extent of all layers. | |
void | zoomToNextExtent () |
Zoom to the next extent (view) | |
void | zoomToPreviousExtent () |
Zoom to the previous extent (view) | |
void | zoomToSelected (QgsVectorLayer *layer=NULL) |
Zoom to the extent of the selected features of current (vector) layer. | |
void | zoomWithCenter (int x, int y, bool zoomIn) |
Zooms in/out with a given center. |
Protected Member Functions | |
void | dragEnterEvent (QDragEnterEvent *e) override |
Overridden drag enter event. | |
void | keyPressEvent (QKeyEvent *e) override |
Overridden key press event. | |
void | keyReleaseEvent (QKeyEvent *e) override |
Overridden key release event. | |
void | mouseDoubleClickEvent (QMouseEvent *e) override |
Overridden mouse double click event. | |
void | mouseMoveEvent (QMouseEvent *e) override |
Overridden mouse move event. | |
void | mousePressEvent (QMouseEvent *e) override |
Overridden mouse press event. | |
void | mouseReleaseEvent (QMouseEvent *e) override |
Overridden mouse release event. | |
void | moveCanvasContents (bool reset=false) |
called when panning is in action, reset indicates end of panning | |
void | paintEvent (QPaintEvent *e) override |
Overridden paint event. | |
void | resizeEvent (QResizeEvent *e) override |
Overridden resize event. | |
void | updateCanvasItemPositions () |
called on resize or changed extent to notify canvas items to change their rectangle | |
void | updateDatumTransformEntries () |
Make sure the datum transform store is properly populated. | |
void | wheelEvent (QWheelEvent *e) override |
Overridden mouse wheel event. |
Protected Attributes | |
QScopedPointer< CanvasProperties > | mCanvasProperties |
Handle pattern for implementation object. |
Map canvas is a class for displaying all GIS data types on a canvas.
Definition at line 105 of file qgsmapcanvas.h.
Definition at line 111 of file qgsmapcanvas.h.
QgsMapCanvas::QgsMapCanvas | ( | QWidget * | parent = 0 , |
const char * | name = 0 |
||
) |
Constructor.
Definition at line 184 of file qgsmapcanvas.cpp.
QgsMapCanvas::~QgsMapCanvas | ( | ) |
Destructor.
Definition at line 269 of file qgsmapcanvas.cpp.
|
inline |
true if antialising is enabled
Definition at line 335 of file qgsmapcanvas.h.
|
virtual |
Read property of QColor bgColor.
Definition at line 1547 of file qgsmapcanvas.cpp.
QPaintDevice & QgsMapCanvas::canvasPaintDevice | ( | ) |
Accessor for the canvas paint device.
Definition at line 1606 of file qgsmapcanvas.cpp.
QgsPoint QgsMapCanvas::center | ( | ) | const |
Get map center, in geographical coordinates.
Definition at line 913 of file qgsmapcanvas.cpp.
void QgsMapCanvas::clear | ( | ) |
Clear the map canvas.
Definition at line 951 of file qgsmapcanvas.cpp.
void QgsMapCanvas::clearCache | ( | ) |
Make sure to remove any rendered images from cache (does nothing if cache is not enabled)
Definition at line 574 of file qgsmapcanvas.cpp.
void QgsMapCanvas::clearExtentHistory | ( | ) |
Definition at line 1009 of file qgsmapcanvas.cpp.
QgsMapLayer * QgsMapCanvas::currentLayer | ( | ) |
returns current layer (set by legend widget)
Definition at line 611 of file qgsmapcanvas.cpp.
|
signal |
Emitted when the current layer is changed.
|
signal |
Emitted when map CRS has changed.
|
overrideprotected |
Overridden drag enter event.
Definition at line 1920 of file qgsmapcanvas.cpp.
void QgsMapCanvas::enableAntiAliasing | ( | bool | theFlag | ) |
used to determine if anti-aliasing is enabled or not
Definition at line 308 of file qgsmapcanvas.cpp.
void QgsMapCanvas::enableOverviewMode | ( | QgsMapOverviewCanvas * | overview | ) |
Definition at line 467 of file qgsmapcanvas.cpp.
|
staticslot |
QgsRectangle QgsMapCanvas::extent | ( | ) | const |
Returns the current zoom exent of the map canvas.
Definition at line 835 of file qgsmapcanvas.cpp.
|
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.
frz | Boolean specifying if the canvas should be frozen (true) or thawed (false). Default is true. |
Definition at line 1595 of file qgsmapcanvas.cpp.
QgsRectangle QgsMapCanvas::fullExtent | ( | ) | const |
Returns the combined exent for all layers on the map canvas.
Definition at line 840 of file qgsmapcanvas.cpp.
const QgsMapToPixel * QgsMapCanvas::getCoordinateTransform | ( | ) |
Get the current coordinate transform.
Definition at line 374 of file qgsmapcanvas.cpp.
|
slot |
ask user about datum transformation
Ask user which datum transform to use.
Definition at line 1836 of file qgsmapcanvas.cpp.
|
slot |
A simple helper method to find out if on the fly projections are enabled or not.
Definition at line 1020 of file qgsmapcanvas.cpp.
|
signal |
Emitted when on-the-fly projection has been turned on/off.
bool QgsMapCanvas::isCachingEnabled | ( | ) | const |
Check whether images of rendered layers are curerently being cached.
Definition at line 569 of file qgsmapcanvas.cpp.
bool QgsMapCanvas::isDirty | ( | ) | const |
Return the state of the canvas (dirty or not)
Definition at line 359 of file qgsmapcanvas.cpp.
bool QgsMapCanvas::isDrawing | ( | ) |
Find out whether rendering is in progress.
Definition at line 366 of file qgsmapcanvas.cpp.
bool QgsMapCanvas::isFrozen | ( | ) |
Accessor for frozen status of canvas
Definition at line 1600 of file qgsmapcanvas.cpp.
bool QgsMapCanvas::isParallelRenderingEnabled | ( | ) | const |
Check whether the layers are rendered in parallel or sequentially.
Definition at line 585 of file qgsmapcanvas.cpp.
|
signal |
Emit key press event.
|
overrideprotected |
Overridden key press event.
Definition at line 1090 of file qgsmapcanvas.cpp.
|
signal |
Emit key release event.
|
overrideprotected |
Overridden key release event.
Definition at line 1199 of file qgsmapcanvas.cpp.
const QgsLabelingResults * QgsMapCanvas::labelingResults | ( | ) | const |
Get access to the labeling results (may be null)
Definition at line 548 of file qgsmapcanvas.cpp.
QgsMapLayer * QgsMapCanvas::layer | ( | int | index | ) |
return the map layer at position index in the layer stack
Definition at line 332 of file qgsmapcanvas.cpp.
int QgsMapCanvas::layerCount | ( | ) | const |
return number of layers on the map
Definition at line 1557 of file qgsmapcanvas.cpp.
|
slot |
This slot is connected to the layer's CRS change.
Definition at line 1584 of file qgsmapcanvas.cpp.
QList< QgsMapLayer * > QgsMapCanvas::layers | ( | ) | const |
return list of layers within map canvas.
Definition at line 1563 of file qgsmapcanvas.cpp.
|
signal |
Emitted when a new set of layers has been received.
|
slot |
This slot is connected to the visibility change of one or more layers.
Definition at line 1576 of file qgsmapcanvas.cpp.
QgsMapCanvasMap * QgsMapCanvas::map | ( | ) |
Definition at line 321 of file qgsmapcanvas.cpp.
|
signal |
Emitted when canvas finished a refresh request.
QgsMapRenderer * QgsMapCanvas::mapRenderer | ( | ) |
Definition at line 326 of file qgsmapcanvas.cpp.
const QgsMapSettings & QgsMapCanvas::mapSettings | ( | ) | const |
Get access to properties used for map rendering.
Definition at line 492 of file qgsmapcanvas.cpp.
QgsMapTool * QgsMapCanvas::mapTool | ( | ) |
Returns the currently active tool.
Definition at line 1685 of file qgsmapcanvas.cpp.
|
signal |
Emit map tool changed event.
|
signal |
Emit map tool changed with the old tool.
QGis::UnitType QgsMapCanvas::mapUnits | ( | ) | const |
Get the current canvas map units.
Definition at line 1635 of file qgsmapcanvas.cpp.
|
signal |
Emmitted when map units are changed.
double QgsMapCanvas::mapUnitsPerPixel | ( | ) | const |
Returns the mapUnitsPerPixel (map units per pixel) for the canvas.
Definition at line 1613 of file qgsmapcanvas.cpp.
int QgsMapCanvas::mapUpdateInterval | ( | ) | const |
Find out how often map preview should be updated while it is being rendered (in milliseconds)
Definition at line 595 of file qgsmapcanvas.cpp.
|
overrideprotected |
Overridden mouse double click event.
Definition at line 1231 of file qgsmapcanvas.cpp.
QPoint QgsMapCanvas::mouseLastXY | ( | ) |
returns last position of mouse cursor
Definition at line 1731 of file qgsmapcanvas.cpp.
|
overrideprotected |
Overridden mouse move event.
Definition at line 1448 of file qgsmapcanvas.cpp.
|
overrideprotected |
Overridden mouse press event.
Definition at line 1241 of file qgsmapcanvas.cpp.
|
overrideprotected |
Overridden mouse release event.
Definition at line 1270 of file qgsmapcanvas.cpp.
|
protected |
called when panning is in action, reset indicates end of panning
Definition at line 1717 of file qgsmapcanvas.cpp.
|
overrideprotected |
Overridden paint event.
Definition at line 1337 of file qgsmapcanvas.cpp.
void QgsMapCanvas::panAction | ( | QMouseEvent * | event | ) |
Called when mouse is moving and pan is activated.
Definition at line 1709 of file qgsmapcanvas.cpp.
void QgsMapCanvas::panActionEnd | ( | QPoint | releasePoint | ) |
Ends pan action and redraws the canvas.
Definition at line 1690 of file qgsmapcanvas.cpp.
void QgsMapCanvas::panToSelected | ( | QgsVectorLayer * | layer = NULL | ) |
Pan to the selected features of current (vector) layer keeping same extent.
Definition at line 1067 of file qgsmapcanvas.cpp.
QgsPreviewEffect::PreviewMode QgsMapCanvas::previewMode | ( | ) | const |
Returns the current preview mode for the map canvas.
This setting only has an effect if previewModeEnabled is true.
Definition at line 1766 of file qgsmapcanvas.cpp.
bool QgsMapCanvas::previewModeEnabled | ( | ) | const |
Returns whether a preview mode is enabled for the map canvas.
Definition at line 1746 of file qgsmapcanvas.cpp.
|
slot |
called to read map canvas settings from project
Definition at line 1792 of file qgsmapcanvas.cpp.
|
slot |
Repaints the canvas map.
Definition at line 617 of file qgsmapcanvas.cpp.
|
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
|
inlineslot |
State of render suppression flag.
Definition at line 419 of file qgsmapcanvas.h.
|
signal |
Emitted when the canvas is about to be rendered.
|
overrideprotected |
Overridden resize event.
Definition at line 1313 of file qgsmapcanvas.cpp.
double QgsMapCanvas::rotation | ( | ) | const |
Get the current map canvas rotation in clockwise degrees.
Definition at line 920 of file qgsmapcanvas.cpp.
|
signal |
Emitted when the rotation of the map changes.
|
staticslot |
return if canvas rotation is enabled
Definition at line 1955 of file qgsmapcanvas.cpp.
|
slot |
Save the convtents of the map canvas to disk as an image.
Definition at line 782 of file qgsmapcanvas.cpp.
double QgsMapCanvas::scale | ( | ) |
Get the last reported scale of the canvas.
Definition at line 348 of file qgsmapcanvas.cpp.
|
signal |
Emitted when the scale of the map changes.
|
signal |
Emitted when selection in any layer gets changed.
|
slot |
Receives signal about selection change, and pass it on with layer info.
Definition at line 1912 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setCachingEnabled | ( | bool | enabled | ) |
Set whether to cache images of rendered layers.
Definition at line 553 of file qgsmapcanvas.cpp.
|
virtual |
Write property of QColor bgColor.
Definition at line 1529 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setCenter | ( | const QgsPoint & | center | ) |
Set the center of the map canvas, in geographical coordinates.
Definition at line 900 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setCrsTransformEnabled | ( | bool | enabled | ) |
sets whether to use projections for this layer set
Definition at line 497 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setCurrentLayer | ( | QgsMapLayer * | layer | ) |
Definition at line 342 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setDestinationCrs | ( | const QgsCoordinateReferenceSystem & | crs | ) |
sets destination coordinate reference system
Definition at line 511 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setDirty | ( | bool | _dirty | ) |
Flag the canvas as dirty and needed a refresh.
Definition at line 353 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setExtent | ( | const QgsRectangle & | r | ) |
Set the extent of the map canvas.
Definition at line 846 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setLayerSet | ( | QList< QgsMapCanvasLayer > & | layers | ) |
Definition at line 379 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setMapTool | ( | QgsMapTool * | mapTool | ) |
Sets the map tool currently being used on the canvas.
Definition at line 1474 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setMapUnits | ( | QGis::UnitType | mapUnits | ) |
Set map units (needed by project properties dialog)
Definition at line 1619 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setMapUpdateInterval | ( | int | timeMiliseconds | ) |
Set how often map preview should be updated while it is being rendered (in milliseconds)
Definition at line 590 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setParallelRenderingEnabled | ( | bool | enabled | ) |
Set whether the layers are rendered in parallel or sequentially.
Definition at line 580 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setPreviewMode | ( | QgsPreviewEffect::PreviewMode | mode | ) |
Sets a preview mode for the map canvas.
This setting only has an effect if previewModeEnabled is true.
mode | preview mode for the canvas |
Definition at line 1756 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setPreviewModeEnabled | ( | bool | previewEnabled | ) |
Enables a preview mode for the map canvas.
previewEnabled | set to true to enable a preview mode |
Definition at line 1736 of file qgsmapcanvas.cpp.
|
signal |
Let the owner know how far we are with render operations.
|
slot |
Whether to suppress rendering or not.
Definition at line 1641 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setRotation | ( | double | degrees | ) |
Set the rotation of the map canvas in clockwise degrees.
Definition at line 925 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setSelectionColor | ( | const QColor & | color | ) |
Set color of selected vector features.
Definition at line 1552 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setSnappingUtils | ( | QgsSnappingUtils * | utils | ) |
Assign an instance of snapping utils to the map canvas.
The instance is not owned by the canvas, so it is possible to use one instance in multiple canvases.
For main canvas in QGIS, do not associate a different instance from the existing one (it is updated from the project's snapping configuration).
Definition at line 1787 of file qgsmapcanvas.cpp.
void QgsMapCanvas::setWheelAction | ( | WheelAction | action, |
double | factor = 2 |
||
) |
set wheel action and zoom factor (should be greater than 1)
Definition at line 1415 of file qgsmapcanvas.cpp.
|
slot |
Definition at line 1726 of file qgsmapcanvas.cpp.
QgsSnappingUtils * QgsMapCanvas::snappingUtils | ( | ) | const |
Return snapping utility class that is associated with map canvas.
If no snapping utils instance has been associated previously, an internal will be created for convenience (so map tools do not need to test for existence of the instance).
Main canvas in QGIS returns an instance which is always up-to-date with the project's snapping configuration.
Definition at line 1776 of file qgsmapcanvas.cpp.
|
slot |
stop rendering (if there is any right now)
Definition at line 766 of file qgsmapcanvas.cpp.
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.
Definition at line 1511 of file qgsmapcanvas.cpp.
|
protected |
called on resize or changed extent to notify canvas items to change their rectangle
Definition at line 1344 of file qgsmapcanvas.cpp.
|
protected |
Make sure the datum transform store is properly populated.
Definition at line 1661 of file qgsmapcanvas.cpp.
|
inline |
Updates the full extent.
Definition at line 268 of file qgsmapcanvas.h.
|
slot |
Definition at line 777 of file qgsmapcanvas.cpp.
void QgsMapCanvas::updateOverview | ( | ) |
Definition at line 601 of file qgsmapcanvas.cpp.
void QgsMapCanvas::updateScale | ( | ) |
Emits signal scaleChanged to update scale in main window.
Definition at line 945 of file qgsmapcanvas.cpp.
void QgsMapCanvas::useImageToRender | ( | bool | theFlag | ) |
Select which Qt class to render with.
Definition at line 316 of file qgsmapcanvas.cpp.
|
overrideprotected |
Overridden mouse wheel event.
Definition at line 1362 of file qgsmapcanvas.cpp.
|
slot |
called to write map canvas settings to project
Definition at line 1816 of file qgsmapcanvas.cpp.
|
signal |
emits current mouse position
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
Definition at line 1904 of file qgsmapcanvas.cpp.
void QgsMapCanvas::zoomIn | ( | ) |
Zoom in with fixed factor.
Definition at line 1421 of file qgsmapcanvas.cpp.
|
signal |
Emitted when zoom last status changed.
|
signal |
Emitted when zoom next status changed.
void QgsMapCanvas::zoomOut | ( | ) |
Zoom out with fixed factor.
Definition at line 1426 of file qgsmapcanvas.cpp.
void QgsMapCanvas::zoomScale | ( | double | scale | ) |
Zoom to a specific scale.
Definition at line 1431 of file qgsmapcanvas.cpp.
void QgsMapCanvas::zoomToFullExtent | ( | ) |
Zoom to the full extent of all layers.
Definition at line 958 of file qgsmapcanvas.cpp.
void QgsMapCanvas::zoomToNextExtent | ( | ) |
Zoom to the next extent (view)
Definition at line 992 of file qgsmapcanvas.cpp.
void QgsMapCanvas::zoomToPreviousExtent | ( | ) |
Zoom to the previous extent (view)
Definition at line 974 of file qgsmapcanvas.cpp.
void QgsMapCanvas::zoomToSelected | ( | QgsVectorLayer * | layer = NULL | ) |
Zoom to the extent of the selected features of current (vector) layer.
layer | optionally specify different than current layer |
Definition at line 1025 of file qgsmapcanvas.cpp.
void QgsMapCanvas::zoomWithCenter | ( | int | x, |
int | y, | ||
bool | zoomIn | ||
) |
Zooms in/out with a given center.
Definition at line 1436 of file qgsmapcanvas.cpp.
|
protected |
Handle pattern for implementation object.
Definition at line 588 of file qgsmapcanvas.h.