QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
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
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 
167  const QgsLabelingResults *labelingResults() const;
168 
173  void setCachingEnabled( bool enabled );
174 
179  bool isCachingEnabled() const;
180 
185  void clearCache();
186 
196  void waitWhileRendering();
197 
202  void setParallelRenderingEnabled( bool enabled );
203 
208  bool isParallelRenderingEnabled() const;
209 
214  void setMapUpdateInterval( int timeMilliseconds );
215 
220  int mapUpdateInterval() const;
221 
226  double scale() const;
227 
229  double mapUnitsPerPixel() const;
230 
232  QgsRectangle extent() const;
234  QgsRectangle fullExtent() const;
235 
247  void setExtent( const QgsRectangle &r, bool magnified = false );
248 
257  bool setReferencedExtent( const QgsReferencedRectangle &extent ) SIP_THROW( QgsCsException );
258 
263  double rotation() const;
264 
269  void setRotation( double degrees );
270 
275  void setCenter( const QgsPointXY &center );
276 
281  QgsPointXY center() const;
282 
284  void zoomToFullExtent();
285 
287  void zoomToPreviousExtent();
288 
290  void zoomToNextExtent();
291 
293  void clearExtentHistory();
294 
295 
301  void zoomToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids );
302 
309  void panToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids, bool alwaysRecenter = true );
310 
312  void panToSelected( QgsVectorLayer *layer = nullptr );
313 
319  void panToSelected( const QList<QgsMapLayer *> &layers );
320 
333  void flashFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids,
334  const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ),
335  int flashes = 3, int duration = 500 );
336 
349  void flashGeometries( const QList< QgsGeometry > &geometries, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem(),
350  const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ),
351  int flashes = 3, int duration = 500 );
352 
354  void setMapTool( QgsMapTool *mapTool, bool clean = false );
355 
363  void unsetMapTool( QgsMapTool *mapTool );
364 
366  QgsMapTool *mapTool();
367 
373  void setProject( QgsProject *project );
374 
381  QgsProject *project();
382 
384  void setCanvasColor( const QColor &_newVal );
386  QColor canvasColor() const;
387 
392  void setSelectionColor( const QColor &color );
393 
398  QColor selectionColor() const;
399 
401  void updateScale();
402 
404  QgsMapLayer *layer( int index );
405 
407  int layerCount() const;
408 
413  QList<QgsMapLayer *> layers() const;
414 
424  void freeze( bool frozen = true );
425 
433  bool isFrozen() const;
434 
443  bool renderFlag() const { return mRenderFlag; }
444 
449  QgsUnitTypes::DistanceUnit mapUnits() const;
450 
456  QMap<QString, QString> layerStyleOverrides() const;
457 
469  void setLayerStyleOverrides( const QMap<QString, QString> &overrides );
470 
489  void setTheme( const QString &theme );
490 
496  QString theme() const { return mTheme; }
497 
499  const QgsMapToPixel *getCoordinateTransform();
500 
502  bool isDrawing();
503 
505  QgsMapLayer *currentLayer();
506 
508  void setWheelFactor( double factor );
509 
517  void zoomScale( double scale, bool ignoreScaleLock = false );
518 
526  void zoomByFactor( double scaleFactor, const QgsPointXY *center = nullptr, bool ignoreScaleLock = false );
527 
529  void zoomWithCenter( int x, int y, bool zoomIn );
530 
535  void zoomToFeatureExtent( QgsRectangle &rect );
536 
542  bool scaleLocked() const { return mScaleLocked;}
543 
545  void enableAntiAliasing( bool flag );
546 
548  bool antiAliasingEnabled() const { return mSettings.testFlag( QgsMapSettings::Antialiasing ); }
549 
551  void enableMapTileRendering( bool flag );
552 
553  // following 2 methods should be moved elsewhere or changed to private
554  // currently used by pan map tool
556  void panActionEnd( QPoint releasePoint );
557 
558 #ifndef SIP_RUN
559 
565  void panActionStart( QPoint releasePoint );
566 #endif
567 
569  void panAction( QMouseEvent *event );
570 
572  QPoint mouseLastXY();
573 
580  void setPreviewModeEnabled( bool previewEnabled );
581 
589  bool previewModeEnabled() const;
590 
600  void setPreviewMode( QgsPreviewEffect::PreviewMode mode );
601 
610  QgsPreviewEffect::PreviewMode previewMode() const;
611 
620  QgsSnappingUtils *snappingUtils() const;
621 
630  void setSnappingUtils( QgsSnappingUtils *utils );
631 
642  void setExpressionContextScope( const QgsExpressionContextScope &scope ) { mExpressionContextScope = scope; }
643 
652  QgsExpressionContextScope &expressionContextScope() { return mExpressionContextScope; }
653 
661  const QgsExpressionContextScope &expressionContextScope() const { return mExpressionContextScope; } SIP_SKIP
662 
669  QgsExpressionContextScope *defaultExpressionContextScope() SIP_FACTORY;
670 
675  void setSegmentationTolerance( double tolerance );
676 
681  void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type );
682 
687  QList< QgsMapCanvasAnnotationItem *> annotationItems() const;
688 
694  bool annotationsVisible() const { return mAnnotationsVisible; }
695 
701  void setAnnotationsVisible( bool visible );
702 
707  void setLabelingEngineSettings( const QgsLabelingEngineSettings &settings );
708 
713  const QgsLabelingEngineSettings &labelingEngineSettings() const;
714 
723  bool previewJobsEnabled() const;
724 
733  void setPreviewJobsEnabled( bool enabled );
734 
740  void setCustomDropHandlers( const QVector<QPointer<QgsCustomDropHandler >> &handlers ) SIP_SKIP;
741 
752  void setTemporalRange( const QgsDateTimeRange &range );
753 
760  const QgsDateTimeRange &temporalRange() const;
761 
773  void installInteractionBlocker( QgsMapCanvasInteractionBlocker *blocker );
774 
782  void removeInteractionBlocker( QgsMapCanvasInteractionBlocker *blocker );
783 
789  bool allowInteraction( QgsMapCanvasInteractionBlocker::Interaction interaction ) const;
790 
791  public slots:
792 
794  void refresh();
795 
805  void refreshAllLayers();
806 
815  void redrawAllLayers();
816 
818  void selectionChangedSlot();
819 
821  void saveAsImage( const QString &fileName, QPixmap *QPixmap = nullptr, const QString & = "PNG" );
822 
824  void layerStateChange();
825 
833  void setRenderFlag( bool flag );
834 
839  void stopRendering();
840 
842  void readProject( const QDomDocument & );
843 
845  void writeProject( QDomDocument & );
846 
855  void setMagnificationFactor( double factor, const QgsPointXY *center = nullptr );
856 
862  void setScaleLocked( bool isLocked );
863 
865  void zoomIn();
866 
868  void zoomOut();
869 
874  void zoomToSelected( QgsVectorLayer *layer = nullptr );
875 
881  void zoomToSelected( const QList<QgsMapLayer *> &layers );
882 
888  void setZoomResolutions( const QList<double> &resolutions ) { mZoomResolutions = resolutions; }
889 
893  double zoomInFactor() const;
894 
898  double zoomOutFactor() const;
899 
905  const QList<double> &zoomResolutions() const { return mZoomResolutions; }
906 
915  QgsDoubleRange zRange() const;
916 
925  void setZRange( const QgsDoubleRange &range );
926 
927  private slots:
929  void mapToolDestroyed();
930 
932  void rendererJobFinished();
933 
935  void previewJobFinished();
936 
937  void mapUpdateTimeout();
938 
939  void refreshMap();
940 
941  void mapThemeChanged( const QString &theme );
943  void mapThemeRenamed( const QString &theme, const QString &newTheme );
944 
945  signals:
946 
951  void xyCoordinates( const QgsPointXY &p );
952 
954  void scaleChanged( double );
955 
958 
963  void rotationChanged( double );
964 
969  void magnificationChanged( double );
970 
976 
977  // TODO: deprecate when decorations are reimplemented as map canvas items
978 
989  void renderComplete( QPainter * );
990 
991  // ### QGIS 3: renamte to mapRefreshFinished()
994 
995  // ### QGIS 3: rename to mapRefreshStarted()
998 
1004 
1007 
1009  void keyPressed( QKeyEvent *e );
1010 
1012  void keyReleased( QKeyEvent *e );
1013 
1018  void mapToolSet( QgsMapTool *newTool, QgsMapTool *oldTool );
1019 
1020 
1023 
1026 
1029 
1035 
1041 
1047 
1053 
1059  void themeChanged( const QString &theme );
1060 
1062  void messageEmitted( const QString &title, const QString &message, Qgis::MessageLevel = Qgis::Info );
1063 
1071  void renderErrorOccurred( const QString &error, QgsMapLayer *layer );
1072 
1083  void panDistanceBearingChanged( double distance, QgsUnitTypes::DistanceUnit unit, double bearing );
1084 
1089  void tapAndHoldGestureOccurred( const QgsPointXY &mapPoint, QTapAndHoldGesture *gesture );
1090 
1097 
1107 
1114  void contextMenuAboutToShow( QMenu *menu, QgsMapMouseEvent *event );
1115 
1116  protected:
1117 
1118  bool event( QEvent *e ) override;
1119  void keyPressEvent( QKeyEvent *e ) override;
1120  void keyReleaseEvent( QKeyEvent *e ) override;
1121  void mouseDoubleClickEvent( QMouseEvent *e ) override;
1122  void mouseMoveEvent( QMouseEvent *e ) override;
1123  void mousePressEvent( QMouseEvent *e ) override;
1124  void mouseReleaseEvent( QMouseEvent *e ) override;
1125  void wheelEvent( QWheelEvent *e ) override;
1126  void resizeEvent( QResizeEvent *e ) override;
1127  void paintEvent( QPaintEvent *e ) override;
1128  void dragEnterEvent( QDragEnterEvent *e ) override;
1129 
1131  void moveCanvasContents( bool reset = false );
1132 
1133  void dropEvent( QDropEvent *event ) override;
1134 
1135 
1137  class CanvasProperties;
1138 
1140  std::unique_ptr<CanvasProperties> mCanvasProperties;
1141 
1142 #if 0
1143 
1148  void connectNotify( const char *signal ) override;
1149 #endif
1150 
1151  protected slots:
1153  void updateCanvasItemPositions();
1154 
1155  private slots:
1156 
1157  void layerRepaintRequested( bool deferred );
1158 
1159  void autoRefreshTriggered();
1160 
1161  void updateAutoRefreshTimer();
1162 
1163  void projectThemesChanged();
1164 
1165  void startPreviewJob( int number );
1166 
1167  private:
1168 
1169  // Restore scale RAII
1170  class ScaleRestorer
1171  {
1172  public:
1173  ScaleRestorer( QgsMapCanvas *canvas ):
1174  mCanvas( canvas )
1175  {
1176  mLockedScale = mCanvas->mapSettings().scale();
1177  };
1178 
1179  ~ScaleRestorer()
1180  {
1181  QgsRectangle newExtent = mCanvas->mapSettings().extent();
1182  newExtent.scale( mLockedScale / mCanvas->mapSettings().scale() );
1183  mCanvas->mSettings.setExtent( newExtent );
1184  };
1185 
1186  private:
1187  QgsMapCanvas *mCanvas;
1188  double mLockedScale;
1189  };
1190 
1192  QgsMapSettings mSettings;
1193 
1195  QgsMapCanvasMap *mMap = nullptr;
1196 
1201  QgsTemporalController *mController = nullptr;
1202 
1204  bool mFrozen = false;
1205 
1207  bool mRefreshScheduled = false;
1208 
1210  bool mRefreshAfterJob = false;
1211 
1213  bool mRenderFlag = true;
1214 
1216  QPointer< QgsMapLayer > mCurrentLayer;
1217 
1219  QGraphicsScene *mScene = nullptr;
1220 
1222  QgsMapTool *mMapTool = nullptr;
1223 
1225  QgsMapTool *mLastNonZoomMapTool = nullptr;
1226 
1228  QgsProject *mProject = nullptr;
1229 
1231  QList <QgsRectangle> mLastExtent;
1232  int mLastExtentIndex = -1;
1233 
1235  double mWheelZoomFactor = 2.0;
1236 
1238  QTimer mMapUpdateTimer;
1239 
1241  QgsMapRendererQImageJob *mJob = nullptr;
1242 
1244  bool mJobCanceled = false;
1245 
1247  QgsLabelingResults *mLabelingResults = nullptr;
1248 
1250  bool mUseParallelRendering = false;
1251 
1253  bool mDrawRenderingStats = false;
1254 
1256  QgsMapRendererCache *mCache = nullptr;
1257 
1258  QTimer *mResizeTimer = nullptr;
1259  QTimer *mRefreshTimer = nullptr;
1260 
1261  QgsPreviewEffect *mPreviewEffect = nullptr;
1262 
1263  QgsRectangle imageRect( const QImage &img, const QgsMapSettings &mapSettings );
1264 
1265  QgsSnappingUtils *mSnappingUtils = nullptr;
1266 
1267  QList< QgsMapRendererQImageJob * > mPreviewJobs;
1268 
1270  bool mScaleLocked = false;
1271 
1272  QgsExpressionContextScope mExpressionContextScope;
1273 
1275  QRect mZoomRect;
1276 
1278  bool mZoomDragging = false;
1279 
1281  std::unique_ptr< QgsRubberBand > mZoomRubberBand;
1282 
1283  QCursor mZoomCursor;
1284 
1285  QTimer mAutoRefreshTimer;
1286 
1287  QTimer mPreviewTimer;
1288  QMetaObject::Connection mPreviewTimerConnection;
1289 
1290  QString mTheme;
1291 
1292  QgsPointXY mCursorPoint;
1293 
1294  bool mAnnotationsVisible = true;
1295 
1296  bool mUsePreviewJobs = false;
1297 
1298  QHash< QString, int > mLastLayerRenderTime;
1299 
1300  QVector<QPointer<QgsCustomDropHandler >> mDropHandlers;
1301 
1302  QgsDistanceArea mDa;
1303  QList<double> mZoomResolutions;
1304 
1305  QList< QgsMapCanvasInteractionBlocker * > mInteractionBlockers;
1306 
1307  int mBlockItemPositionUpdates = 0;
1308 
1313  QgsPointXY cursorPoint() const;
1314 
1319  void updateMapSize();
1320 
1326  void beginZoomRect( QPoint pos );
1327 
1333  void endZoomRect( QPoint pos );
1334 
1343  bool boundingBoxOfFeatureIds( const QgsFeatureIds &ids, QgsVectorLayer *layer, QgsRectangle &bbox, QString &errorMsg ) const;
1344 
1351  QgsRectangle optimalExtentForPointLayer( QgsVectorLayer *layer, const QgsPointXY &center, int scaleFactor = 5 );
1352 
1353  void setLayersPrivate( const QList<QgsMapLayer *> &layers );
1354 
1355  void startPreviewJobs();
1356  void stopPreviewJobs();
1357  void schedulePreviewJob( int number );
1358 
1362  bool panOperationInProgress();
1363 
1364  int nextZoomLevel( const QList<double> &resolutions, bool zoomIn = true ) const;
1365 
1370  void clearTemporalCache();
1371 
1375  void clearElevationCache();
1376 
1377  void showContextMenu( QgsMapMouseEvent *event );
1378 
1379  friend class TestQgsMapCanvas;
1380 
1381 }; // class QgsMapCanvas
1382 
1383 // clazy:excludeall=qstring-allocations
1384 
1385 #endif
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition: qgis.h:89
@ Info
Definition: qgis.h:90
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
Single scope for storing variables and functions for use within a QgsExpressionContext.
A class for highlight features on the map.
Definition: qgshighlight.h:59
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 contextMenuAboutToShow(QMenu *menu, QgsMapMouseEvent *event)
Emitted before the map canvas context menu will be shown.
const QList< double > & zoomResolutions() const
Definition: qgsmapcanvas.h:905
void extentsChanged()
Emitted when the extents of the map change.
void messageEmitted(const QString &title, const QString &message, Qgis::MessageLevel=Qgis::Info)
emit a message (usually to be displayed in a message bar)
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:888
bool antiAliasingEnabled() const
true if antialiasing is enabled
Definition: qgsmapcanvas.h:548
QString theme() const
Returns the map's theme shown in the canvas, if set.
Definition: qgsmapcanvas.h:496
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:542
QgsExpressionContextScope & expressionContextScope()
Returns a reference to the expression context scope for the map canvas.
Definition: qgsmapcanvas.h:652
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.
bool renderFlag() const
Returns true if canvas render is disabled as a result of user disabling renders via the GUI.
Definition: qgsmapcanvas.h:443
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:661
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:642
Base class for all map layer types.
Definition: qgsmaplayer.h:85
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:44
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:235
A QgsRectangle with associated coordinate reference system.
A class for drawing transient features (e.g.
Definition: qgsrubberband.h:50
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