QGIS API Documentation 3.43.0-Master (ac9f54ad1f7)
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;
77
79class QgsScreenHelper;
80
82
83class QMenu;
85
86
92class GUI_EXPORT QgsMapCanvas : public QGraphicsView, public QgsExpressionContextGenerator
93{
94#ifdef SIP_RUN
96 if ( qobject_cast<QgsMapCanvas *>( sipCpp ) != nullptr )
97 sipType = sipType_QgsMapCanvas;
98 else
99 sipType = nullptr;
100 SIP_END
101#endif
102
103 Q_OBJECT
104 Q_PROPERTY( QString theme READ theme WRITE setTheme NOTIFY themeChanged )
105 Q_PROPERTY( bool previewJobsEnabled READ previewJobsEnabled WRITE setPreviewJobsEnabled )
106
107 public:
109 QgsMapCanvas( QWidget *parent SIP_TRANSFERTHIS = nullptr );
110
111 ~QgsMapCanvas() override;
112
123 void addOverlayWidget( QWidget *widget SIP_TRANSFER, Qt::Edge edge );
124
128 double magnificationFactor() const;
129
140 void setLayers( const QList<QgsMapLayer *> &layers );
141
148 void setFlags( Qgis::MapCanvasFlags flags );
149
156 Qgis::MapCanvasFlags flags() const;
157
158 void setCurrentLayer( QgsMapLayer *layer );
159
163 const QgsMapSettings &mapSettings() const SIP_KEEPREFERENCE;
164
171 QgsMapSettings &mapSettings() SIP_SKIP;
172
179 void setTemporalController( QgsTemporalController *controller );
180
187 const QgsTemporalController *temporalController() const;
188
192 void setDestinationCrs( const QgsCoordinateReferenceSystem &crs );
193
197 void setMapSettingsFlags( Qgis::MapSettingsFlags flags );
198
206 const QgsLabelingResults *labelingResults( bool allowOutdatedResults = true ) const;
207
217 const QgsRenderedItemResults *renderedItemResults( bool allowOutdatedResults = true ) const;
218
226 void setCachingEnabled( bool enabled );
227
235 bool isCachingEnabled() const;
236
240 void clearCache();
241
250 QgsMapRendererCache *cache();
251
256 void cancelJobs() SIP_SKIP;
257
266 void waitWhileRendering();
267
271 void setParallelRenderingEnabled( bool enabled );
272
276 bool isParallelRenderingEnabled() const;
277
281 void setMapUpdateInterval( int timeMilliseconds );
282
286 int mapUpdateInterval() const;
287
292 double scale() const;
293
295 double mapUnitsPerPixel() const;
296
298 QgsRectangle extent() const;
299
308 QgsRectangle fullExtent() const;
309
319 QgsRectangle projectExtent() const;
320
332 void setExtent( const QgsRectangle &r, bool magnified = false );
333
342 bool setReferencedExtent( const QgsReferencedRectangle &extent ) SIP_THROW( QgsCsException );
343
347 double rotation() const;
348
352 void setRotation( double degrees );
353
357 void setCenter( const QgsPointXY &center );
358
362 QgsPointXY center() const;
363
369 void zoomToFullExtent();
370
379 void zoomToProjectExtent();
380
382 void zoomToPreviousExtent();
383
385 void zoomToNextExtent();
386
388 void clearExtentHistory();
389
390
396 void zoomToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids );
397
404 void panToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids, bool alwaysRecenter = true );
405
407 void panToSelected( QgsMapLayer *layer = nullptr );
408
414 void panToSelected( const QList<QgsMapLayer *> &layers );
415
427 void flashFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids, const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ), int flashes = 3, int duration = 500 );
428
440 void flashGeometries( const QList<QgsGeometry> &geometries, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem(), const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ), int flashes = 3, int duration = 500 );
441
443 void setMapTool( QgsMapTool *mapTool, bool clean = false );
444
452 void unsetMapTool( QgsMapTool *mapTool );
453
455 QgsMapTool *mapTool() const;
456
462 void setProject( QgsProject *project );
463
470 QgsProject *project();
471
473 void setCanvasColor( const QColor &_newVal );
475 QColor canvasColor() const;
476
480 void setSelectionColor( const QColor &color );
481
485 QColor selectionColor() const;
486
488 void updateScale();
489
491 QgsMapLayer *layer( int index );
492
503 QgsMapLayer *layer( const QString &id );
504
508 int layerCount() const;
509
518 QList<QgsMapLayer *> layers( bool expandGroupLayers = false ) const;
519
520#ifndef SIP_RUN
527 template<typename T>
528 QVector<T> layers() const { return mapSettings().layers<T>(); }
529#endif
530
542 void freeze( bool frozen = true );
543
553 bool isFrozen() const;
554
565 bool renderFlag() const { return mRenderFlag; }
566
571 Qgis::DistanceUnit mapUnits() const;
572
577 QMap<QString, QString> layerStyleOverrides() const;
578
589 void setLayerStyleOverrides( const QMap<QString, QString> &overrides );
590
611 void setTheme( const QString &theme );
612
617 QString theme() const { return mTheme; }
618
620 const QgsMapToPixel *getCoordinateTransform();
621
623 bool isDrawing();
624
626 QgsMapLayer *currentLayer();
627
629 void setWheelFactor( double factor );
630
638 void zoomScale( double scale, bool ignoreScaleLock = false );
639
647 void zoomByFactor( double scaleFactor, const QgsPointXY *center = nullptr, bool ignoreScaleLock = false );
648
650 void zoomWithCenter( int x, int y, bool zoomIn );
651
656 void zoomToFeatureExtent( QgsRectangle &rect );
657
662 bool scaleLocked() const { return mScaleLocked; }
663
665 void enableAntiAliasing( bool flag );
666
668 bool antiAliasingEnabled() const;
669
671 void enableMapTileRendering( bool flag );
672
673 // following 2 methods should be moved elsewhere or changed to private
674 // currently used by pan map tool
676 void panActionEnd( QPoint releasePoint );
677
678#ifndef SIP_RUN
679
685 void panActionStart( QPoint releasePoint );
686#endif
687
689 void panAction( QMouseEvent *event );
690
692 QPoint mouseLastXY();
693
699 void setPreviewModeEnabled( bool previewEnabled );
700
707 bool previewModeEnabled() const;
708
717 void setPreviewMode( QgsPreviewEffect::PreviewMode mode );
718
726 QgsPreviewEffect::PreviewMode previewMode() const;
727
735 QgsSnappingUtils *snappingUtils() const;
736
744 void setSnappingUtils( QgsSnappingUtils *utils );
745
755 void setExpressionContextScope( const QgsExpressionContextScope &scope ) { mExpressionContextScope = scope; }
756
764 QgsExpressionContextScope &expressionContextScope() { return mExpressionContextScope; }
765
773 {
774 return mExpressionContextScope;
775 }
776
783 QgsExpressionContextScope *defaultExpressionContextScope() const SIP_FACTORY;
784
785 QgsExpressionContext createExpressionContext() const override;
786
791 void setSegmentationTolerance( double tolerance );
792
797 void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type );
798
802 QList<QgsMapCanvasAnnotationItem *> annotationItems() const;
803
808 bool annotationsVisible() const { return mAnnotationsVisible; }
809
814 void setAnnotationsVisible( bool visible );
815
819 void setLabelingEngineSettings( const QgsLabelingEngineSettings &settings );
820
824 const QgsLabelingEngineSettings &labelingEngineSettings() const;
825
833 bool previewJobsEnabled() const;
834
842 void setPreviewJobsEnabled( bool enabled );
843
849 void setCustomDropHandlers( const QVector<QPointer<QgsCustomDropHandler>> &handlers ) SIP_SKIP;
850
861 void setTemporalRange( const QgsDateTimeRange &range );
862
869 const QgsDateTimeRange &temporalRange() const;
870
882 void installInteractionBlocker( QgsMapCanvasInteractionBlocker *blocker );
883
891 void removeInteractionBlocker( QgsMapCanvasInteractionBlocker *blocker );
892
898 bool allowInteraction( QgsMapCanvasInteractionBlocker::Interaction interaction ) const;
899
907 void setMapController( QgsAbstract2DMapController *controller SIP_TRANSFER );
908
909 public slots:
910
912 void refresh();
913
922 void refreshAllLayers();
923
932 void redrawAllLayers();
933
935 void selectionChangedSlot();
936
938 void saveAsImage( const QString &fileName, QPixmap *QPixmap = nullptr, const QString & = "PNG" );
939
941 void layerStateChange();
942
952 void setRenderFlag( bool flag );
953
957 void stopRendering();
958
960 void readProject( const QDomDocument & );
961
963 void writeProject( QDomDocument & );
964
972 void setMagnificationFactor( double factor, const QgsPointXY *center = nullptr );
973
978 void setScaleLocked( bool isLocked );
979
981 void zoomIn();
982
984 void zoomOut();
985
990 void zoomToSelected( QgsMapLayer *layer = nullptr );
991
997 void zoomToSelected( const QList<QgsMapLayer *> &layers );
998
1004 void setZoomResolutions( const QList<double> &resolutions ) { mZoomResolutions = resolutions; }
1005
1009 double zoomInFactor() const;
1010
1014 double zoomOutFactor() const;
1015
1022 const QList<double> &zoomResolutions() const { return mZoomResolutions; }
1023
1032 QgsDoubleRange zRange() const;
1033
1042 void setZRange( const QgsDoubleRange &range );
1043
1044 private slots:
1046 void mapToolDestroyed();
1047
1049 void rendererJobFinished();
1050
1052 void previewJobFinished();
1053
1054 void mapUpdateTimeout();
1055
1056 void refreshMap();
1057
1058 void mapThemeChanged( const QString &theme );
1060 void mapThemeRenamed( const QString &theme, const QString &newTheme );
1061
1062 void updateDevicePixelFromScreen();
1063
1064 void onElevationShadingRendererChanged();
1065
1066 signals:
1067
1072 void xyCoordinates( const QgsPointXY &p );
1073
1075 void scaleChanged( double scale );
1076
1083 void scaleLockChanged( bool locked );
1084
1085
1088
1092 void rotationChanged( double rotation );
1093
1097 void magnificationChanged( double magnification );
1098
1103
1104 // TODO: deprecate when decorations are reimplemented as map canvas items
1105
1116 void renderComplete( QPainter *painter );
1117
1118 // ### QGIS 3: renamte to mapRefreshFinished()
1121
1122 // ### QGIS 3: rename to mapRefreshStarted()
1125
1131
1134
1136 void keyPressed( QKeyEvent *e );
1137
1139 void keyReleased( QKeyEvent *e );
1140
1144 void mapToolSet( QgsMapTool *newTool, QgsMapTool *oldTool );
1145
1152
1154 void zoomLastStatusChanged( bool available );
1155
1157 void zoomNextStatusChanged( bool available );
1158
1163
1168
1173
1178
1183 void themeChanged( const QString &theme );
1184
1186 void messageEmitted( const QString &title, const QString &message, Qgis::MessageLevel level = Qgis::MessageLevel::Info );
1187
1195 void renderErrorOccurred( const QString &error, QgsMapLayer *layer );
1196
1207 void panDistanceBearingChanged( double distance, Qgis::DistanceUnit unit, double bearing );
1208
1213 void tapAndHoldGestureOccurred( const QgsPointXY &mapPoint, QTapAndHoldGesture *gesture );
1214
1221
1231
1238 void contextMenuAboutToShow( QMenu *menu, QgsMapMouseEvent *event );
1239
1240 protected:
1241 bool event( QEvent *e ) override;
1242 void keyPressEvent( QKeyEvent *e ) override;
1243 void keyReleaseEvent( QKeyEvent *e ) override;
1244 void mouseDoubleClickEvent( QMouseEvent *e ) override;
1245 void mouseMoveEvent( QMouseEvent *e ) override;
1246 void mousePressEvent( QMouseEvent *e ) override;
1247 void mouseReleaseEvent( QMouseEvent *e ) override;
1248 void wheelEvent( QWheelEvent *e ) override;
1249 void resizeEvent( QResizeEvent *e ) override;
1250 void paintEvent( QPaintEvent *e ) override;
1251 void dragEnterEvent( QDragEnterEvent *e ) override;
1252 bool viewportEvent( QEvent *event ) override;
1253
1255 void moveCanvasContents( bool reset = false );
1256
1257 void dropEvent( QDropEvent *event ) override;
1258
1259 void showEvent( QShowEvent *event ) override;
1260
1266 void emitExtentsChanged();
1267
1269 class CanvasProperties;
1270
1272 std::unique_ptr<CanvasProperties> mCanvasProperties;
1273
1274#if 0
1275
1280 void connectNotify( const char *signal ) override;
1281#endif
1282
1283 protected slots:
1285 void updateCanvasItemPositions();
1286
1287 private slots:
1288
1289 void layerRepaintRequested( bool deferred );
1290
1291 void autoRefreshTriggered();
1292
1293 void updateAutoRefreshTimer();
1294
1295 void projectThemesChanged();
1296
1297 void startPreviewJob( int number );
1298
1299 void temporalControllerModeChanged();
1300
1301 private:
1302 // Restore scale RAII
1303 class ScaleRestorer
1304 {
1305 public:
1306 ScaleRestorer( QgsMapCanvas *canvas )
1307 : mCanvas( canvas )
1308 {
1309 mLockedScale = mCanvas->mapSettings().scale();
1310 };
1311
1312 ~ScaleRestorer()
1313 {
1314 QgsRectangle newExtent = mCanvas->mapSettings().extent();
1315 newExtent.scale( mLockedScale / mCanvas->mapSettings().scale() );
1316 mCanvas->mSettings.setExtent( newExtent );
1317 };
1318
1319 private:
1320 QgsMapCanvas *mCanvas;
1321 double mLockedScale;
1322 };
1323
1324 enum class CacheInvalidationType
1325 {
1326 Temporal = 1 << 0,
1327 Elevation = 1 << 1,
1328 };
1329
1330 QgsOverlayWidgetLayout *mLayout = nullptr;
1331
1332 Qgis::MapCanvasFlags mFlags;
1333
1335 QgsMapSettings mSettings;
1336
1338 QgsMapCanvasMap *mMap = nullptr;
1339
1340 QgsScreenHelper *mScreenHelper = nullptr;
1341
1346 QgsTemporalController *mController = nullptr;
1347
1349 bool mFrozen = false;
1350
1352 bool mRefreshScheduled = false;
1353
1355 bool mRefreshAfterJob = false;
1356
1358 bool mRenderFlag = true;
1359
1360 QFlags<CacheInvalidationType> mCacheInvalidations;
1361
1363 QPointer<QgsMapLayer> mCurrentLayer;
1364
1366 QGraphicsScene *mScene = nullptr;
1367
1369 QgsMapTool *mMapTool = nullptr;
1370
1372 QgsProject *mProject = nullptr;
1373
1375 QList<QgsRectangle> mLastExtent;
1376 int mLastExtentIndex = -1;
1377
1379 double mWheelZoomFactor = 2.0;
1380
1382 QTimer mMapUpdateTimer;
1383
1385 QgsMapRendererQImageJob *mJob = nullptr;
1386
1388 bool mJobCanceled = false;
1389
1391 std::unique_ptr<QgsLabelingResults> mLabelingResults;
1392
1394 bool mLabelingResultsOutdated = false;
1395
1400 std::unique_ptr<QgsRenderedItemResults> mRenderedItemResults;
1401
1406 std::unique_ptr<QgsRenderedItemResults> mPreviousRenderedItemResults;
1407
1413 bool mRenderedItemResultsOutdated = false;
1414
1416 bool mUseParallelRendering = false;
1417
1419 bool mDrawRenderingStats = false;
1420
1422 QgsMapRendererCache *mCache = nullptr;
1423
1424 QTimer *mResizeTimer = nullptr;
1425 QTimer *mRefreshTimer = nullptr;
1426
1427 QgsPreviewEffect *mPreviewEffect = nullptr;
1428
1429 QgsRectangle imageRect( const QImage &img, const QgsMapSettings &mapSettings );
1430
1431 QgsSnappingUtils *mSnappingUtils = nullptr;
1432
1433 QList<QgsMapRendererQImageJob *> mPreviewJobs;
1434
1436 bool mScaleLocked = false;
1437
1438 QgsExpressionContextScope mExpressionContextScope;
1439
1441 QRect mZoomRect;
1442
1444 bool mZoomDragging = false;
1445
1447 std::unique_ptr<QgsRubberBand> mZoomRubberBand;
1448
1449 QCursor mZoomCursor;
1450
1451 QTimer mAutoRefreshTimer;
1452
1453 QTimer mPreviewTimer;
1454 QMetaObject::Connection mPreviewTimerConnection;
1455
1456 QString mTheme;
1457
1458 QgsPointXY mCursorPoint;
1459
1460 bool mAnnotationsVisible = true;
1461
1462 bool mUsePreviewJobs = false;
1463
1464 QHash<QString, int> mLastLayerRenderTime;
1465
1466 QVector<QPointer<QgsCustomDropHandler>> mDropHandlers;
1467
1468 QgsDistanceArea mDa;
1469 QList<double> mZoomResolutions;
1470
1471 QList<QgsMapCanvasInteractionBlocker *> mInteractionBlockers;
1472
1473 int mBlockItemPositionUpdates = 0;
1474 int mBlockExtentChangedSignal = 0;
1475 int mBlockScaleChangedSignal = 0;
1476
1477 std::unique_ptr<QgsTemporaryCursorOverride> mTemporaryCursorOverride;
1478
1486 QMap<QString, QDateTime> mRendererErrors;
1487
1488
1489 QPointer<QgsAbstract2DMapController> mMapController;
1490
1495 QgsPointXY cursorPoint() const;
1496
1500 void updateMapSize();
1501
1506 void beginZoomRect( QPoint pos );
1507
1512 void endZoomRect( QPoint pos );
1513
1515 void stopZoomRect();
1516
1518 void startPan();
1519
1521 void stopPan();
1522
1531 bool boundingBoxOfFeatureIds( const QgsFeatureIds &ids, QgsVectorLayer *layer, QgsRectangle &bbox, QString &errorMsg ) const;
1532
1539 QgsRectangle optimalExtentForPointLayer( QgsVectorLayer *layer, const QgsPointXY &center, int scaleFactor = 5 );
1540
1541 void setLayersPrivate( const QList<QgsMapLayer *> &layers );
1542
1543 void startPreviewJobs();
1544 void stopPreviewJobs();
1545 void schedulePreviewJob( int number );
1546
1550 bool panOperationInProgress();
1551
1552 int nextZoomLevel( const QList<double> &resolutions, bool zoomIn = true ) const;
1553
1558 void clearTemporalCache();
1559
1563 void clearElevationCache();
1564
1565 void showContextMenu( QgsMapMouseEvent *event );
1566
1571 void notifyRendererErrors( const QgsMapRendererJob::Errors &errors );
1572
1573 friend class TestQgsMapCanvas;
1574
1575}; // class QgsMapCanvas
1576
1577// clazy:excludeall=qstring-allocations
1578
1579#endif
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:54
DistanceUnit
Units of distance.
Definition qgis.h:4859
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition qgis.h:154
@ Info
Information message.
Definition qgis.h:155
QFlags< MapCanvasFlag > MapCanvasFlags
Flags controlling behavior of map canvases.
Definition qgis.h:3336
Abstract base class for all 2D map controllers.
Abstract base class for all geometries.
Represents a coordinate reference system (CRS).
Custom exception class for Coordinate Reference System related exceptions.
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
QgsRange which stores a range of double values.
Definition qgsrange.h:233
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 geometry is the spatial representation of a feature.
Highlights features on the map.
Stores global configuration for labeling engine.
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.
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.
void setZoomResolutions(const QList< double > &resolutions)
Set a list of resolutions (map units per pixel) to which to "snap to" when zooming the map.
QString theme() const
Returns the map's theme shown in the canvas, if set.
QVector< T > layers() const
Returns a list of registered map layers with a specified layer type.
void tapAndHoldGestureOccurred(const QgsPointXY &mapPoint, QTapAndHoldGesture *gesture)
Emitted whenever a tap and hold gesture occurs at the specified map point.
const QList< double > & zoomResolutions() const
Returns the list of resolutions to which to "snap to" when zooming the map.
void panDistanceBearingChanged(double distance, Qgis::DistanceUnit unit, double bearing)
Emitted whenever the distance or bearing of an in-progress panning operation is changed.
bool scaleLocked() const
Returns whether the scale is locked, so zooming can be performed using magnication.
void zRangeChanged()
Emitted when the map canvas z (elevation) range changes.
void scaleChanged(double scale)
Emitted when the scale of the map changes.
void mapToolSet(QgsMapTool *newTool, QgsMapTool *oldTool)
Emit map tool changed with the old tool.
void canvasColorChanged()
Emitted when canvas background color changes.
void magnificationChanged(double magnification)
Emitted when the scale of the map 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.
void layerStyleOverridesChanged()
Emitted when the configuration of overridden layer styles changes.
void zoomNextStatusChanged(bool available)
Emitted when zoom next status changed.
void rotationChanged(double rotation)
Emitted when the rotation of the map changes.
void messageEmitted(const QString &title, const QString &message, Qgis::MessageLevel level=Qgis::MessageLevel::Info)
emit a message (usually to be displayed in a message bar)
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.
void temporalRangeChanged()
Emitted when the map canvas temporal range changes.
void zoomLastStatusChanged(bool available)
Emitted when zoom last status changed.
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 layersChanged()
Emitted when a new set of layers has been received.
void renderComplete(QPainter *painter)
Emitted when the canvas has rendered.
void setExpressionContextScope(const QgsExpressionContextScope &scope)
Sets an expression context scope for the map canvas.
Base class for all map layer types.
Definition qgsmaplayer.h:77
A mouse event which is the result of a user interaction with a QgsMapCanvas.
A widget that displays an overview map.
Responsible for keeping a cache of rendered images resulting from a map rendering job.
QList< QgsMapRendererJob::Error > Errors
Intermediate base class adding functionality that allows a client to query the rendered image.
Contains configuration for rendering maps.
Perform transforms between map coordinates and device coordinates.
Abstract base class for all map tools.
Definition qgsmaptool.h:72
A custom layout which can be used to overlay child widgets over a parent widget.
Represents a 2D point.
Definition qgspointxy.h:60
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:107
A rectangle specified with double values.
void scale(double scaleFactor, const QgsPointXY *c=nullptr)
Scale the rectangle around its center point.
A QgsRectangle with associated coordinate reference system.
Stores collated details of rendered items during a map rendering operation.
Responsible for drawing transient features (e.g.
A utility class for dynamic handling of changes to screen properties.
Contains 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.
Represents a vector layer which manages a vector based dataset.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition qgis_sip.h:191
#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_TRANSFER
Definition qgis_sip.h:36
#define SIP_FACTORY
Definition qgis_sip.h:76
#define SIP_THROW(name,...)
Definition qgis_sip.h:203
#define SIP_END
Definition qgis_sip.h:208
QSet< QgsFeatureId > QgsFeatureIds
const QgsCoordinateReferenceSystem & crs