QGIS API Documentation  3.23.0-Master (eb871beae0)
qgsmapcanvas.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmapcanvas.h - description
3  -------------------
4  begin : Sun Jun 30 2002
5  copyright : (C) 2002 by Gary E.Sherman
6  email : sherman at mrcc.com
7 ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSMAPCANVAS_H
19 #define QGSMAPCANVAS_H
20 
21 #include "qgsconfig.h"
22 #include "qgis_sip.h"
23 
24 #include "qgsexpressioncontext.h"
25 #include "qgsrectangle.h"
26 #include "qgsfeatureid.h"
27 #include "qgsgeometry.h"
28 #include "qgscustomdrophandler.h"
29 #include "qgstemporalrangeobject.h"
31 #include "qgsproject.h"
32 #include "qgsdistancearea.h"
33 
34 #include <QDomDocument>
35 #include <QGraphicsView>
36 
37 #include "qgsmapsettings.h" // TEMPORARY
38 #include "qgsprevieweffect.h" //for QgsPreviewEffect::PreviewMode
39 
40 #include <QTimer>
41 #include <QGestureEvent>
42 #include "qgis_gui.h"
43 
44 class QWheelEvent;
45 class QPixmap;
46 class QPaintEvent;
47 class QKeyEvent;
48 class ResizeEvent;
49 
50 class QColor;
51 class QDomDocument;
52 class QPaintDevice;
53 class QMouseEvent;
54 class QRubberBand;
55 class QGraphicsScene;
56 
57 class QgsMapToPixel;
58 class QgsMapLayer;
59 class QgsHighlight;
60 class QgsVectorLayer;
61 
62 class QgsLabelingResults;
63 
66 class QgsMapSettings;
67 class QgsMapCanvasMap;
69 class QgsMapTool;
70 class QgsSnappingUtils;
71 class QgsRubberBand;
76 
78 
79 class QMenu;
80 class QgsMapMouseEvent;
81 
82 
88 class GUI_EXPORT QgsMapCanvas : public QGraphicsView, public QgsExpressionContextGenerator
89 {
90 
91 #ifdef SIP_RUN
93  if ( qobject_cast<QgsMapCanvas *>( sipCpp ) != nullptr )
94  sipType = sipType_QgsMapCanvas;
95  else
96  sipType = nullptr;
97  SIP_END
98 #endif
99 
100  Q_OBJECT
101  Q_PROPERTY( QString theme READ theme WRITE setTheme NOTIFY themeChanged )
102  Q_PROPERTY( bool previewJobsEnabled READ previewJobsEnabled WRITE setPreviewJobsEnabled )
103 
104  public:
105 
107  QgsMapCanvas( QWidget *parent SIP_TRANSFERTHIS = nullptr );
108 
109  ~QgsMapCanvas() override;
110 
115  double magnificationFactor() const;
116 
128  void setLayers( const QList<QgsMapLayer *> &layers );
129 
130  void setCurrentLayer( QgsMapLayer *layer );
131 
136  const QgsMapSettings &mapSettings() const SIP_KEEPREFERENCE;
137 
144  void setTemporalController( QgsTemporalController *controller );
145 
152  const QgsTemporalController *temporalController() const;
153 
158  void setDestinationCrs( const QgsCoordinateReferenceSystem &crs );
159 
164  void setMapSettingsFlags( Qgis::MapSettingsFlags flags );
165 
174  const QgsLabelingResults *labelingResults( bool allowOutdatedResults = true ) const;
175 
185  const QgsRenderedItemResults *renderedItemResults( bool allowOutdatedResults = true ) const;
186 
191  void setCachingEnabled( bool enabled );
192 
197  bool isCachingEnabled() const;
198 
203  void clearCache();
204 
209  void cancelJobs() SIP_SKIP;
210 
220  void waitWhileRendering();
221 
226  void setParallelRenderingEnabled( bool enabled );
227 
232  bool isParallelRenderingEnabled() const;
233 
238  void setMapUpdateInterval( int timeMilliseconds );
239 
244  int mapUpdateInterval() const;
245 
250  double scale() const;
251 
253  double mapUnitsPerPixel() const;
254 
256  QgsRectangle extent() const;
257 
266  QgsRectangle fullExtent() const;
267 
277  QgsRectangle projectExtent() const;
278 
290  void setExtent( const QgsRectangle &r, bool magnified = false );
291 
300  bool setReferencedExtent( const QgsReferencedRectangle &extent ) SIP_THROW( QgsCsException );
301 
306  double rotation() const;
307 
312  void setRotation( double degrees );
313 
318  void setCenter( const QgsPointXY &center );
319 
324  QgsPointXY center() const;
325 
331  void zoomToFullExtent();
332 
341  void zoomToProjectExtent();
342 
344  void zoomToPreviousExtent();
345 
347  void zoomToNextExtent();
348 
350  void clearExtentHistory();
351 
352 
358  void zoomToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids );
359 
366  void panToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids, bool alwaysRecenter = true );
367 
369  void panToSelected( QgsVectorLayer *layer = nullptr );
370 
376  void panToSelected( const QList<QgsMapLayer *> &layers );
377 
390  void flashFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids,
391  const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ),
392  int flashes = 3, int duration = 500 );
393 
406  void flashGeometries( const QList< QgsGeometry > &geometries, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem(),
407  const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ),
408  int flashes = 3, int duration = 500 );
409 
411  void setMapTool( QgsMapTool *mapTool, bool clean = false );
412 
420  void unsetMapTool( QgsMapTool *mapTool );
421 
423  QgsMapTool *mapTool();
424 
430  void setProject( QgsProject *project );
431 
438  QgsProject *project();
439 
441  void setCanvasColor( const QColor &_newVal );
443  QColor canvasColor() const;
444 
449  void setSelectionColor( const QColor &color );
450 
455  QColor selectionColor() const;
456 
458  void updateScale();
459 
461  QgsMapLayer *layer( int index );
462 
473  QgsMapLayer *layer( const QString &id );
474 
478  int layerCount() const;
479 
488  QList<QgsMapLayer *> layers( bool expandGroupLayers = false ) const;
489 
499  void freeze( bool frozen = true );
500 
508  bool isFrozen() const;
509 
518  bool renderFlag() const { return mRenderFlag; }
519 
524  QgsUnitTypes::DistanceUnit mapUnits() const;
525 
531  QMap<QString, QString> layerStyleOverrides() const;
532 
544  void setLayerStyleOverrides( const QMap<QString, QString> &overrides );
545 
564  void setTheme( const QString &theme );
565 
571  QString theme() const { return mTheme; }
572 
574  const QgsMapToPixel *getCoordinateTransform();
575 
577  bool isDrawing();
578 
580  QgsMapLayer *currentLayer();
581 
583  void setWheelFactor( double factor );
584 
592  void zoomScale( double scale, bool ignoreScaleLock = false );
593 
601  void zoomByFactor( double scaleFactor, const QgsPointXY *center = nullptr, bool ignoreScaleLock = false );
602 
604  void zoomWithCenter( int x, int y, bool zoomIn );
605 
610  void zoomToFeatureExtent( QgsRectangle &rect );
611 
617  bool scaleLocked() const { return mScaleLocked;}
618 
620  void enableAntiAliasing( bool flag );
621 
623  bool antiAliasingEnabled() const;
624 
626  void enableMapTileRendering( bool flag );
627 
628  // following 2 methods should be moved elsewhere or changed to private
629  // currently used by pan map tool
631  void panActionEnd( QPoint releasePoint );
632 
633 #ifndef SIP_RUN
634 
640  void panActionStart( QPoint releasePoint );
641 #endif
642 
644  void panAction( QMouseEvent *event );
645 
647  QPoint mouseLastXY();
648 
655  void setPreviewModeEnabled( bool previewEnabled );
656 
664  bool previewModeEnabled() const;
665 
675  void setPreviewMode( QgsPreviewEffect::PreviewMode mode );
676 
685  QgsPreviewEffect::PreviewMode previewMode() const;
686 
695  QgsSnappingUtils *snappingUtils() const;
696 
705  void setSnappingUtils( QgsSnappingUtils *utils );
706 
717  void setExpressionContextScope( const QgsExpressionContextScope &scope ) { mExpressionContextScope = scope; }
718 
727  QgsExpressionContextScope &expressionContextScope() { return mExpressionContextScope; }
728 
736  const QgsExpressionContextScope &expressionContextScope() const { return mExpressionContextScope; } SIP_SKIP
737 
744  QgsExpressionContextScope *defaultExpressionContextScope() const SIP_FACTORY;
745 
746  QgsExpressionContext createExpressionContext() const override;
747 
752  void setSegmentationTolerance( double tolerance );
753 
758  void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type );
759 
764  QList< QgsMapCanvasAnnotationItem *> annotationItems() const;
765 
771  bool annotationsVisible() const { return mAnnotationsVisible; }
772 
778  void setAnnotationsVisible( bool visible );
779 
784  void setLabelingEngineSettings( const QgsLabelingEngineSettings &settings );
785 
790  const QgsLabelingEngineSettings &labelingEngineSettings() const;
791 
800  bool previewJobsEnabled() const;
801 
810  void setPreviewJobsEnabled( bool enabled );
811 
817  void setCustomDropHandlers( const QVector<QPointer<QgsCustomDropHandler >> &handlers ) SIP_SKIP;
818 
829  void setTemporalRange( const QgsDateTimeRange &range );
830 
837  const QgsDateTimeRange &temporalRange() const;
838 
850  void installInteractionBlocker( QgsMapCanvasInteractionBlocker *blocker );
851 
859  void removeInteractionBlocker( QgsMapCanvasInteractionBlocker *blocker );
860 
866  bool allowInteraction( QgsMapCanvasInteractionBlocker::Interaction interaction ) const;
867 
868  public slots:
869 
871  void refresh();
872 
882  void refreshAllLayers();
883 
892  void redrawAllLayers();
893 
895  void selectionChangedSlot();
896 
898  void saveAsImage( const QString &fileName, QPixmap *QPixmap = nullptr, const QString & = "PNG" );
899 
901  void layerStateChange();
902 
910  void setRenderFlag( bool flag );
911 
916  void stopRendering();
917 
919  void readProject( const QDomDocument & );
920 
922  void writeProject( QDomDocument & );
923 
932  void setMagnificationFactor( double factor, const QgsPointXY *center = nullptr );
933 
939  void setScaleLocked( bool isLocked );
940 
942  void zoomIn();
943 
945  void zoomOut();
946 
951  void zoomToSelected( QgsVectorLayer *layer = nullptr );
952 
958  void zoomToSelected( const QList<QgsMapLayer *> &layers );
959 
965  void setZoomResolutions( const QList<double> &resolutions ) { mZoomResolutions = resolutions; }
966 
970  double zoomInFactor() const;
971 
975  double zoomOutFactor() const;
976 
982  const QList<double> &zoomResolutions() const { return mZoomResolutions; }
983 
992  QgsDoubleRange zRange() const;
993 
1002  void setZRange( const QgsDoubleRange &range );
1003 
1004  private slots:
1006  void mapToolDestroyed();
1007 
1009  void rendererJobFinished();
1010 
1012  void previewJobFinished();
1013 
1014  void mapUpdateTimeout();
1015 
1016  void refreshMap();
1017 
1018  void mapThemeChanged( const QString &theme );
1020  void mapThemeRenamed( const QString &theme, const QString &newTheme );
1021 
1022  void updateDevicePixelFromScreen();
1023 
1024  signals:
1025 
1030  void xyCoordinates( const QgsPointXY &p );
1031 
1033  void scaleChanged( double );
1034 
1041  void scaleLockChanged( bool locked );
1042 
1043 
1046 
1051  void rotationChanged( double );
1052 
1057  void magnificationChanged( double );
1058 
1064 
1065  // TODO: deprecate when decorations are reimplemented as map canvas items
1066 
1077  void renderComplete( QPainter * );
1078 
1079  // ### QGIS 3: renamte to mapRefreshFinished()
1082 
1083  // ### QGIS 3: rename to mapRefreshStarted()
1086 
1092 
1095 
1097  void keyPressed( QKeyEvent *e );
1098 
1100  void keyReleased( QKeyEvent *e );
1101 
1106  void mapToolSet( QgsMapTool *newTool, QgsMapTool *oldTool );
1107 
1108 
1111 
1114 
1117 
1123 
1129 
1135 
1141 
1147  void themeChanged( const QString &theme );
1148 
1150  void messageEmitted( const QString &title, const QString &message, Qgis::MessageLevel = Qgis::MessageLevel::Info );
1151 
1159  void renderErrorOccurred( const QString &error, QgsMapLayer *layer );
1160 
1171  void panDistanceBearingChanged( double distance, QgsUnitTypes::DistanceUnit unit, double bearing );
1172 
1177  void tapAndHoldGestureOccurred( const QgsPointXY &mapPoint, QTapAndHoldGesture *gesture );
1178 
1185 
1195 
1202  void contextMenuAboutToShow( QMenu *menu, QgsMapMouseEvent *event );
1203 
1204  protected:
1205 
1206  bool event( QEvent *e ) override;
1207  void keyPressEvent( QKeyEvent *e ) override;
1208  void keyReleaseEvent( QKeyEvent *e ) override;
1209  void mouseDoubleClickEvent( QMouseEvent *e ) override;
1210  void mouseMoveEvent( QMouseEvent *e ) override;
1211  void mousePressEvent( QMouseEvent *e ) override;
1212  void mouseReleaseEvent( QMouseEvent *e ) override;
1213  void wheelEvent( QWheelEvent *e ) override;
1214  void resizeEvent( QResizeEvent *e ) override;
1215  void paintEvent( QPaintEvent *e ) override;
1216  void dragEnterEvent( QDragEnterEvent *e ) override;
1217  bool viewportEvent( QEvent *event ) override;
1218 
1220  void moveCanvasContents( bool reset = false );
1221 
1222  void dropEvent( QDropEvent *event ) override;
1223 
1224  void showEvent( QShowEvent *event ) override;
1225 
1227  class CanvasProperties;
1228 
1230  std::unique_ptr<CanvasProperties> mCanvasProperties;
1231 
1232 #if 0
1233 
1238  void connectNotify( const char *signal ) override;
1239 #endif
1240 
1241  protected slots:
1243  void updateCanvasItemPositions();
1244 
1245  private slots:
1246 
1247  void layerRepaintRequested( bool deferred );
1248 
1249  void autoRefreshTriggered();
1250 
1251  void updateAutoRefreshTimer();
1252 
1253  void projectThemesChanged();
1254 
1255  void startPreviewJob( int number );
1256 
1257  private:
1258 
1259  // Restore scale RAII
1260  class ScaleRestorer
1261  {
1262  public:
1263  ScaleRestorer( QgsMapCanvas *canvas ):
1264  mCanvas( canvas )
1265  {
1266  mLockedScale = mCanvas->mapSettings().scale();
1267  };
1268 
1269  ~ScaleRestorer()
1270  {
1271  QgsRectangle newExtent = mCanvas->mapSettings().extent();
1272  newExtent.scale( mLockedScale / mCanvas->mapSettings().scale() );
1273  mCanvas->mSettings.setExtent( newExtent );
1274  };
1275 
1276  private:
1277  QgsMapCanvas *mCanvas;
1278  double mLockedScale;
1279  };
1280 
1282  QgsMapSettings mSettings;
1283 
1285  QgsMapCanvasMap *mMap = nullptr;
1286 
1291  QgsTemporalController *mController = nullptr;
1292 
1294  bool mFrozen = false;
1295 
1297  bool mRefreshScheduled = false;
1298 
1300  bool mRefreshAfterJob = false;
1301 
1303  bool mRenderFlag = true;
1304 
1306  QPointer< QgsMapLayer > mCurrentLayer;
1307 
1309  QGraphicsScene *mScene = nullptr;
1310 
1312  QgsMapTool *mMapTool = nullptr;
1313 
1315  QgsMapTool *mLastNonZoomMapTool = nullptr;
1316 
1318  QgsProject *mProject = nullptr;
1319 
1321  QList <QgsRectangle> mLastExtent;
1322  int mLastExtentIndex = -1;
1323 
1325  double mWheelZoomFactor = 2.0;
1326 
1328  QTimer mMapUpdateTimer;
1329 
1331  QgsMapRendererQImageJob *mJob = nullptr;
1332 
1334  bool mJobCanceled = false;
1335 
1337  std::unique_ptr< QgsLabelingResults > mLabelingResults;
1338 
1340  bool mLabelingResultsOutdated = false;
1341 
1346  std::unique_ptr< QgsRenderedItemResults > mRenderedItemResults;
1347 
1352  std::unique_ptr< QgsRenderedItemResults > mPreviousRenderedItemResults;
1353 
1359  bool mRenderedItemResultsOutdated = false;
1360 
1362  bool mUseParallelRendering = false;
1363 
1365  bool mDrawRenderingStats = false;
1366 
1368  QgsMapRendererCache *mCache = nullptr;
1369 
1370  QTimer *mResizeTimer = nullptr;
1371  QTimer *mRefreshTimer = nullptr;
1372 
1373  QgsPreviewEffect *mPreviewEffect = nullptr;
1374 
1375  QgsRectangle imageRect( const QImage &img, const QgsMapSettings &mapSettings );
1376 
1377  QgsSnappingUtils *mSnappingUtils = nullptr;
1378 
1379  QList< QgsMapRendererQImageJob * > mPreviewJobs;
1380 
1382  bool mScaleLocked = false;
1383 
1384  QgsExpressionContextScope mExpressionContextScope;
1385 
1387  QRect mZoomRect;
1388 
1390  bool mZoomDragging = false;
1391 
1393  std::unique_ptr< QgsRubberBand > mZoomRubberBand;
1394 
1395  QCursor mZoomCursor;
1396 
1397  QTimer mAutoRefreshTimer;
1398 
1399  QTimer mPreviewTimer;
1400  QMetaObject::Connection mPreviewTimerConnection;
1401 
1402  QString mTheme;
1403 
1404  QgsPointXY mCursorPoint;
1405 
1406  bool mAnnotationsVisible = true;
1407 
1408  bool mUsePreviewJobs = false;
1409 
1410  QHash< QString, int > mLastLayerRenderTime;
1411 
1412  QVector<QPointer<QgsCustomDropHandler >> mDropHandlers;
1413 
1414  QgsDistanceArea mDa;
1415  QList<double> mZoomResolutions;
1416 
1417  QList< QgsMapCanvasInteractionBlocker * > mInteractionBlockers;
1418 
1419  int mBlockItemPositionUpdates = 0;
1420 
1421  QMetaObject::Connection mScreenDpiChangedConnection;
1422 
1423  std::unique_ptr< QgsTemporaryCursorOverride > mTemporaryCursorOverride;
1424 
1429  QgsPointXY cursorPoint() const;
1430 
1435  void updateMapSize();
1436 
1442  void beginZoomRect( QPoint pos );
1443 
1449  void endZoomRect( QPoint pos );
1450 
1459  bool boundingBoxOfFeatureIds( const QgsFeatureIds &ids, QgsVectorLayer *layer, QgsRectangle &bbox, QString &errorMsg ) const;
1460 
1467  QgsRectangle optimalExtentForPointLayer( QgsVectorLayer *layer, const QgsPointXY &center, int scaleFactor = 5 );
1468 
1469  void setLayersPrivate( const QList<QgsMapLayer *> &layers );
1470 
1471  void startPreviewJobs();
1472  void stopPreviewJobs();
1473  void schedulePreviewJob( int number );
1474 
1478  bool panOperationInProgress();
1479 
1480  int nextZoomLevel( const QList<double> &resolutions, bool zoomIn = true ) const;
1481 
1486  void clearTemporalCache();
1487 
1491  void clearElevationCache();
1492 
1493  void showContextMenu( QgsMapMouseEvent *event );
1494 
1495  friend class TestQgsMapCanvas;
1496 
1497 }; // class QgsMapCanvas
1498 
1499 // clazy:excludeall=qstring-allocations
1500 
1501 #endif
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition: qgis.h:107
Abstract base class for all geometries.
This class represents a coordinate reference system (CRS).
Custom exception class for Coordinate Reference System related exceptions.
Definition: qgsexception.h:66
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
QgsRange which stores a range of double values.
Definition: qgsrange.h:203
Abstract interface for generating an expression context.
Single scope for storing variables and functions for use within a QgsExpressionContext.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
A class for highlight features on the map.
Definition: qgshighlight.h:62
Stores global configuration for labeling engine.
Class that stores computed placement from labeling engine.
An interactive map canvas item which displays a QgsAnnotation.
An interface for objects which block interactions with a QgsMapCanvas.
Interaction
Available interactions to block.
Deprecated to be deleted, stuff from here should be moved elsewhere.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:89
void messageEmitted(const QString &title, const QString &message, Qgis::MessageLevel=Qgis::MessageLevel::Info)
emit a message (usually to be displayed in a message bar)
void contextMenuAboutToShow(QMenu *menu, QgsMapMouseEvent *event)
Emitted before the map canvas context menu will be shown.
const QList< double > & zoomResolutions() const
Definition: qgsmapcanvas.h:982
void extentsChanged()
Emitted when the extents of the map change.
void xyCoordinates(const QgsPointXY &p)
Emits current mouse position.
void magnificationChanged(double)
Emitted when the scale of the map changes.
void setZoomResolutions(const QList< double > &resolutions)
Set a list of resolutions (map units per pixel) to which to "snap to" when zooming the map.
Definition: qgsmapcanvas.h:965
QString theme() const
Returns the map's theme shown in the canvas, if set.
Definition: qgsmapcanvas.h:571
void renderComplete(QPainter *)
Emitted when the canvas has rendered.
void tapAndHoldGestureOccurred(const QgsPointXY &mapPoint, QTapAndHoldGesture *gesture)
Emitted whenever a tap and hold gesture occurs at the specified map point.
void zoomNextStatusChanged(bool)
Emitted when zoom next status changed.
void rotationChanged(double)
Emitted when the rotation of the map changes.
void selectionChanged(QgsVectorLayer *layer)
Emitted when selection in any layer gets changed.
bool scaleLocked() const
Returns whether the scale is locked, so zooming can be performed using magnication.
Definition: qgsmapcanvas.h:617
QgsExpressionContextScope & expressionContextScope()
Returns a reference to the expression context scope for the map canvas.
Definition: qgsmapcanvas.h:727
void zRangeChanged()
Emitted when the map canvas z (elevation) range changes.
void mapToolSet(QgsMapTool *newTool, QgsMapTool *oldTool)
Emit map tool changed with the old tool.
void canvasColorChanged()
Emitted when canvas background color changes.
void currentLayerChanged(QgsMapLayer *layer)
Emitted when the current layer is changed.
void renderErrorOccurred(const QString &error, QgsMapLayer *layer)
Emitted whenever an error is encountered during a map render operation.
void mapRefreshCanceled()
Emitted when the pending map refresh has been canceled.
void renderStarting()
Emitted when the canvas is about to be rendered.
std::unique_ptr< CanvasProperties > mCanvasProperties
Handle pattern for implementation object.
void keyReleased(QKeyEvent *e)
Emit key release event.
void layerStyleOverridesChanged()
Emitted when the configuration of overridden layer styles changes.
void scaleChanged(double)
Emitted when the scale of the map changes.
void scaleLockChanged(bool locked)
Emitted when the scale locked state of the map changes.
bool renderFlag() const
Returns true if canvas render is disabled as a result of user disabling renders via the GUI.
Definition: qgsmapcanvas.h:518
void panDistanceBearingChanged(double distance, QgsUnitTypes::DistanceUnit unit, double bearing)
Emitted whenever the distance or bearing of an in-progress panning operation is changed.
void temporalRangeChanged()
Emitted when the map canvas temporal range changes.
void themeChanged(const QString &theme)
Emitted when the canvas has been assigned a different map theme.
void destinationCrsChanged()
Emitted when map CRS has changed.
void transformContextChanged()
Emitted when the canvas transform context is changed.
void keyPressed(QKeyEvent *e)
Emit key press event.
void mapCanvasRefreshed()
Emitted when canvas finished a refresh request.
void zoomLastStatusChanged(bool)
Emitted when zoom last status changed.
const QgsExpressionContextScope & expressionContextScope() const
Returns a const reference to the expression context scope for the map canvas.
Definition: qgsmapcanvas.h:736
void layersChanged()
Emitted when a new set of layers has been received.
void setExpressionContextScope(const QgsExpressionContextScope &scope)
Sets an expression context scope for the map canvas.
Definition: qgsmapcanvas.h:717
Base class for all map layer types.
Definition: qgsmaplayer.h:73
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
A widget that displays an overview map.
This class is responsible for keeping cache of rendered images resulting from a map rendering job.
Intermediate base class adding functionality that allows client to query the rendered image.
The QgsMapSettings class contains configuration for rendering of the map.
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:39
Abstract base class for all map tools.
Definition: qgsmaptool.h:71
A class to represent a 2D point.
Definition: qgspointxy.h:59
A graphics effect which can be applied to a widget to simulate various printing and color blindness m...
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition: qgsproject.h:101
A rectangle specified with double values.
Definition: qgsrectangle.h:42
void scale(double scaleFactor, const QgsPointXY *c=nullptr)
Scale the rectangle around its center point.
Definition: qgsrectangle.h:256
A QgsRectangle with associated coordinate reference system.
Stores collated details of rendered items during a map rendering operation.
A class for drawing transient features (e.g.
Definition: qgsrubberband.h:52
This class has all the configuration of snapping and can return answers to snapping queries.
A controller base class for temporal objects, contains a signal for notifying updates of the objects ...
Temporarily sets a cursor override for the QApplication for the lifetime of the object.
Definition: qgsguiutils.h:221
DistanceUnit
Units of distance.
Definition: qgsunittypes.h:68
Represents a vector layer which manages a vector based data sets.
#define SIP_THROW(name)
Definition: qgis_sip.h:189
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177
#define SIP_KEEPREFERENCE
Definition: qgis_sip.h:86
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_FACTORY
Definition: qgis_sip.h:76
#define SIP_END
Definition: qgis_sip.h:194
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeatureid.h:37
const QgsCoordinateReferenceSystem & crs