QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
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
196 void setCachingEnabled( bool enabled );
197
206 bool isCachingEnabled() const;
207
212 void clearCache();
213
222 QgsMapRendererCache *cache();
223
228 void cancelJobs() SIP_SKIP;
229
239 void waitWhileRendering();
240
245 void setParallelRenderingEnabled( bool enabled );
246
251 bool isParallelRenderingEnabled() const;
252
257 void setMapUpdateInterval( int timeMilliseconds );
258
263 int mapUpdateInterval() const;
264
269 double scale() const;
270
272 double mapUnitsPerPixel() const;
273
275 QgsRectangle extent() const;
276
285 QgsRectangle fullExtent() const;
286
296 QgsRectangle projectExtent() const;
297
309 void setExtent( const QgsRectangle &r, bool magnified = false );
310
319 bool setReferencedExtent( const QgsReferencedRectangle &extent ) SIP_THROW( QgsCsException );
320
325 double rotation() const;
326
331 void setRotation( double degrees );
332
337 void setCenter( const QgsPointXY &center );
338
343 QgsPointXY center() const;
344
350 void zoomToFullExtent();
351
360 void zoomToProjectExtent();
361
363 void zoomToPreviousExtent();
364
366 void zoomToNextExtent();
367
369 void clearExtentHistory();
370
371
377 void zoomToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids );
378
385 void panToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids, bool alwaysRecenter = true );
386
388 void panToSelected( QgsMapLayer *layer = nullptr );
389
395 void panToSelected( const QList<QgsMapLayer *> &layers );
396
409 void flashFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids,
410 const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ),
411 int flashes = 3, int duration = 500 );
412
425 void flashGeometries( const QList< QgsGeometry > &geometries, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem(),
426 const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ),
427 int flashes = 3, int duration = 500 );
428
430 void setMapTool( QgsMapTool *mapTool, bool clean = false );
431
439 void unsetMapTool( QgsMapTool *mapTool );
440
442 QgsMapTool *mapTool();
443
449 void setProject( QgsProject *project );
450
457 QgsProject *project();
458
460 void setCanvasColor( const QColor &_newVal );
462 QColor canvasColor() const;
463
468 void setSelectionColor( const QColor &color );
469
474 QColor selectionColor() const;
475
477 void updateScale();
478
480 QgsMapLayer *layer( int index );
481
492 QgsMapLayer *layer( const QString &id );
493
497 int layerCount() const;
498
507 QList<QgsMapLayer *> layers( bool expandGroupLayers = false ) const;
508
518 void freeze( bool frozen = true );
519
527 bool isFrozen() const;
528
537 bool renderFlag() const { return mRenderFlag; }
538
543 Qgis::DistanceUnit mapUnits() const;
544
550 QMap<QString, QString> layerStyleOverrides() const;
551
563 void setLayerStyleOverrides( const QMap<QString, QString> &overrides );
564
583 void setTheme( const QString &theme );
584
590 QString theme() const { return mTheme; }
591
593 const QgsMapToPixel *getCoordinateTransform();
594
596 bool isDrawing();
597
599 QgsMapLayer *currentLayer();
600
602 void setWheelFactor( double factor );
603
611 void zoomScale( double scale, bool ignoreScaleLock = false );
612
620 void zoomByFactor( double scaleFactor, const QgsPointXY *center = nullptr, bool ignoreScaleLock = false );
621
623 void zoomWithCenter( int x, int y, bool zoomIn );
624
629 void zoomToFeatureExtent( QgsRectangle &rect );
630
636 bool scaleLocked() const { return mScaleLocked;}
637
639 void enableAntiAliasing( bool flag );
640
642 bool antiAliasingEnabled() const;
643
645 void enableMapTileRendering( bool flag );
646
647 // following 2 methods should be moved elsewhere or changed to private
648 // currently used by pan map tool
650 void panActionEnd( QPoint releasePoint );
651
652#ifndef SIP_RUN
653
659 void panActionStart( QPoint releasePoint );
660#endif
661
663 void panAction( QMouseEvent *event );
664
666 QPoint mouseLastXY();
667
674 void setPreviewModeEnabled( bool previewEnabled );
675
683 bool previewModeEnabled() const;
684
694 void setPreviewMode( QgsPreviewEffect::PreviewMode mode );
695
704 QgsPreviewEffect::PreviewMode previewMode() const;
705
714 QgsSnappingUtils *snappingUtils() const;
715
724 void setSnappingUtils( QgsSnappingUtils *utils );
725
736 void setExpressionContextScope( const QgsExpressionContextScope &scope ) { mExpressionContextScope = scope; }
737
746 QgsExpressionContextScope &expressionContextScope() { return mExpressionContextScope; }
747
755 const QgsExpressionContextScope &expressionContextScope() const { return mExpressionContextScope; } SIP_SKIP
756
763 QgsExpressionContextScope *defaultExpressionContextScope() const SIP_FACTORY;
764
765 QgsExpressionContext createExpressionContext() const override;
766
771 void setSegmentationTolerance( double tolerance );
772
777 void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type );
778
783 QList< QgsMapCanvasAnnotationItem *> annotationItems() const;
784
790 bool annotationsVisible() const { return mAnnotationsVisible; }
791
797 void setAnnotationsVisible( bool visible );
798
803 void setLabelingEngineSettings( const QgsLabelingEngineSettings &settings );
804
809 const QgsLabelingEngineSettings &labelingEngineSettings() const;
810
819 bool previewJobsEnabled() const;
820
829 void setPreviewJobsEnabled( bool enabled );
830
836 void setCustomDropHandlers( const QVector<QPointer<QgsCustomDropHandler >> &handlers ) SIP_SKIP;
837
848 void setTemporalRange( const QgsDateTimeRange &range );
849
856 const QgsDateTimeRange &temporalRange() const;
857
869 void installInteractionBlocker( QgsMapCanvasInteractionBlocker *blocker );
870
878 void removeInteractionBlocker( QgsMapCanvasInteractionBlocker *blocker );
879
885 bool allowInteraction( QgsMapCanvasInteractionBlocker::Interaction interaction ) const;
886
887 public slots:
888
890 void refresh();
891
901 void refreshAllLayers();
902
911 void redrawAllLayers();
912
914 void selectionChangedSlot();
915
917 void saveAsImage( const QString &fileName, QPixmap *QPixmap = nullptr, const QString & = "PNG" );
918
920 void layerStateChange();
921
929 void setRenderFlag( bool flag );
930
935 void stopRendering();
936
938 void readProject( const QDomDocument & );
939
941 void writeProject( QDomDocument & );
942
951 void setMagnificationFactor( double factor, const QgsPointXY *center = nullptr );
952
958 void setScaleLocked( bool isLocked );
959
961 void zoomIn();
962
964 void zoomOut();
965
970 void zoomToSelected( QgsMapLayer *layer = nullptr );
971
977 void zoomToSelected( const QList<QgsMapLayer *> &layers );
978
984 void setZoomResolutions( const QList<double> &resolutions ) { mZoomResolutions = resolutions; }
985
989 double zoomInFactor() const;
990
994 double zoomOutFactor() const;
995
1001 const QList<double> &zoomResolutions() const { return mZoomResolutions; }
1002
1011 QgsDoubleRange zRange() const;
1012
1021 void setZRange( const QgsDoubleRange &range );
1022
1023 private slots:
1025 void mapToolDestroyed();
1026
1028 void rendererJobFinished();
1029
1031 void previewJobFinished();
1032
1033 void mapUpdateTimeout();
1034
1035 void refreshMap();
1036
1037 void mapThemeChanged( const QString &theme );
1039 void mapThemeRenamed( const QString &theme, const QString &newTheme );
1040
1041 void updateDevicePixelFromScreen();
1042
1043 void onElevationShadingRendererChanged();
1044
1045 signals:
1046
1051 void xyCoordinates( const QgsPointXY &p );
1052
1054 void scaleChanged( double );
1055
1062 void scaleLockChanged( bool locked );
1063
1064
1067
1072 void rotationChanged( double );
1073
1078 void magnificationChanged( double );
1079
1085
1086 // TODO: deprecate when decorations are reimplemented as map canvas items
1087
1098 void renderComplete( QPainter * );
1099
1100 // ### QGIS 3: renamte to mapRefreshFinished()
1103
1104 // ### QGIS 3: rename to mapRefreshStarted()
1107
1113
1116
1118 void keyPressed( QKeyEvent *e );
1119
1121 void keyReleased( QKeyEvent *e );
1122
1127 void mapToolSet( QgsMapTool *newTool, QgsMapTool *oldTool );
1128
1135
1138
1141
1147
1153
1159
1165
1171 void themeChanged( const QString &theme );
1172
1174 void messageEmitted( const QString &title, const QString &message, Qgis::MessageLevel = Qgis::MessageLevel::Info );
1175
1183 void renderErrorOccurred( const QString &error, QgsMapLayer *layer );
1184
1195 void panDistanceBearingChanged( double distance, Qgis::DistanceUnit unit, double bearing );
1196
1201 void tapAndHoldGestureOccurred( const QgsPointXY &mapPoint, QTapAndHoldGesture *gesture );
1202
1209
1219
1226 void contextMenuAboutToShow( QMenu *menu, QgsMapMouseEvent *event );
1227
1228 protected:
1229
1230 bool event( QEvent *e ) override;
1231 void keyPressEvent( QKeyEvent *e ) override;
1232 void keyReleaseEvent( QKeyEvent *e ) override;
1233 void mouseDoubleClickEvent( QMouseEvent *e ) override;
1234 void mouseMoveEvent( QMouseEvent *e ) override;
1235 void mousePressEvent( QMouseEvent *e ) override;
1236 void mouseReleaseEvent( QMouseEvent *e ) override;
1237 void wheelEvent( QWheelEvent *e ) override;
1238 void resizeEvent( QResizeEvent *e ) override;
1239 void paintEvent( QPaintEvent *e ) override;
1240 void dragEnterEvent( QDragEnterEvent *e ) override;
1241 bool viewportEvent( QEvent *event ) override;
1242
1244 void moveCanvasContents( bool reset = false );
1245
1246 void dropEvent( QDropEvent *event ) override;
1247
1248 void showEvent( QShowEvent *event ) override;
1249
1255 void emitExtentsChanged();
1256
1258 class CanvasProperties;
1259
1261 std::unique_ptr<CanvasProperties> mCanvasProperties;
1262
1263#if 0
1264
1269 void connectNotify( const char *signal ) override;
1270#endif
1271
1272 protected slots:
1274 void updateCanvasItemPositions();
1275
1276 private slots:
1277
1278 void layerRepaintRequested( bool deferred );
1279
1280 void autoRefreshTriggered();
1281
1282 void updateAutoRefreshTimer();
1283
1284 void projectThemesChanged();
1285
1286 void startPreviewJob( int number );
1287
1288 void temporalControllerModeChanged();
1289
1290 private:
1291
1292 // Restore scale RAII
1293 class ScaleRestorer
1294 {
1295 public:
1296 ScaleRestorer( QgsMapCanvas *canvas ):
1297 mCanvas( canvas )
1298 {
1299 mLockedScale = mCanvas->mapSettings().scale();
1300 };
1301
1302 ~ScaleRestorer()
1303 {
1304 QgsRectangle newExtent = mCanvas->mapSettings().extent();
1305 newExtent.scale( mLockedScale / mCanvas->mapSettings().scale() );
1306 mCanvas->mSettings.setExtent( newExtent );
1307 };
1308
1309 private:
1310 QgsMapCanvas *mCanvas;
1311 double mLockedScale;
1312 };
1313
1315 QgsMapSettings mSettings;
1316
1318 QgsMapCanvasMap *mMap = nullptr;
1319
1320 QgsScreenHelper *mScreenHelper = nullptr;
1321
1326 QgsTemporalController *mController = nullptr;
1327
1329 bool mFrozen = false;
1330
1332 bool mRefreshScheduled = false;
1333
1335 bool mRefreshAfterJob = false;
1336
1338 bool mRenderFlag = true;
1339
1341 QPointer< QgsMapLayer > mCurrentLayer;
1342
1344 QGraphicsScene *mScene = nullptr;
1345
1347 QgsMapTool *mMapTool = nullptr;
1348
1350 QgsMapTool *mLastNonZoomMapTool = nullptr;
1351
1353 QgsProject *mProject = nullptr;
1354
1356 QList <QgsRectangle> mLastExtent;
1357 int mLastExtentIndex = -1;
1358
1360 double mWheelZoomFactor = 2.0;
1361
1363 QTimer mMapUpdateTimer;
1364
1366 QgsMapRendererQImageJob *mJob = nullptr;
1367
1369 bool mJobCanceled = false;
1370
1372 std::unique_ptr< QgsLabelingResults > mLabelingResults;
1373
1375 bool mLabelingResultsOutdated = false;
1376
1381 std::unique_ptr< QgsRenderedItemResults > mRenderedItemResults;
1382
1387 std::unique_ptr< QgsRenderedItemResults > mPreviousRenderedItemResults;
1388
1394 bool mRenderedItemResultsOutdated = false;
1395
1397 bool mUseParallelRendering = false;
1398
1400 bool mDrawRenderingStats = false;
1401
1403 QgsMapRendererCache *mCache = nullptr;
1404
1405 QTimer *mResizeTimer = nullptr;
1406 QTimer *mRefreshTimer = nullptr;
1407
1408 QgsPreviewEffect *mPreviewEffect = nullptr;
1409
1410 QgsRectangle imageRect( const QImage &img, const QgsMapSettings &mapSettings );
1411
1412 QgsSnappingUtils *mSnappingUtils = nullptr;
1413
1414 QList< QgsMapRendererQImageJob * > mPreviewJobs;
1415
1417 bool mScaleLocked = false;
1418
1419 QgsExpressionContextScope mExpressionContextScope;
1420
1422 QRect mZoomRect;
1423
1425 bool mZoomDragging = false;
1426
1428 std::unique_ptr< QgsRubberBand > mZoomRubberBand;
1429
1430 QCursor mZoomCursor;
1431
1432 QTimer mAutoRefreshTimer;
1433
1434 QTimer mPreviewTimer;
1435 QMetaObject::Connection mPreviewTimerConnection;
1436
1437 QString mTheme;
1438
1439 QgsPointXY mCursorPoint;
1440
1441 bool mAnnotationsVisible = true;
1442
1443 bool mUsePreviewJobs = false;
1444
1445 QHash< QString, int > mLastLayerRenderTime;
1446
1447 QVector<QPointer<QgsCustomDropHandler >> mDropHandlers;
1448
1449 QgsDistanceArea mDa;
1450 QList<double> mZoomResolutions;
1451
1452 QList< QgsMapCanvasInteractionBlocker * > mInteractionBlockers;
1453
1454 int mBlockItemPositionUpdates = 0;
1455 int mBlockExtentChangedSignal = 0;
1456 int mBlockScaleChangedSignal = 0;
1457
1458 std::unique_ptr< QgsTemporaryCursorOverride > mTemporaryCursorOverride;
1459
1467 QMap <QString, QDateTime> mRendererErrors;
1468
1473 QgsPointXY cursorPoint() const;
1474
1479 void updateMapSize();
1480
1486 void beginZoomRect( QPoint pos );
1487
1493 void endZoomRect( QPoint pos );
1494
1496 void stopZoomRect();
1497
1499 void startPan();
1500
1502 void stopPan();
1503
1512 bool boundingBoxOfFeatureIds( const QgsFeatureIds &ids, QgsVectorLayer *layer, QgsRectangle &bbox, QString &errorMsg ) const;
1513
1520 QgsRectangle optimalExtentForPointLayer( QgsVectorLayer *layer, const QgsPointXY &center, int scaleFactor = 5 );
1521
1522 void setLayersPrivate( const QList<QgsMapLayer *> &layers );
1523
1524 void startPreviewJobs();
1525 void stopPreviewJobs();
1526 void schedulePreviewJob( int number );
1527
1531 bool panOperationInProgress();
1532
1533 int nextZoomLevel( const QList<double> &resolutions, bool zoomIn = true ) const;
1534
1539 void clearTemporalCache();
1540
1544 void clearElevationCache();
1545
1546 void showContextMenu( QgsMapMouseEvent *event );
1547
1552 void notifyRendererErrors( const QgsMapRendererJob::Errors &errors );
1553
1554 friend class TestQgsMapCanvas;
1555
1556}; // class QgsMapCanvas
1557
1558// clazy:excludeall=qstring-allocations
1559
1560#endif
DistanceUnit
Units of distance.
Definition: qgis.h:3310
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition: qgis.h:99
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:67
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:746
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:984
QString theme() const
Returns the map's theme shown in the canvas, if set.
Definition: qgsmapcanvas.h:590
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
void panDistanceBearingChanged(double distance, Qgis::DistanceUnit unit, double bearing)
Emitted whenever the distance or bearing of an in-progress panning operation is changed.
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:636
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:755
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:537
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:736
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:107
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:53
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
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