QGIS API Documentation  3.21.0-Master (564c892cfd)
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 
33 #include <QDomDocument>
34 #include <QGraphicsView>
35 
36 #include "qgsmapsettings.h" // TEMPORARY
37 #include "qgsprevieweffect.h" //for QgsPreviewEffect::PreviewMode
38 
39 #include <QTimer>
40 #include <QGestureEvent>
41 #include "qgis_gui.h"
42 
43 class QWheelEvent;
44 class QPixmap;
45 class QPaintEvent;
46 class QKeyEvent;
47 class ResizeEvent;
48 
49 class QColor;
50 class QDomDocument;
51 class QPaintDevice;
52 class QMouseEvent;
53 class QRubberBand;
54 class QGraphicsScene;
55 
56 class QgsMapToPixel;
57 class QgsMapLayer;
58 class QgsHighlight;
59 class QgsVectorLayer;
60 
61 class QgsLabelingResults;
62 
65 class QgsMapSettings;
66 class QgsMapCanvasMap;
68 class QgsMapTool;
69 class QgsSnappingUtils;
70 class QgsRubberBand;
73 
75 
76 class QMenu;
77 class QgsMapMouseEvent;
78 
79 
85 class GUI_EXPORT QgsMapCanvas : public QGraphicsView, public QgsExpressionContextGenerator
86 {
87 
88 #ifdef SIP_RUN
90  if ( qobject_cast<QgsMapCanvas *>( sipCpp ) != nullptr )
91  sipType = sipType_QgsMapCanvas;
92  else
93  sipType = nullptr;
94  SIP_END
95 #endif
96 
97  Q_OBJECT
98  Q_PROPERTY( QString theme READ theme WRITE setTheme NOTIFY themeChanged )
99  Q_PROPERTY( bool previewJobsEnabled READ previewJobsEnabled WRITE setPreviewJobsEnabled )
100 
101  public:
102 
104  QgsMapCanvas( QWidget *parent SIP_TRANSFERTHIS = nullptr );
105 
106  ~QgsMapCanvas() override;
107 
112  double magnificationFactor() const;
113 
125  void setLayers( const QList<QgsMapLayer *> &layers );
126 
127  void setCurrentLayer( QgsMapLayer *layer );
128 
133  const QgsMapSettings &mapSettings() const SIP_KEEPREFERENCE;
134 
141  void setTemporalController( QgsTemporalController *controller );
142 
149  const QgsTemporalController *temporalController() const;
150 
155  void setDestinationCrs( const QgsCoordinateReferenceSystem &crs );
156 
161  void setMapSettingsFlags( QgsMapSettings::Flags flags );
162 
171  const QgsLabelingResults *labelingResults( bool allowOutdatedResults = true ) const;
172 
177  void setCachingEnabled( bool enabled );
178 
183  bool isCachingEnabled() const;
184 
189  void clearCache();
190 
200  void waitWhileRendering();
201 
206  void setParallelRenderingEnabled( bool enabled );
207 
212  bool isParallelRenderingEnabled() const;
213 
218  void setMapUpdateInterval( int timeMilliseconds );
219 
224  int mapUpdateInterval() const;
225 
230  double scale() const;
231 
233  double mapUnitsPerPixel() const;
234 
236  QgsRectangle extent() const;
237 
246  QgsRectangle fullExtent() const;
247 
257  QgsRectangle projectExtent() const;
258 
270  void setExtent( const QgsRectangle &r, bool magnified = false );
271 
280  bool setReferencedExtent( const QgsReferencedRectangle &extent ) SIP_THROW( QgsCsException );
281 
286  double rotation() const;
287 
292  void setRotation( double degrees );
293 
298  void setCenter( const QgsPointXY &center );
299 
304  QgsPointXY center() const;
305 
311  void zoomToFullExtent();
312 
321  void zoomToProjectExtent();
322 
324  void zoomToPreviousExtent();
325 
327  void zoomToNextExtent();
328 
330  void clearExtentHistory();
331 
332 
338  void zoomToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids );
339 
346  void panToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids, bool alwaysRecenter = true );
347 
349  void panToSelected( QgsVectorLayer *layer = nullptr );
350 
356  void panToSelected( const QList<QgsMapLayer *> &layers );
357 
370  void flashFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids,
371  const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ),
372  int flashes = 3, int duration = 500 );
373 
386  void flashGeometries( const QList< QgsGeometry > &geometries, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem(),
387  const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ),
388  int flashes = 3, int duration = 500 );
389 
391  void setMapTool( QgsMapTool *mapTool, bool clean = false );
392 
400  void unsetMapTool( QgsMapTool *mapTool );
401 
403  QgsMapTool *mapTool();
404 
410  void setProject( QgsProject *project );
411 
418  QgsProject *project();
419 
421  void setCanvasColor( const QColor &_newVal );
423  QColor canvasColor() const;
424 
429  void setSelectionColor( const QColor &color );
430 
435  QColor selectionColor() const;
436 
438  void updateScale();
439 
441  QgsMapLayer *layer( int index );
442 
444  int layerCount() const;
445 
450  QList<QgsMapLayer *> layers() const;
451 
461  void freeze( bool frozen = true );
462 
470  bool isFrozen() const;
471 
480  bool renderFlag() const { return mRenderFlag; }
481 
486  QgsUnitTypes::DistanceUnit mapUnits() const;
487 
493  QMap<QString, QString> layerStyleOverrides() const;
494 
506  void setLayerStyleOverrides( const QMap<QString, QString> &overrides );
507 
526  void setTheme( const QString &theme );
527 
533  QString theme() const { return mTheme; }
534 
536  const QgsMapToPixel *getCoordinateTransform();
537 
539  bool isDrawing();
540 
542  QgsMapLayer *currentLayer();
543 
545  void setWheelFactor( double factor );
546 
554  void zoomScale( double scale, bool ignoreScaleLock = false );
555 
563  void zoomByFactor( double scaleFactor, const QgsPointXY *center = nullptr, bool ignoreScaleLock = false );
564 
566  void zoomWithCenter( int x, int y, bool zoomIn );
567 
572  void zoomToFeatureExtent( QgsRectangle &rect );
573 
579  bool scaleLocked() const { return mScaleLocked;}
580 
582  void enableAntiAliasing( bool flag );
583 
585  bool antiAliasingEnabled() const { return mSettings.testFlag( QgsMapSettings::Antialiasing ); }
586 
588  void enableMapTileRendering( bool flag );
589 
590  // following 2 methods should be moved elsewhere or changed to private
591  // currently used by pan map tool
593  void panActionEnd( QPoint releasePoint );
594 
595 #ifndef SIP_RUN
596 
602  void panActionStart( QPoint releasePoint );
603 #endif
604 
606  void panAction( QMouseEvent *event );
607 
609  QPoint mouseLastXY();
610 
617  void setPreviewModeEnabled( bool previewEnabled );
618 
626  bool previewModeEnabled() const;
627 
637  void setPreviewMode( QgsPreviewEffect::PreviewMode mode );
638 
647  QgsPreviewEffect::PreviewMode previewMode() const;
648 
657  QgsSnappingUtils *snappingUtils() const;
658 
667  void setSnappingUtils( QgsSnappingUtils *utils );
668 
679  void setExpressionContextScope( const QgsExpressionContextScope &scope ) { mExpressionContextScope = scope; }
680 
689  QgsExpressionContextScope &expressionContextScope() { return mExpressionContextScope; }
690 
698  const QgsExpressionContextScope &expressionContextScope() const { return mExpressionContextScope; } SIP_SKIP
699 
706  QgsExpressionContextScope *defaultExpressionContextScope() const SIP_FACTORY;
707 
708  QgsExpressionContext createExpressionContext() const override;
709 
714  void setSegmentationTolerance( double tolerance );
715 
720  void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type );
721 
726  QList< QgsMapCanvasAnnotationItem *> annotationItems() const;
727 
733  bool annotationsVisible() const { return mAnnotationsVisible; }
734 
740  void setAnnotationsVisible( bool visible );
741 
746  void setLabelingEngineSettings( const QgsLabelingEngineSettings &settings );
747 
752  const QgsLabelingEngineSettings &labelingEngineSettings() const;
753 
762  bool previewJobsEnabled() const;
763 
772  void setPreviewJobsEnabled( bool enabled );
773 
779  void setCustomDropHandlers( const QVector<QPointer<QgsCustomDropHandler >> &handlers ) SIP_SKIP;
780 
791  void setTemporalRange( const QgsDateTimeRange &range );
792 
799  const QgsDateTimeRange &temporalRange() const;
800 
812  void installInteractionBlocker( QgsMapCanvasInteractionBlocker *blocker );
813 
821  void removeInteractionBlocker( QgsMapCanvasInteractionBlocker *blocker );
822 
828  bool allowInteraction( QgsMapCanvasInteractionBlocker::Interaction interaction ) const;
829 
830  public slots:
831 
833  void refresh();
834 
844  void refreshAllLayers();
845 
854  void redrawAllLayers();
855 
857  void selectionChangedSlot();
858 
860  void saveAsImage( const QString &fileName, QPixmap *QPixmap = nullptr, const QString & = "PNG" );
861 
863  void layerStateChange();
864 
872  void setRenderFlag( bool flag );
873 
878  void stopRendering();
879 
881  void readProject( const QDomDocument & );
882 
884  void writeProject( QDomDocument & );
885 
894  void setMagnificationFactor( double factor, const QgsPointXY *center = nullptr );
895 
901  void setScaleLocked( bool isLocked );
902 
904  void zoomIn();
905 
907  void zoomOut();
908 
913  void zoomToSelected( QgsVectorLayer *layer = nullptr );
914 
920  void zoomToSelected( const QList<QgsMapLayer *> &layers );
921 
927  void setZoomResolutions( const QList<double> &resolutions ) { mZoomResolutions = resolutions; }
928 
932  double zoomInFactor() const;
933 
937  double zoomOutFactor() const;
938 
944  const QList<double> &zoomResolutions() const { return mZoomResolutions; }
945 
954  QgsDoubleRange zRange() const;
955 
964  void setZRange( const QgsDoubleRange &range );
965 
966  private slots:
968  void mapToolDestroyed();
969 
971  void rendererJobFinished();
972 
974  void previewJobFinished();
975 
976  void mapUpdateTimeout();
977 
978  void refreshMap();
979 
980  void mapThemeChanged( const QString &theme );
982  void mapThemeRenamed( const QString &theme, const QString &newTheme );
983 
984  signals:
985 
990  void xyCoordinates( const QgsPointXY &p );
991 
993  void scaleChanged( double );
994 
1001  void scaleLockChanged( bool locked );
1002 
1003 
1006 
1011  void rotationChanged( double );
1012 
1017  void magnificationChanged( double );
1018 
1024 
1025  // TODO: deprecate when decorations are reimplemented as map canvas items
1026 
1037  void renderComplete( QPainter * );
1038 
1039  // ### QGIS 3: renamte to mapRefreshFinished()
1042 
1043  // ### QGIS 3: rename to mapRefreshStarted()
1046 
1052 
1055 
1057  void keyPressed( QKeyEvent *e );
1058 
1060  void keyReleased( QKeyEvent *e );
1061 
1066  void mapToolSet( QgsMapTool *newTool, QgsMapTool *oldTool );
1067 
1068 
1071 
1074 
1077 
1083 
1089 
1095 
1101 
1107  void themeChanged( const QString &theme );
1108 
1110  void messageEmitted( const QString &title, const QString &message, Qgis::MessageLevel = Qgis::MessageLevel::Info );
1111 
1119  void renderErrorOccurred( const QString &error, QgsMapLayer *layer );
1120 
1131  void panDistanceBearingChanged( double distance, QgsUnitTypes::DistanceUnit unit, double bearing );
1132 
1137  void tapAndHoldGestureOccurred( const QgsPointXY &mapPoint, QTapAndHoldGesture *gesture );
1138 
1145 
1155 
1162  void contextMenuAboutToShow( QMenu *menu, QgsMapMouseEvent *event );
1163 
1164  protected:
1165 
1166  bool event( QEvent *e ) override;
1167  void keyPressEvent( QKeyEvent *e ) override;
1168  void keyReleaseEvent( QKeyEvent *e ) override;
1169  void mouseDoubleClickEvent( QMouseEvent *e ) override;
1170  void mouseMoveEvent( QMouseEvent *e ) override;
1171  void mousePressEvent( QMouseEvent *e ) override;
1172  void mouseReleaseEvent( QMouseEvent *e ) override;
1173  void wheelEvent( QWheelEvent *e ) override;
1174  void resizeEvent( QResizeEvent *e ) override;
1175  void paintEvent( QPaintEvent *e ) override;
1176  void dragEnterEvent( QDragEnterEvent *e ) override;
1177 
1179  void moveCanvasContents( bool reset = false );
1180 
1181  void dropEvent( QDropEvent *event ) override;
1182 
1183 
1185  class CanvasProperties;
1186 
1188  std::unique_ptr<CanvasProperties> mCanvasProperties;
1189 
1190 #if 0
1191 
1196  void connectNotify( const char *signal ) override;
1197 #endif
1198 
1199  protected slots:
1201  void updateCanvasItemPositions();
1202 
1203  private slots:
1204 
1205  void layerRepaintRequested( bool deferred );
1206 
1207  void autoRefreshTriggered();
1208 
1209  void updateAutoRefreshTimer();
1210 
1211  void projectThemesChanged();
1212 
1213  void startPreviewJob( int number );
1214 
1215  private:
1216 
1217  // Restore scale RAII
1218  class ScaleRestorer
1219  {
1220  public:
1221  ScaleRestorer( QgsMapCanvas *canvas ):
1222  mCanvas( canvas )
1223  {
1224  mLockedScale = mCanvas->mapSettings().scale();
1225  };
1226 
1227  ~ScaleRestorer()
1228  {
1229  QgsRectangle newExtent = mCanvas->mapSettings().extent();
1230  newExtent.scale( mLockedScale / mCanvas->mapSettings().scale() );
1231  mCanvas->mSettings.setExtent( newExtent );
1232  };
1233 
1234  private:
1235  QgsMapCanvas *mCanvas;
1236  double mLockedScale;
1237  };
1238 
1240  QgsMapSettings mSettings;
1241 
1243  QgsMapCanvasMap *mMap = nullptr;
1244 
1249  QgsTemporalController *mController = nullptr;
1250 
1252  bool mFrozen = false;
1253 
1255  bool mRefreshScheduled = false;
1256 
1258  bool mRefreshAfterJob = false;
1259 
1261  bool mRenderFlag = true;
1262 
1264  QPointer< QgsMapLayer > mCurrentLayer;
1265 
1267  QGraphicsScene *mScene = nullptr;
1268 
1270  QgsMapTool *mMapTool = nullptr;
1271 
1273  QgsMapTool *mLastNonZoomMapTool = nullptr;
1274 
1276  QgsProject *mProject = nullptr;
1277 
1279  QList <QgsRectangle> mLastExtent;
1280  int mLastExtentIndex = -1;
1281 
1283  double mWheelZoomFactor = 2.0;
1284 
1286  QTimer mMapUpdateTimer;
1287 
1289  QgsMapRendererQImageJob *mJob = nullptr;
1290 
1292  bool mJobCanceled = false;
1293 
1295  std::unique_ptr< QgsLabelingResults > mLabelingResults;
1296 
1298  bool mLabelingResultsOutdated = false;
1299 
1301  bool mUseParallelRendering = false;
1302 
1304  bool mDrawRenderingStats = false;
1305 
1307  QgsMapRendererCache *mCache = nullptr;
1308 
1309  QTimer *mResizeTimer = nullptr;
1310  QTimer *mRefreshTimer = nullptr;
1311 
1312  QgsPreviewEffect *mPreviewEffect = nullptr;
1313 
1314  QgsRectangle imageRect( const QImage &img, const QgsMapSettings &mapSettings );
1315 
1316  QgsSnappingUtils *mSnappingUtils = nullptr;
1317 
1318  QList< QgsMapRendererQImageJob * > mPreviewJobs;
1319 
1321  bool mScaleLocked = false;
1322 
1323  QgsExpressionContextScope mExpressionContextScope;
1324 
1326  QRect mZoomRect;
1327 
1329  bool mZoomDragging = false;
1330 
1332  std::unique_ptr< QgsRubberBand > mZoomRubberBand;
1333 
1334  QCursor mZoomCursor;
1335 
1336  QTimer mAutoRefreshTimer;
1337 
1338  QTimer mPreviewTimer;
1339  QMetaObject::Connection mPreviewTimerConnection;
1340 
1341  QString mTheme;
1342 
1343  QgsPointXY mCursorPoint;
1344 
1345  bool mAnnotationsVisible = true;
1346 
1347  bool mUsePreviewJobs = false;
1348 
1349  QHash< QString, int > mLastLayerRenderTime;
1350 
1351  QVector<QPointer<QgsCustomDropHandler >> mDropHandlers;
1352 
1353  QgsDistanceArea mDa;
1354  QList<double> mZoomResolutions;
1355 
1356  QList< QgsMapCanvasInteractionBlocker * > mInteractionBlockers;
1357 
1358  int mBlockItemPositionUpdates = 0;
1359 
1364  QgsPointXY cursorPoint() const;
1365 
1370  void updateMapSize();
1371 
1377  void beginZoomRect( QPoint pos );
1378 
1384  void endZoomRect( QPoint pos );
1385 
1394  bool boundingBoxOfFeatureIds( const QgsFeatureIds &ids, QgsVectorLayer *layer, QgsRectangle &bbox, QString &errorMsg ) const;
1395 
1402  QgsRectangle optimalExtentForPointLayer( QgsVectorLayer *layer, const QgsPointXY &center, int scaleFactor = 5 );
1403 
1404  void setLayersPrivate( const QList<QgsMapLayer *> &layers );
1405 
1406  void startPreviewJobs();
1407  void stopPreviewJobs();
1408  void schedulePreviewJob( int number );
1409 
1413  bool panOperationInProgress();
1414 
1415  int nextZoomLevel( const QList<double> &resolutions, bool zoomIn = true ) const;
1416 
1421  void clearTemporalCache();
1422 
1426  void clearElevationCache();
1427 
1428  void showContextMenu( QgsMapMouseEvent *event );
1429 
1430  friend class TestQgsMapCanvas;
1431 
1432 }; // class QgsMapCanvas
1433 
1434 // clazy:excludeall=qstring-allocations
1435 
1436 #endif
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition: qgis.h:105
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:86
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:944
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:927
bool antiAliasingEnabled() const
true if antialiasing is enabled
Definition: qgsmapcanvas.h:585
QString theme() const
Returns the map's theme shown in the canvas, if set.
Definition: qgsmapcanvas.h:533
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:579
QgsExpressionContextScope & expressionContextScope()
Returns a reference to the expression context scope for the map canvas.
Definition: qgsmapcanvas.h:689
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:480
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:698
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:679
Base class for all map layer types.
Definition: qgsmaplayer.h:70
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.
@ Antialiasing
Enable anti-aliasing for map rendering.
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:39
Abstract base class for all map tools.
Definition: qgsmaptool.h:66
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:99
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.
A class for drawing transient features (e.g.
Definition: qgsrubberband.h:51
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 ...
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