QGIS API Documentation 3.43.0-Master (32433f7016e)
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
608 void setTheme( const QString &theme );
609
614 QString theme() const { return mTheme; }
615
617 const QgsMapToPixel *getCoordinateTransform();
618
620 bool isDrawing();
621
623 QgsMapLayer *currentLayer();
624
626 void setWheelFactor( double factor );
627
635 void zoomScale( double scale, bool ignoreScaleLock = false );
636
644 void zoomByFactor( double scaleFactor, const QgsPointXY *center = nullptr, bool ignoreScaleLock = false );
645
647 void zoomWithCenter( int x, int y, bool zoomIn );
648
653 void zoomToFeatureExtent( QgsRectangle &rect );
654
659 bool scaleLocked() const { return mScaleLocked; }
660
662 void enableAntiAliasing( bool flag );
663
665 bool antiAliasingEnabled() const;
666
668 void enableMapTileRendering( bool flag );
669
670 // following 2 methods should be moved elsewhere or changed to private
671 // currently used by pan map tool
673 void panActionEnd( QPoint releasePoint );
674
675#ifndef SIP_RUN
676
682 void panActionStart( QPoint releasePoint );
683#endif
684
686 void panAction( QMouseEvent *event );
687
689 QPoint mouseLastXY();
690
696 void setPreviewModeEnabled( bool previewEnabled );
697
704 bool previewModeEnabled() const;
705
714 void setPreviewMode( QgsPreviewEffect::PreviewMode mode );
715
723 QgsPreviewEffect::PreviewMode previewMode() const;
724
732 QgsSnappingUtils *snappingUtils() const;
733
741 void setSnappingUtils( QgsSnappingUtils *utils );
742
752 void setExpressionContextScope( const QgsExpressionContextScope &scope ) { mExpressionContextScope = scope; }
753
761 QgsExpressionContextScope &expressionContextScope() { return mExpressionContextScope; }
762
770 {
771 return mExpressionContextScope;
772 }
773
780 QgsExpressionContextScope *defaultExpressionContextScope() const SIP_FACTORY;
781
782 QgsExpressionContext createExpressionContext() const override;
783
788 void setSegmentationTolerance( double tolerance );
789
794 void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type );
795
799 QList<QgsMapCanvasAnnotationItem *> annotationItems() const;
800
805 bool annotationsVisible() const { return mAnnotationsVisible; }
806
811 void setAnnotationsVisible( bool visible );
812
816 void setLabelingEngineSettings( const QgsLabelingEngineSettings &settings );
817
821 const QgsLabelingEngineSettings &labelingEngineSettings() const;
822
830 bool previewJobsEnabled() const;
831
839 void setPreviewJobsEnabled( bool enabled );
840
846 void setCustomDropHandlers( const QVector<QPointer<QgsCustomDropHandler>> &handlers ) SIP_SKIP;
847
858 void setTemporalRange( const QgsDateTimeRange &range );
859
866 const QgsDateTimeRange &temporalRange() const;
867
879 void installInteractionBlocker( QgsMapCanvasInteractionBlocker *blocker );
880
888 void removeInteractionBlocker( QgsMapCanvasInteractionBlocker *blocker );
889
895 bool allowInteraction( QgsMapCanvasInteractionBlocker::Interaction interaction ) const;
896
904 void setMapController( QgsAbstract2DMapController *controller SIP_TRANSFER );
905
906 public slots:
907
909 void refresh();
910
919 void refreshAllLayers();
920
929 void redrawAllLayers();
930
932 void selectionChangedSlot();
933
935 void saveAsImage( const QString &fileName, QPixmap *QPixmap = nullptr, const QString & = "PNG" );
936
938 void layerStateChange();
939
949 void setRenderFlag( bool flag );
950
954 void stopRendering();
955
957 void readProject( const QDomDocument & );
958
960 void writeProject( QDomDocument & );
961
969 void setMagnificationFactor( double factor, const QgsPointXY *center = nullptr );
970
975 void setScaleLocked( bool isLocked );
976
978 void zoomIn();
979
981 void zoomOut();
982
987 void zoomToSelected( QgsMapLayer *layer = nullptr );
988
994 void zoomToSelected( const QList<QgsMapLayer *> &layers );
995
1001 void setZoomResolutions( const QList<double> &resolutions ) { mZoomResolutions = resolutions; }
1002
1006 double zoomInFactor() const;
1007
1011 double zoomOutFactor() const;
1012
1019 const QList<double> &zoomResolutions() const { return mZoomResolutions; }
1020
1029 QgsDoubleRange zRange() const;
1030
1039 void setZRange( const QgsDoubleRange &range );
1040
1041 private slots:
1043 void mapToolDestroyed();
1044
1046 void rendererJobFinished();
1047
1049 void previewJobFinished();
1050
1051 void mapUpdateTimeout();
1052
1053 void refreshMap();
1054
1055 void mapThemeChanged( const QString &theme );
1057 void mapThemeRenamed( const QString &theme, const QString &newTheme );
1058
1059 void updateDevicePixelFromScreen();
1060
1061 void onElevationShadingRendererChanged();
1062
1063 signals:
1064
1069 void xyCoordinates( const QgsPointXY &p );
1070
1072 void scaleChanged( double scale );
1073
1080 void scaleLockChanged( bool locked );
1081
1082
1085
1089 void rotationChanged( double rotation );
1090
1094 void magnificationChanged( double magnification );
1095
1100
1101 // TODO: deprecate when decorations are reimplemented as map canvas items
1102
1113 void renderComplete( QPainter *painter );
1114
1115 // ### QGIS 3: renamte to mapRefreshFinished()
1118
1119 // ### QGIS 3: rename to mapRefreshStarted()
1122
1128
1131
1133 void keyPressed( QKeyEvent *e );
1134
1136 void keyReleased( QKeyEvent *e );
1137
1141 void mapToolSet( QgsMapTool *newTool, QgsMapTool *oldTool );
1142
1149
1151 void zoomLastStatusChanged( bool available );
1152
1154 void zoomNextStatusChanged( bool available );
1155
1160
1165
1170
1175
1180 void themeChanged( const QString &theme );
1181
1183 void messageEmitted( const QString &title, const QString &message, Qgis::MessageLevel level = Qgis::MessageLevel::Info );
1184
1192 void renderErrorOccurred( const QString &error, QgsMapLayer *layer );
1193
1204 void panDistanceBearingChanged( double distance, Qgis::DistanceUnit unit, double bearing );
1205
1210 void tapAndHoldGestureOccurred( const QgsPointXY &mapPoint, QTapAndHoldGesture *gesture );
1211
1218
1228
1235 void contextMenuAboutToShow( QMenu *menu, QgsMapMouseEvent *event );
1236
1237 protected:
1238 bool event( QEvent *e ) override;
1239 void keyPressEvent( QKeyEvent *e ) override;
1240 void keyReleaseEvent( QKeyEvent *e ) override;
1241 void mouseDoubleClickEvent( QMouseEvent *e ) override;
1242 void mouseMoveEvent( QMouseEvent *e ) override;
1243 void mousePressEvent( QMouseEvent *e ) override;
1244 void mouseReleaseEvent( QMouseEvent *e ) override;
1245 void wheelEvent( QWheelEvent *e ) override;
1246 void resizeEvent( QResizeEvent *e ) override;
1247 void paintEvent( QPaintEvent *e ) override;
1248 void dragEnterEvent( QDragEnterEvent *e ) override;
1249 bool viewportEvent( QEvent *event ) override;
1250
1252 void moveCanvasContents( bool reset = false );
1253
1254 void dropEvent( QDropEvent *event ) override;
1255
1256 void showEvent( QShowEvent *event ) override;
1257
1263 void emitExtentsChanged();
1264
1266 class CanvasProperties;
1267
1269 std::unique_ptr<CanvasProperties> mCanvasProperties;
1270
1271#if 0
1272
1277 void connectNotify( const char *signal ) override;
1278#endif
1279
1280 protected slots:
1282 void updateCanvasItemPositions();
1283
1284 private slots:
1285
1286 void layerRepaintRequested( bool deferred );
1287
1288 void autoRefreshTriggered();
1289
1290 void updateAutoRefreshTimer();
1291
1292 void projectThemesChanged();
1293
1294 void startPreviewJob( int number );
1295
1296 void temporalControllerModeChanged();
1297
1298 private:
1299 // Restore scale RAII
1300 class ScaleRestorer
1301 {
1302 public:
1303 ScaleRestorer( QgsMapCanvas *canvas )
1304 : mCanvas( canvas )
1305 {
1306 mLockedScale = mCanvas->mapSettings().scale();
1307 };
1308
1309 ~ScaleRestorer()
1310 {
1311 QgsRectangle newExtent = mCanvas->mapSettings().extent();
1312 newExtent.scale( mLockedScale / mCanvas->mapSettings().scale() );
1313 mCanvas->mSettings.setExtent( newExtent );
1314 };
1315
1316 private:
1317 QgsMapCanvas *mCanvas;
1318 double mLockedScale;
1319 };
1320
1321 enum class CacheInvalidationType
1322 {
1323 Temporal = 1 << 0,
1324 Elevation = 1 << 1,
1325 };
1326
1327 QgsOverlayWidgetLayout *mLayout = nullptr;
1328
1329 Qgis::MapCanvasFlags mFlags;
1330
1332 QgsMapSettings mSettings;
1333
1335 QgsMapCanvasMap *mMap = nullptr;
1336
1337 QgsScreenHelper *mScreenHelper = nullptr;
1338
1343 QgsTemporalController *mController = nullptr;
1344
1346 bool mFrozen = false;
1347
1349 bool mRefreshScheduled = false;
1350
1352 bool mRefreshAfterJob = false;
1353
1355 bool mRenderFlag = true;
1356
1357 QFlags<CacheInvalidationType> mCacheInvalidations;
1358
1360 QPointer<QgsMapLayer> mCurrentLayer;
1361
1363 QGraphicsScene *mScene = nullptr;
1364
1366 QgsMapTool *mMapTool = nullptr;
1367
1369 QgsProject *mProject = nullptr;
1370
1372 QList<QgsRectangle> mLastExtent;
1373 int mLastExtentIndex = -1;
1374
1376 double mWheelZoomFactor = 2.0;
1377
1379 QTimer mMapUpdateTimer;
1380
1382 QgsMapRendererQImageJob *mJob = nullptr;
1383
1385 bool mJobCanceled = false;
1386
1388 std::unique_ptr<QgsLabelingResults> mLabelingResults;
1389
1391 bool mLabelingResultsOutdated = false;
1392
1397 std::unique_ptr<QgsRenderedItemResults> mRenderedItemResults;
1398
1403 std::unique_ptr<QgsRenderedItemResults> mPreviousRenderedItemResults;
1404
1410 bool mRenderedItemResultsOutdated = false;
1411
1413 bool mUseParallelRendering = false;
1414
1416 bool mDrawRenderingStats = false;
1417
1419 QgsMapRendererCache *mCache = nullptr;
1420
1421 QTimer *mResizeTimer = nullptr;
1422 QTimer *mRefreshTimer = nullptr;
1423
1424 QgsPreviewEffect *mPreviewEffect = nullptr;
1425
1426 QgsRectangle imageRect( const QImage &img, const QgsMapSettings &mapSettings );
1427
1428 QgsSnappingUtils *mSnappingUtils = nullptr;
1429
1430 QList<QgsMapRendererQImageJob *> mPreviewJobs;
1431
1433 bool mScaleLocked = false;
1434
1435 QgsExpressionContextScope mExpressionContextScope;
1436
1438 QRect mZoomRect;
1439
1441 bool mZoomDragging = false;
1442
1444 std::unique_ptr<QgsRubberBand> mZoomRubberBand;
1445
1446 QCursor mZoomCursor;
1447
1448 QTimer mAutoRefreshTimer;
1449
1450 QTimer mPreviewTimer;
1451 QMetaObject::Connection mPreviewTimerConnection;
1452
1453 QString mTheme;
1454
1455 QgsPointXY mCursorPoint;
1456
1457 bool mAnnotationsVisible = true;
1458
1459 bool mUsePreviewJobs = false;
1460
1461 QHash<QString, int> mLastLayerRenderTime;
1462
1463 QVector<QPointer<QgsCustomDropHandler>> mDropHandlers;
1464
1465 QgsDistanceArea mDa;
1466 QList<double> mZoomResolutions;
1467
1468 QList<QgsMapCanvasInteractionBlocker *> mInteractionBlockers;
1469
1470 int mBlockItemPositionUpdates = 0;
1471 int mBlockExtentChangedSignal = 0;
1472 int mBlockScaleChangedSignal = 0;
1473
1474 std::unique_ptr<QgsTemporaryCursorOverride> mTemporaryCursorOverride;
1475
1483 QMap<QString, QDateTime> mRendererErrors;
1484
1485
1486 QPointer<QgsAbstract2DMapController> mMapController;
1487
1492 QgsPointXY cursorPoint() const;
1493
1497 void updateMapSize();
1498
1503 void beginZoomRect( QPoint pos );
1504
1509 void endZoomRect( QPoint pos );
1510
1512 void stopZoomRect();
1513
1515 void startPan();
1516
1518 void stopPan();
1519
1528 bool boundingBoxOfFeatureIds( const QgsFeatureIds &ids, QgsVectorLayer *layer, QgsRectangle &bbox, QString &errorMsg ) const;
1529
1536 QgsRectangle optimalExtentForPointLayer( QgsVectorLayer *layer, const QgsPointXY &center, int scaleFactor = 5 );
1537
1538 void setLayersPrivate( const QList<QgsMapLayer *> &layers );
1539
1540 void startPreviewJobs();
1541 void stopPreviewJobs();
1542 void schedulePreviewJob( int number );
1543
1547 bool panOperationInProgress();
1548
1549 int nextZoomLevel( const QList<double> &resolutions, bool zoomIn = true ) const;
1550
1555 void clearTemporalCache();
1556
1560 void clearElevationCache();
1561
1562 void showContextMenu( QgsMapMouseEvent *event );
1563
1568 void notifyRendererErrors( const QgsMapRendererJob::Errors &errors );
1569
1570 friend class TestQgsMapCanvas;
1571
1572}; // class QgsMapCanvas
1573
1574// clazy:excludeall=qstring-allocations
1575
1576#endif
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:54
DistanceUnit
Units of distance.
Definition qgis.h:4843
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