QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
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
25#include "qgsrectangle.h"
26#include "qgsfeatureid.h"
27#include "qgsgeometry.h"
30#include "qgsproject.h"
31#include "qgsdistancearea.h"
32#include "qgsmaprendererjob.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
44class QWheelEvent;
45class QPixmap;
46class QPaintEvent;
47class QKeyEvent;
48class ResizeEvent;
49
50class QColor;
51class QDomDocument;
52class QPaintDevice;
53class QMouseEvent;
54class QRubberBand;
55class QGraphicsScene;
56
57class QgsMapToPixel;
58class QgsMapLayer;
59class QgsHighlight;
60class QgsVectorLayer;
61
63
66class QgsMapSettings;
67class QgsMapCanvasMap;
69class QgsMapTool;
71class QgsRubberBand;
76
78class QgsScreenHelper;
79
80class QMenu;
82
83
89class GUI_EXPORT QgsMapCanvas : public QGraphicsView, public QgsExpressionContextGenerator
90{
91
92#ifdef SIP_RUN
94 if ( qobject_cast<QgsMapCanvas *>( sipCpp ) != nullptr )
95 sipType = sipType_QgsMapCanvas;
96 else
97 sipType = nullptr;
99#endif
100
101 Q_OBJECT
102 Q_PROPERTY( QString theme READ theme WRITE setTheme NOTIFY themeChanged )
103 Q_PROPERTY( bool previewJobsEnabled READ previewJobsEnabled WRITE setPreviewJobsEnabled )
104
105 public:
106
108 QgsMapCanvas( QWidget *parent SIP_TRANSFERTHIS = nullptr );
109
110 ~QgsMapCanvas() override;
111
116 double magnificationFactor() const;
117
129 void setLayers( const QList<QgsMapLayer *> &layers );
130
131 void setCurrentLayer( QgsMapLayer *layer );
132
137 const QgsMapSettings &mapSettings() const SIP_KEEPREFERENCE;
138
145 void setTemporalController( QgsTemporalController *controller );
146
153 const QgsTemporalController *temporalController() const;
154
159 void setDestinationCrs( const QgsCoordinateReferenceSystem &crs );
160
165 void setMapSettingsFlags( Qgis::MapSettingsFlags flags );
166
175 const QgsLabelingResults *labelingResults( bool allowOutdatedResults = true ) const;
176
186 const QgsRenderedItemResults *renderedItemResults( bool allowOutdatedResults = true ) const;
187
192 void setCachingEnabled( bool enabled );
193
198 bool isCachingEnabled() const;
199
204 void clearCache();
205
210 void cancelJobs() SIP_SKIP;
211
221 void waitWhileRendering();
222
227 void setParallelRenderingEnabled( bool enabled );
228
233 bool isParallelRenderingEnabled() const;
234
239 void setMapUpdateInterval( int timeMilliseconds );
240
245 int mapUpdateInterval() const;
246
251 double scale() const;
252
254 double mapUnitsPerPixel() const;
255
257 QgsRectangle extent() const;
258
267 QgsRectangle fullExtent() const;
268
278 QgsRectangle projectExtent() const;
279
291 void setExtent( const QgsRectangle &r, bool magnified = false );
292
301 bool setReferencedExtent( const QgsReferencedRectangle &extent ) SIP_THROW( QgsCsException );
302
307 double rotation() const;
308
313 void setRotation( double degrees );
314
319 void setCenter( const QgsPointXY &center );
320
325 QgsPointXY center() const;
326
332 void zoomToFullExtent();
333
342 void zoomToProjectExtent();
343
345 void zoomToPreviousExtent();
346
348 void zoomToNextExtent();
349
351 void clearExtentHistory();
352
353
359 void zoomToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids );
360
367 void panToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids, bool alwaysRecenter = true );
368
370 void panToSelected( QgsMapLayer *layer = nullptr );
371
377 void panToSelected( const QList<QgsMapLayer *> &layers );
378
391 void flashFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids,
392 const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ),
393 int flashes = 3, int duration = 500 );
394
407 void flashGeometries( const QList< QgsGeometry > &geometries, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem(),
408 const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ),
409 int flashes = 3, int duration = 500 );
410
412 void setMapTool( QgsMapTool *mapTool, bool clean = false );
413
421 void unsetMapTool( QgsMapTool *mapTool );
422
424 QgsMapTool *mapTool();
425
431 void setProject( QgsProject *project );
432
439 QgsProject *project();
440
442 void setCanvasColor( const QColor &_newVal );
444 QColor canvasColor() const;
445
450 void setSelectionColor( const QColor &color );
451
456 QColor selectionColor() const;
457
459 void updateScale();
460
462 QgsMapLayer *layer( int index );
463
474 QgsMapLayer *layer( const QString &id );
475
479 int layerCount() const;
480
489 QList<QgsMapLayer *> layers( bool expandGroupLayers = false ) const;
490
500 void freeze( bool frozen = true );
501
509 bool isFrozen() const;
510
519 bool renderFlag() const { return mRenderFlag; }
520
525 QgsUnitTypes::DistanceUnit mapUnits() const;
526
532 QMap<QString, QString> layerStyleOverrides() const;
533
545 void setLayerStyleOverrides( const QMap<QString, QString> &overrides );
546
565 void setTheme( const QString &theme );
566
572 QString theme() const { return mTheme; }
573
575 const QgsMapToPixel *getCoordinateTransform();
576
578 bool isDrawing();
579
581 QgsMapLayer *currentLayer();
582
584 void setWheelFactor( double factor );
585
593 void zoomScale( double scale, bool ignoreScaleLock = false );
594
602 void zoomByFactor( double scaleFactor, const QgsPointXY *center = nullptr, bool ignoreScaleLock = false );
603
605 void zoomWithCenter( int x, int y, bool zoomIn );
606
611 void zoomToFeatureExtent( QgsRectangle &rect );
612
618 bool scaleLocked() const { return mScaleLocked;}
619
621 void enableAntiAliasing( bool flag );
622
624 bool antiAliasingEnabled() const;
625
627 void enableMapTileRendering( bool flag );
628
629 // following 2 methods should be moved elsewhere or changed to private
630 // currently used by pan map tool
632 void panActionEnd( QPoint releasePoint );
633
634#ifndef SIP_RUN
635
641 void panActionStart( QPoint releasePoint );
642#endif
643
645 void panAction( QMouseEvent *event );
646
648 QPoint mouseLastXY();
649
656 void setPreviewModeEnabled( bool previewEnabled );
657
665 bool previewModeEnabled() const;
666
676 void setPreviewMode( QgsPreviewEffect::PreviewMode mode );
677
686 QgsPreviewEffect::PreviewMode previewMode() const;
687
696 QgsSnappingUtils *snappingUtils() const;
697
706 void setSnappingUtils( QgsSnappingUtils *utils );
707
718 void setExpressionContextScope( const QgsExpressionContextScope &scope ) { mExpressionContextScope = scope; }
719
728 QgsExpressionContextScope &expressionContextScope() { return mExpressionContextScope; }
729
737 const QgsExpressionContextScope &expressionContextScope() const { return mExpressionContextScope; } SIP_SKIP
738
745 QgsExpressionContextScope *defaultExpressionContextScope() const SIP_FACTORY;
746
747 QgsExpressionContext createExpressionContext() const override;
748
753 void setSegmentationTolerance( double tolerance );
754
759 void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type );
760
765 QList< QgsMapCanvasAnnotationItem *> annotationItems() const;
766
772 bool annotationsVisible() const { return mAnnotationsVisible; }
773
779 void setAnnotationsVisible( bool visible );
780
785 void setLabelingEngineSettings( const QgsLabelingEngineSettings &settings );
786
791 const QgsLabelingEngineSettings &labelingEngineSettings() const;
792
801 bool previewJobsEnabled() const;
802
811 void setPreviewJobsEnabled( bool enabled );
812
818 void setCustomDropHandlers( const QVector<QPointer<QgsCustomDropHandler >> &handlers ) SIP_SKIP;
819
830 void setTemporalRange( const QgsDateTimeRange &range );
831
838 const QgsDateTimeRange &temporalRange() const;
839
851 void installInteractionBlocker( QgsMapCanvasInteractionBlocker *blocker );
852
860 void removeInteractionBlocker( QgsMapCanvasInteractionBlocker *blocker );
861
867 bool allowInteraction( QgsMapCanvasInteractionBlocker::Interaction interaction ) const;
868
869 public slots:
870
872 void refresh();
873
883 void refreshAllLayers();
884
893 void redrawAllLayers();
894
896 void selectionChangedSlot();
897
899 void saveAsImage( const QString &fileName, QPixmap *QPixmap = nullptr, const QString & = "PNG" );
900
902 void layerStateChange();
903
911 void setRenderFlag( bool flag );
912
917 void stopRendering();
918
920 void readProject( const QDomDocument & );
921
923 void writeProject( QDomDocument & );
924
933 void setMagnificationFactor( double factor, const QgsPointXY *center = nullptr );
934
940 void setScaleLocked( bool isLocked );
941
943 void zoomIn();
944
946 void zoomOut();
947
952 void zoomToSelected( QgsMapLayer *layer = nullptr );
953
959 void zoomToSelected( const QList<QgsMapLayer *> &layers );
960
966 void setZoomResolutions( const QList<double> &resolutions ) { mZoomResolutions = resolutions; }
967
971 double zoomInFactor() const;
972
976 double zoomOutFactor() const;
977
983 const QList<double> &zoomResolutions() const { return mZoomResolutions; }
984
993 QgsDoubleRange zRange() const;
994
1003 void setZRange( const QgsDoubleRange &range );
1004
1005 private slots:
1007 void mapToolDestroyed();
1008
1010 void rendererJobFinished();
1011
1013 void previewJobFinished();
1014
1015 void mapUpdateTimeout();
1016
1017 void refreshMap();
1018
1019 void mapThemeChanged( const QString &theme );
1021 void mapThemeRenamed( const QString &theme, const QString &newTheme );
1022
1023 void updateDevicePixelFromScreen();
1024
1025 signals:
1026
1031 void xyCoordinates( const QgsPointXY &p );
1032
1034 void scaleChanged( double );
1035
1042 void scaleLockChanged( bool locked );
1043
1044
1047
1052 void rotationChanged( double );
1053
1058 void magnificationChanged( double );
1059
1065
1066 // TODO: deprecate when decorations are reimplemented as map canvas items
1067
1078 void renderComplete( QPainter * );
1079
1080 // ### QGIS 3: renamte to mapRefreshFinished()
1083
1084 // ### QGIS 3: rename to mapRefreshStarted()
1087
1093
1096
1098 void keyPressed( QKeyEvent *e );
1099
1101 void keyReleased( QKeyEvent *e );
1102
1107 void mapToolSet( QgsMapTool *newTool, QgsMapTool *oldTool );
1108
1115
1118
1121
1127
1133
1139
1145
1151 void themeChanged( const QString &theme );
1152
1154 void messageEmitted( const QString &title, const QString &message, Qgis::MessageLevel = Qgis::MessageLevel::Info );
1155
1163 void renderErrorOccurred( const QString &error, QgsMapLayer *layer );
1164
1175 void panDistanceBearingChanged( double distance, QgsUnitTypes::DistanceUnit unit, double bearing );
1176
1181 void tapAndHoldGestureOccurred( const QgsPointXY &mapPoint, QTapAndHoldGesture *gesture );
1182
1189
1199
1206 void contextMenuAboutToShow( QMenu *menu, QgsMapMouseEvent *event );
1207
1208 protected:
1209
1210 bool event( QEvent *e ) override;
1211 void keyPressEvent( QKeyEvent *e ) override;
1212 void keyReleaseEvent( QKeyEvent *e ) override;
1213 void mouseDoubleClickEvent( QMouseEvent *e ) override;
1214 void mouseMoveEvent( QMouseEvent *e ) override;
1215 void mousePressEvent( QMouseEvent *e ) override;
1216 void mouseReleaseEvent( QMouseEvent *e ) override;
1217 void wheelEvent( QWheelEvent *e ) override;
1218 void resizeEvent( QResizeEvent *e ) override;
1219 void paintEvent( QPaintEvent *e ) override;
1220 void dragEnterEvent( QDragEnterEvent *e ) override;
1221 bool viewportEvent( QEvent *event ) override;
1222
1224 void moveCanvasContents( bool reset = false );
1225
1226 void dropEvent( QDropEvent *event ) override;
1227
1228 void showEvent( QShowEvent *event ) override;
1229
1231 class CanvasProperties;
1232
1234 std::unique_ptr<CanvasProperties> mCanvasProperties;
1235
1236#if 0
1237
1242 void connectNotify( const char *signal ) override;
1243#endif
1244
1245 protected slots:
1247 void updateCanvasItemPositions();
1248
1249 private slots:
1250
1251 void layerRepaintRequested( bool deferred );
1252
1253 void autoRefreshTriggered();
1254
1255 void updateAutoRefreshTimer();
1256
1257 void projectThemesChanged();
1258
1259 void startPreviewJob( int number );
1260
1261 void temporalControllerModeChanged();
1262
1263 private:
1264
1265 // Restore scale RAII
1266 class ScaleRestorer
1267 {
1268 public:
1269 ScaleRestorer( QgsMapCanvas *canvas ):
1270 mCanvas( canvas )
1271 {
1272 mLockedScale = mCanvas->mapSettings().scale();
1273 };
1274
1275 ~ScaleRestorer()
1276 {
1277 QgsRectangle newExtent = mCanvas->mapSettings().extent();
1278 newExtent.scale( mLockedScale / mCanvas->mapSettings().scale() );
1279 mCanvas->mSettings.setExtent( newExtent );
1280 };
1281
1282 private:
1283 QgsMapCanvas *mCanvas;
1284 double mLockedScale;
1285 };
1286
1288 QgsMapSettings mSettings;
1289
1291 QgsMapCanvasMap *mMap = nullptr;
1292
1293 QgsScreenHelper *mScreenHelper = nullptr;
1294
1299 QgsTemporalController *mController = nullptr;
1300
1302 bool mFrozen = false;
1303
1305 bool mRefreshScheduled = false;
1306
1308 bool mRefreshAfterJob = false;
1309
1311 bool mRenderFlag = true;
1312
1314 QPointer< QgsMapLayer > mCurrentLayer;
1315
1317 QGraphicsScene *mScene = nullptr;
1318
1320 QgsMapTool *mMapTool = nullptr;
1321
1323 QgsMapTool *mLastNonZoomMapTool = nullptr;
1324
1326 QgsProject *mProject = nullptr;
1327
1329 QList <QgsRectangle> mLastExtent;
1330 int mLastExtentIndex = -1;
1331
1333 double mWheelZoomFactor = 2.0;
1334
1336 QTimer mMapUpdateTimer;
1337
1339 QgsMapRendererQImageJob *mJob = nullptr;
1340
1342 bool mJobCanceled = false;
1343
1345 std::unique_ptr< QgsLabelingResults > mLabelingResults;
1346
1348 bool mLabelingResultsOutdated = false;
1349
1354 std::unique_ptr< QgsRenderedItemResults > mRenderedItemResults;
1355
1360 std::unique_ptr< QgsRenderedItemResults > mPreviousRenderedItemResults;
1361
1367 bool mRenderedItemResultsOutdated = false;
1368
1370 bool mUseParallelRendering = false;
1371
1373 bool mDrawRenderingStats = false;
1374
1376 QgsMapRendererCache *mCache = nullptr;
1377
1378 QTimer *mResizeTimer = nullptr;
1379 QTimer *mRefreshTimer = nullptr;
1380
1381 QgsPreviewEffect *mPreviewEffect = nullptr;
1382
1383 QgsRectangle imageRect( const QImage &img, const QgsMapSettings &mapSettings );
1384
1385 QgsSnappingUtils *mSnappingUtils = nullptr;
1386
1387 QList< QgsMapRendererQImageJob * > mPreviewJobs;
1388
1390 bool mScaleLocked = false;
1391
1392 QgsExpressionContextScope mExpressionContextScope;
1393
1395 QRect mZoomRect;
1396
1398 bool mZoomDragging = false;
1399
1401 std::unique_ptr< QgsRubberBand > mZoomRubberBand;
1402
1403 QCursor mZoomCursor;
1404
1405 QTimer mAutoRefreshTimer;
1406
1407 QTimer mPreviewTimer;
1408 QMetaObject::Connection mPreviewTimerConnection;
1409
1410 QString mTheme;
1411
1412 QgsPointXY mCursorPoint;
1413
1414 bool mAnnotationsVisible = true;
1415
1416 bool mUsePreviewJobs = false;
1417
1418 QHash< QString, int > mLastLayerRenderTime;
1419
1420 QVector<QPointer<QgsCustomDropHandler >> mDropHandlers;
1421
1422 QgsDistanceArea mDa;
1423 QList<double> mZoomResolutions;
1424
1425 QList< QgsMapCanvasInteractionBlocker * > mInteractionBlockers;
1426
1427 int mBlockItemPositionUpdates = 0;
1428
1429 std::unique_ptr< QgsTemporaryCursorOverride > mTemporaryCursorOverride;
1430
1438 QMap <QString, QDateTime> mRendererErrors;
1439
1444 QgsPointXY cursorPoint() const;
1445
1450 void updateMapSize();
1451
1457 void beginZoomRect( QPoint pos );
1458
1464 void endZoomRect( QPoint pos );
1465
1467 void stopZoomRect();
1468
1470 void startPan();
1471
1473 void stopPan();
1474
1483 bool boundingBoxOfFeatureIds( const QgsFeatureIds &ids, QgsVectorLayer *layer, QgsRectangle &bbox, QString &errorMsg ) const;
1484
1491 QgsRectangle optimalExtentForPointLayer( QgsVectorLayer *layer, const QgsPointXY &center, int scaleFactor = 5 );
1492
1493 void setLayersPrivate( const QList<QgsMapLayer *> &layers );
1494
1495 void startPreviewJobs();
1496 void stopPreviewJobs();
1497 void schedulePreviewJob( int number );
1498
1502 bool panOperationInProgress();
1503
1504 int nextZoomLevel( const QList<double> &resolutions, bool zoomIn = true ) const;
1505
1510 void clearTemporalCache();
1511
1515 void clearElevationCache();
1516
1517 void showContextMenu( QgsMapMouseEvent *event );
1518
1523 void notifyRendererErrors( const QgsMapRendererJob::Errors &errors );
1524
1525 friend class TestQgsMapCanvas;
1526
1527}; // class QgsMapCanvas
1528
1529// clazy:excludeall=qstring-allocations
1530
1531#endif
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition: qgis.h:115
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:90
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.
void selectionChanged(QgsMapLayer *layer)
Emitted when selection in any layer gets changed.
void extentsChanged()
Emitted when the extents of the map change.
void xyCoordinates(const QgsPointXY &p)
Emits current mouse position.
QgsExpressionContextScope & expressionContextScope()
Returns a reference to the expression context scope for the map canvas.
Definition: qgsmapcanvas.h:728
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:966
QString theme() const
Returns the map's theme shown in the canvas, if set.
Definition: qgsmapcanvas.h:572
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.
const QList< double > & zoomResolutions() const
Definition: qgsmapcanvas.h:983
void rotationChanged(double)
Emitted when the rotation of the map changes.
bool scaleLocked() const
Returns whether the scale is locked, so zooming can be performed using magnication.
Definition: qgsmapcanvas.h:618
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.
const QgsExpressionContextScope & expressionContextScope() const
Returns a const reference to the expression context scope for the map canvas.
Definition: qgsmapcanvas.h:737
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:519
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.
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:718
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.
QList< QgsMapRendererJob::Error > Errors
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:104
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
A utility class for dynamic handling of changes to screen properties.
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_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:186
#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_THROW(name,...)
Definition: qgis_sip.h:198
#define SIP_END
Definition: qgis_sip.h:203
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeatureid.h:37
const QgsCoordinateReferenceSystem & crs