QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
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 Qgis::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 void onElevationShadingRendererChanged();
1026
1027 signals:
1028
1033 void xyCoordinates( const QgsPointXY &p );
1034
1036 void scaleChanged( double );
1037
1044 void scaleLockChanged( bool locked );
1045
1046
1049
1054 void rotationChanged( double );
1055
1060 void magnificationChanged( double );
1061
1067
1068 // TODO: deprecate when decorations are reimplemented as map canvas items
1069
1080 void renderComplete( QPainter * );
1081
1082 // ### QGIS 3: renamte to mapRefreshFinished()
1085
1086 // ### QGIS 3: rename to mapRefreshStarted()
1089
1095
1098
1100 void keyPressed( QKeyEvent *e );
1101
1103 void keyReleased( QKeyEvent *e );
1104
1109 void mapToolSet( QgsMapTool *newTool, QgsMapTool *oldTool );
1110
1117
1120
1123
1129
1135
1141
1147
1153 void themeChanged( const QString &theme );
1154
1156 void messageEmitted( const QString &title, const QString &message, Qgis::MessageLevel = Qgis::MessageLevel::Info );
1157
1165 void renderErrorOccurred( const QString &error, QgsMapLayer *layer );
1166
1177 void panDistanceBearingChanged( double distance, Qgis::DistanceUnit unit, double bearing );
1178
1183 void tapAndHoldGestureOccurred( const QgsPointXY &mapPoint, QTapAndHoldGesture *gesture );
1184
1191
1201
1208 void contextMenuAboutToShow( QMenu *menu, QgsMapMouseEvent *event );
1209
1210 protected:
1211
1212 bool event( QEvent *e ) override;
1213 void keyPressEvent( QKeyEvent *e ) override;
1214 void keyReleaseEvent( QKeyEvent *e ) override;
1215 void mouseDoubleClickEvent( QMouseEvent *e ) override;
1216 void mouseMoveEvent( QMouseEvent *e ) override;
1217 void mousePressEvent( QMouseEvent *e ) override;
1218 void mouseReleaseEvent( QMouseEvent *e ) override;
1219 void wheelEvent( QWheelEvent *e ) override;
1220 void resizeEvent( QResizeEvent *e ) override;
1221 void paintEvent( QPaintEvent *e ) override;
1222 void dragEnterEvent( QDragEnterEvent *e ) override;
1223 bool viewportEvent( QEvent *event ) override;
1224
1226 void moveCanvasContents( bool reset = false );
1227
1228 void dropEvent( QDropEvent *event ) override;
1229
1230 void showEvent( QShowEvent *event ) override;
1231
1237 void emitExtentsChanged();
1238
1240 class CanvasProperties;
1241
1243 std::unique_ptr<CanvasProperties> mCanvasProperties;
1244
1245#if 0
1246
1251 void connectNotify( const char *signal ) override;
1252#endif
1253
1254 protected slots:
1256 void updateCanvasItemPositions();
1257
1258 private slots:
1259
1260 void layerRepaintRequested( bool deferred );
1261
1262 void autoRefreshTriggered();
1263
1264 void updateAutoRefreshTimer();
1265
1266 void projectThemesChanged();
1267
1268 void startPreviewJob( int number );
1269
1270 void temporalControllerModeChanged();
1271
1272 private:
1273
1274 // Restore scale RAII
1275 class ScaleRestorer
1276 {
1277 public:
1278 ScaleRestorer( QgsMapCanvas *canvas ):
1279 mCanvas( canvas )
1280 {
1281 mLockedScale = mCanvas->mapSettings().scale();
1282 };
1283
1284 ~ScaleRestorer()
1285 {
1286 QgsRectangle newExtent = mCanvas->mapSettings().extent();
1287 newExtent.scale( mLockedScale / mCanvas->mapSettings().scale() );
1288 mCanvas->mSettings.setExtent( newExtent );
1289 };
1290
1291 private:
1292 QgsMapCanvas *mCanvas;
1293 double mLockedScale;
1294 };
1295
1297 QgsMapSettings mSettings;
1298
1300 QgsMapCanvasMap *mMap = nullptr;
1301
1302 QgsScreenHelper *mScreenHelper = nullptr;
1303
1308 QgsTemporalController *mController = nullptr;
1309
1311 bool mFrozen = false;
1312
1314 bool mRefreshScheduled = false;
1315
1317 bool mRefreshAfterJob = false;
1318
1320 bool mRenderFlag = true;
1321
1323 QPointer< QgsMapLayer > mCurrentLayer;
1324
1326 QGraphicsScene *mScene = nullptr;
1327
1329 QgsMapTool *mMapTool = nullptr;
1330
1332 QgsMapTool *mLastNonZoomMapTool = nullptr;
1333
1335 QgsProject *mProject = nullptr;
1336
1338 QList <QgsRectangle> mLastExtent;
1339 int mLastExtentIndex = -1;
1340
1342 double mWheelZoomFactor = 2.0;
1343
1345 QTimer mMapUpdateTimer;
1346
1348 QgsMapRendererQImageJob *mJob = nullptr;
1349
1351 bool mJobCanceled = false;
1352
1354 std::unique_ptr< QgsLabelingResults > mLabelingResults;
1355
1357 bool mLabelingResultsOutdated = false;
1358
1363 std::unique_ptr< QgsRenderedItemResults > mRenderedItemResults;
1364
1369 std::unique_ptr< QgsRenderedItemResults > mPreviousRenderedItemResults;
1370
1376 bool mRenderedItemResultsOutdated = false;
1377
1379 bool mUseParallelRendering = false;
1380
1382 bool mDrawRenderingStats = false;
1383
1385 QgsMapRendererCache *mCache = nullptr;
1386
1387 QTimer *mResizeTimer = nullptr;
1388 QTimer *mRefreshTimer = nullptr;
1389
1390 QgsPreviewEffect *mPreviewEffect = nullptr;
1391
1392 QgsRectangle imageRect( const QImage &img, const QgsMapSettings &mapSettings );
1393
1394 QgsSnappingUtils *mSnappingUtils = nullptr;
1395
1396 QList< QgsMapRendererQImageJob * > mPreviewJobs;
1397
1399 bool mScaleLocked = false;
1400
1401 QgsExpressionContextScope mExpressionContextScope;
1402
1404 QRect mZoomRect;
1405
1407 bool mZoomDragging = false;
1408
1410 std::unique_ptr< QgsRubberBand > mZoomRubberBand;
1411
1412 QCursor mZoomCursor;
1413
1414 QTimer mAutoRefreshTimer;
1415
1416 QTimer mPreviewTimer;
1417 QMetaObject::Connection mPreviewTimerConnection;
1418
1419 QString mTheme;
1420
1421 QgsPointXY mCursorPoint;
1422
1423 bool mAnnotationsVisible = true;
1424
1425 bool mUsePreviewJobs = false;
1426
1427 QHash< QString, int > mLastLayerRenderTime;
1428
1429 QVector<QPointer<QgsCustomDropHandler >> mDropHandlers;
1430
1431 QgsDistanceArea mDa;
1432 QList<double> mZoomResolutions;
1433
1434 QList< QgsMapCanvasInteractionBlocker * > mInteractionBlockers;
1435
1436 int mBlockItemPositionUpdates = 0;
1437 int mBlockExtentChangedSignal = 0;
1438 int mBlockScaleChangedSignal = 0;
1439
1440 std::unique_ptr< QgsTemporaryCursorOverride > mTemporaryCursorOverride;
1441
1449 QMap <QString, QDateTime> mRendererErrors;
1450
1455 QgsPointXY cursorPoint() const;
1456
1461 void updateMapSize();
1462
1468 void beginZoomRect( QPoint pos );
1469
1475 void endZoomRect( QPoint pos );
1476
1478 void stopZoomRect();
1479
1481 void startPan();
1482
1484 void stopPan();
1485
1494 bool boundingBoxOfFeatureIds( const QgsFeatureIds &ids, QgsVectorLayer *layer, QgsRectangle &bbox, QString &errorMsg ) const;
1495
1502 QgsRectangle optimalExtentForPointLayer( QgsVectorLayer *layer, const QgsPointXY &center, int scaleFactor = 5 );
1503
1504 void setLayersPrivate( const QList<QgsMapLayer *> &layers );
1505
1506 void startPreviewJobs();
1507 void stopPreviewJobs();
1508 void schedulePreviewJob( int number );
1509
1513 bool panOperationInProgress();
1514
1515 int nextZoomLevel( const QList<double> &resolutions, bool zoomIn = true ) const;
1516
1521 void clearTemporalCache();
1522
1526 void clearElevationCache();
1527
1528 void showContextMenu( QgsMapMouseEvent *event );
1529
1534 void notifyRendererErrors( const QgsMapRendererJob::Errors &errors );
1535
1536 friend class TestQgsMapCanvas;
1537
1538}; // class QgsMapCanvas
1539
1540// clazy:excludeall=qstring-allocations
1541
1542#endif
DistanceUnit
Units of distance.
Definition: qgis.h:3047
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition: qgis.h:100
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 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: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 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:105
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
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