|
| QgsMapCanvas (QWidget *parent=nullptr) |
| Constructor. More...
|
|
| ~QgsMapCanvas () override |
|
bool | allowInteraction (QgsMapCanvasInteractionBlocker::Interaction interaction) const |
| Returns true if the specified interaction is currently permitted on the canvas. More...
|
|
QList< QgsMapCanvasAnnotationItem * > | annotationItems () const |
| Returns a list of all annotation items in the canvas. More...
|
|
bool | annotationsVisible () const |
| Returns true if annotations are visible within the map canvas. More...
|
|
bool | antiAliasingEnabled () const |
| true if antialiasing is enabled More...
|
|
void | cancelJobs () |
| Cancel any rendering job, in a blocking way. More...
|
|
QColor | canvasColor () const |
| Read property of QColor bgColor. More...
|
|
QgsPointXY | center () const |
| Gets map center, in geographical coordinates. More...
|
|
void | clearCache () |
| Make sure to remove any rendered images from cache (does nothing if cache is not enabled) More...
|
|
void | clearExtentHistory () |
| Clears the list of extents and sets current extent as first item. More...
|
|
QgsExpressionContext | createExpressionContext () const override |
| This method needs to be reimplemented in all classes which implement this interface and return an expression context. More...
|
|
QgsMapLayer * | currentLayer () |
| returns current layer (set by legend widget) More...
|
|
QgsExpressionContextScope * | defaultExpressionContextScope () const |
| Creates a new scope which contains default variables and functions relating to the map canvas. More...
|
|
void | enableAntiAliasing (bool flag) |
| used to determine if anti-aliasing is enabled or not More...
|
|
void | enableMapTileRendering (bool flag) |
| sets map tile rendering flag More...
|
|
QgsExpressionContextScope & | expressionContextScope () |
| Returns a reference to the expression context scope for the map canvas. More...
|
|
const QgsExpressionContextScope & | expressionContextScope () const |
| Returns a const reference to the expression context scope for the map canvas. More...
|
|
QgsRectangle | extent () const |
| Returns the current zoom extent of the map canvas. More...
|
|
void | flashFeatureIds (QgsVectorLayer *layer, const QgsFeatureIds &ids, const QColor &startColor=QColor(255, 0, 0, 255), const QColor &endColor=QColor(255, 0, 0, 0), int flashes=3, int duration=500) |
| Causes a set of features with matching ids from a vector layer to flash within the canvas. More...
|
|
void | flashGeometries (const QList< QgsGeometry > &geometries, const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem(), const QColor &startColor=QColor(255, 0, 0, 255), const QColor &endColor=QColor(255, 0, 0, 0), int flashes=3, int duration=500) |
| Causes a set of geometries to flash within the canvas. More...
|
|
void | freeze (bool frozen=true) |
| Freeze/thaw the map canvas. More...
|
|
QgsRectangle | fullExtent () const |
| Returns the combined extent for all layers on the map canvas. More...
|
|
const QgsMapToPixel * | getCoordinateTransform () |
| Gets the current coordinate transform. More...
|
|
void | installInteractionBlocker (QgsMapCanvasInteractionBlocker *blocker) |
| Installs an interaction blocker onto the canvas, which may prevent certain map canvas interactions from occurring. More...
|
|
bool | isCachingEnabled () const |
| Check whether images of rendered layers are curerently being cached. More...
|
|
bool | isDrawing () |
| Find out whether rendering is in progress. More...
|
|
bool | isFrozen () const |
| Returns true if canvas is frozen. More...
|
|
bool | isParallelRenderingEnabled () const |
| Check whether the layers are rendered in parallel or sequentially. More...
|
|
const QgsLabelingEngineSettings & | labelingEngineSettings () const |
| Returns global labeling engine settings from the internal map settings. More...
|
|
const QgsLabelingResults * | labelingResults (bool allowOutdatedResults=true) const |
| Gets access to the labeling results (may be nullptr ). More...
|
|
QgsMapLayer * | layer (const QString &id) |
| Returns the map layer with the matching ID, or nullptr if no layers could be found. More...
|
|
QgsMapLayer * | layer (int index) |
| Returns the map layer at position index in the layer stack. More...
|
|
int | layerCount () const |
| Returns number of layers on the map. More...
|
|
QList< QgsMapLayer * > | layers (bool expandGroupLayers=false) const |
| Returns the list of layers shown within the map canvas. More...
|
|
QMap< QString, QString > | layerStyleOverrides () const |
| Returns the stored overrides of styles for layers. More...
|
|
double | magnificationFactor () const |
| Returns the magnification factor. More...
|
|
const QgsMapSettings & | mapSettings () const |
| Gets access to properties used for map rendering. More...
|
|
QgsMapTool * | mapTool () |
| Returns the currently active tool. More...
|
|
QgsUnitTypes::DistanceUnit | mapUnits () const |
| Convenience function for returning the current canvas map units. More...
|
|
double | mapUnitsPerPixel () const |
| Returns the mapUnitsPerPixel (map units per pixel) for the canvas. More...
|
|
int | mapUpdateInterval () const |
| Find out how often map preview should be updated while it is being rendered (in milliseconds) More...
|
|
QPoint | mouseLastXY () |
| returns last position of mouse cursor More...
|
|
void | panAction (QMouseEvent *event) |
| Called when mouse is moving and pan is activated. More...
|
|
void | panActionEnd (QPoint releasePoint) |
| Ends pan action and redraws the canvas. More...
|
|
void | panActionStart (QPoint releasePoint) |
| Starts a pan action. More...
|
|
void | panToFeatureIds (QgsVectorLayer *layer, const QgsFeatureIds &ids, bool alwaysRecenter=true) |
| Centers canvas extent to feature ids. More...
|
|
void | panToSelected (const QList< QgsMapLayer * > &layers) |
| Pan to the combined extent of the selected features of all provided (vector) layers. More...
|
|
void | panToSelected (QgsMapLayer *layer=nullptr) |
| Pan to the selected features of current ayer keeping same extent. More...
|
|
bool | previewJobsEnabled () const |
| Returns true if canvas map preview jobs (low priority render jobs which render portions of the view just outside of the canvas extent, to allow preview of these out-of-canvas areas when panning or zooming out the map) are enabled for the canvas. More...
|
|
QgsPreviewEffect::PreviewMode | previewMode () const |
| Returns the current preview mode for the map canvas. More...
|
|
bool | previewModeEnabled () const |
| Returns whether a preview mode is enabled for the map canvas. More...
|
|
QgsProject * | project () |
| Returns the project linked to this canvas. More...
|
|
QgsRectangle | projectExtent () const |
| Returns the associated project's full extent, in the canvas' CRS. More...
|
|
void | removeInteractionBlocker (QgsMapCanvasInteractionBlocker *blocker) |
| Removes an interaction blocker from the canvas. More...
|
|
const QgsRenderedItemResults * | renderedItemResults (bool allowOutdatedResults=true) const |
| Gets access to the rendered item results (may be nullptr ), which includes the results of rendering annotation items in the canvas map. More...
|
|
bool | renderFlag () const |
| Returns true if canvas render is disabled as a result of user disabling renders via the GUI. More...
|
|
double | rotation () const |
| Gets the current map canvas rotation in clockwise degrees. More...
|
|
double | scale () const |
| Returns the last reported scale of the canvas. More...
|
|
bool | scaleLocked () const |
| Returns whether the scale is locked, so zooming can be performed using magnication. More...
|
|
QColor | selectionColor () const |
| Returns color for selected features. More...
|
|
void | setAnnotationsVisible (bool visible) |
| Sets whether annotations are visible in the canvas. More...
|
|
void | setCachingEnabled (bool enabled) |
| Set whether to cache images of rendered layers. More...
|
|
void | setCanvasColor (const QColor &_newVal) |
| Write property of QColor bgColor. More...
|
|
void | setCenter (const QgsPointXY ¢er) |
| Set the center of the map canvas, in geographical coordinates. More...
|
|
void | setCurrentLayer (QgsMapLayer *layer) |
|
void | setCustomDropHandlers (const QVector< QPointer< QgsCustomDropHandler > > &handlers) |
| Sets a list of custom drop handlers to use when drop events occur on the canvas. More...
|
|
void | setDestinationCrs (const QgsCoordinateReferenceSystem &crs) |
| Sets destination coordinate reference system. More...
|
|
void | setExpressionContextScope (const QgsExpressionContextScope &scope) |
| Sets an expression context scope for the map canvas. More...
|
|
void | setExtent (const QgsRectangle &r, bool magnified=false) |
| Sets the extent of the map canvas to the specified rectangle. More...
|
|
void | setLabelingEngineSettings (const QgsLabelingEngineSettings &settings) |
| Sets global labeling engine settings in the internal map settings. More...
|
|
void | setLayers (const QList< QgsMapLayer * > &layers) |
| Sets the list of layers that should be shown in the canvas. More...
|
|
void | setLayerStyleOverrides (const QMap< QString, QString > &overrides) |
| Sets the stored overrides of styles for rendering layers. More...
|
|
void | setMapSettingsFlags (Qgis::MapSettingsFlags flags) |
| Resets the flags for the canvas' map settings. More...
|
|
void | setMapTool (QgsMapTool *mapTool, bool clean=false) |
| Sets the map tool currently being used on the canvas. More...
|
|
void | setMapUpdateInterval (int timeMilliseconds) |
| Set how often map preview should be updated while it is being rendered (in milliseconds) More...
|
|
void | setParallelRenderingEnabled (bool enabled) |
| Set whether the layers are rendered in parallel or sequentially. More...
|
|
void | setPreviewJobsEnabled (bool enabled) |
| Sets whether canvas map preview jobs (low priority render jobs which render portions of the view just outside of the canvas extent, to allow preview of these out-of-canvas areas when panning or zooming out the map) are enabled for the canvas. More...
|
|
void | setPreviewMode (QgsPreviewEffect::PreviewMode mode) |
| Sets a preview mode for the map canvas. More...
|
|
void | setPreviewModeEnabled (bool previewEnabled) |
| Enables a preview mode for the map canvas. More...
|
|
void | setProject (QgsProject *project) |
| Sets the project linked to this canvas. More...
|
|
bool | setReferencedExtent (const QgsReferencedRectangle &extent) SIP_THROW(QgsCsException) |
| Sets the canvas to the specified extent. More...
|
|
void | setRotation (double degrees) |
| Set the rotation of the map canvas in clockwise degrees. More...
|
|
void | setSegmentationTolerance (double tolerance) |
| Sets the segmentation tolerance applied when rendering curved geometries. More...
|
|
void | setSegmentationToleranceType (QgsAbstractGeometry::SegmentationToleranceType type) |
| Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation) More...
|
|
void | setSelectionColor (const QColor &color) |
| Set color of selected vector features. More...
|
|
void | setSnappingUtils (QgsSnappingUtils *utils) |
| Assign an instance of snapping utils to the map canvas. More...
|
|
void | setTemporalController (QgsTemporalController *controller) |
| Sets the temporal controller for this canvas. More...
|
|
void | setTemporalRange (const QgsDateTimeRange &range) |
| Set datetime range for the map canvas. More...
|
|
void | setTheme (const QString &theme) |
| Sets a map theme to show in the canvas. More...
|
|
void | setWheelFactor (double factor) |
| Sets wheel zoom factor (should be greater than 1) More...
|
|
QgsSnappingUtils * | snappingUtils () const |
| Returns snapping utility class that is associated with map canvas. More...
|
|
const QgsTemporalController * | temporalController () const |
| Gets access to the temporal controller that will be used to update the canvas temporal range. More...
|
|
const QgsDateTimeRange & | temporalRange () const |
| Returns map canvas datetime range. More...
|
|
QString | theme () const |
| Returns the map's theme shown in the canvas, if set. More...
|
|
void | unsetMapTool (QgsMapTool *mapTool) |
| Unset the current map tool or last non zoom tool. More...
|
|
void | updateScale () |
| Emits signal scaleChanged to update scale in main window. More...
|
|
void | waitWhileRendering () |
| Blocks until the rendering job has finished. More...
|
|
void | zoomByFactor (double scaleFactor, const QgsPointXY *center=nullptr, bool ignoreScaleLock=false) |
| Zoom with the factor supplied. More...
|
|
void | zoomScale (double scale, bool ignoreScaleLock=false) |
| Zooms the canvas to a specific scale. More...
|
|
void | zoomToFeatureExtent (QgsRectangle &rect) |
| Zooms to feature extent. More...
|
|
void | zoomToFeatureIds (QgsVectorLayer *layer, const QgsFeatureIds &ids) |
| Set canvas extent to the bounding box of a set of features. More...
|
|
void | zoomToFullExtent () |
| Zoom to the full extent of all layers currently visible in the canvas. More...
|
|
void | zoomToNextExtent () |
| Zoom to the next extent (view) More...
|
|
void | zoomToPreviousExtent () |
| Zoom to the previous extent (view) More...
|
|
void | zoomToProjectExtent () |
| Zoom to the full extent the project associated with this canvas. More...
|
|
void | zoomWithCenter (int x, int y, bool zoomIn) |
| Zooms in/out with a given center. More...
|
|
virtual | ~QgsExpressionContextGenerator ()=default |
|
virtual QgsExpressionContext | createExpressionContext () const =0 |
| This method needs to be reimplemented in all classes which implement this interface and return an expression context. More...
|
|