QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
Loading...
Searching...
No Matches
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
81
82class QMenu;
84
85
91class GUI_EXPORT QgsMapCanvas : public QGraphicsView, public QgsExpressionContextGenerator
92{
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:
108
110 QgsMapCanvas( QWidget *parent SIP_TRANSFERTHIS = nullptr );
111
112 ~QgsMapCanvas() override;
113
117 double magnificationFactor() const;
118
129 void setLayers( const QList<QgsMapLayer *> &layers );
130
131 void setCurrentLayer( QgsMapLayer *layer );
132
136 const QgsMapSettings &mapSettings() const SIP_KEEPREFERENCE;
137
144 QgsMapSettings &mapSettings() SIP_SKIP;
145
152 void setTemporalController( QgsTemporalController *controller );
153
160 const QgsTemporalController *temporalController() const;
161
165 void setDestinationCrs( const QgsCoordinateReferenceSystem &crs );
166
170 void setMapSettingsFlags( Qgis::MapSettingsFlags flags );
171
179 const QgsLabelingResults *labelingResults( bool allowOutdatedResults = true ) const;
180
190 const QgsRenderedItemResults *renderedItemResults( bool allowOutdatedResults = true ) const;
191
199 void setCachingEnabled( bool enabled );
200
208 bool isCachingEnabled() const;
209
213 void clearCache();
214
223 QgsMapRendererCache *cache();
224
229 void cancelJobs() SIP_SKIP;
230
239 void waitWhileRendering();
240
244 void setParallelRenderingEnabled( bool enabled );
245
249 bool isParallelRenderingEnabled() const;
250
254 void setMapUpdateInterval( int timeMilliseconds );
255
259 int mapUpdateInterval() const;
260
265 double scale() const;
266
268 double mapUnitsPerPixel() const;
269
271 QgsRectangle extent() const;
272
281 QgsRectangle fullExtent() const;
282
292 QgsRectangle projectExtent() const;
293
305 void setExtent( const QgsRectangle &r, bool magnified = false );
306
315 bool setReferencedExtent( const QgsReferencedRectangle &extent ) SIP_THROW( QgsCsException );
316
320 double rotation() const;
321
325 void setRotation( double degrees );
326
330 void setCenter( const QgsPointXY &center );
331
335 QgsPointXY center() const;
336
342 void zoomToFullExtent();
343
352 void zoomToProjectExtent();
353
355 void zoomToPreviousExtent();
356
358 void zoomToNextExtent();
359
361 void clearExtentHistory();
362
363
369 void zoomToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids );
370
377 void panToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids, bool alwaysRecenter = true );
378
380 void panToSelected( QgsMapLayer *layer = nullptr );
381
387 void panToSelected( const QList<QgsMapLayer *> &layers );
388
400 void flashFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids,
401 const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ),
402 int flashes = 3, int duration = 500 );
403
415 void flashGeometries( const QList< QgsGeometry > &geometries, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem(),
416 const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ),
417 int flashes = 3, int duration = 500 );
418
420 void setMapTool( QgsMapTool *mapTool, bool clean = false );
421
429 void unsetMapTool( QgsMapTool *mapTool );
430
432 QgsMapTool *mapTool();
433
439 void setProject( QgsProject *project );
440
447 QgsProject *project();
448
450 void setCanvasColor( const QColor &_newVal );
452 QColor canvasColor() const;
453
457 void setSelectionColor( const QColor &color );
458
462 QColor selectionColor() const;
463
465 void updateScale();
466
468 QgsMapLayer *layer( int index );
469
480 QgsMapLayer *layer( const QString &id );
481
485 int layerCount() const;
486
495 QList<QgsMapLayer *> layers( bool expandGroupLayers = false ) const;
496
506 void freeze( bool frozen = true );
507
515 bool isFrozen() const;
516
525 bool renderFlag() const { return mRenderFlag; }
526
531 Qgis::DistanceUnit mapUnits() const;
532
537 QMap<QString, QString> layerStyleOverrides() const;
538
549 void setLayerStyleOverrides( const QMap<QString, QString> &overrides );
550
568 void setTheme( const QString &theme );
569
574 QString theme() const { return mTheme; }
575
577 const QgsMapToPixel *getCoordinateTransform();
578
580 bool isDrawing();
581
583 QgsMapLayer *currentLayer();
584
586 void setWheelFactor( double factor );
587
595 void zoomScale( double scale, bool ignoreScaleLock = false );
596
604 void zoomByFactor( double scaleFactor, const QgsPointXY *center = nullptr, bool ignoreScaleLock = false );
605
607 void zoomWithCenter( int x, int y, bool zoomIn );
608
613 void zoomToFeatureExtent( QgsRectangle &rect );
614
619 bool scaleLocked() const { return mScaleLocked;}
620
622 void enableAntiAliasing( bool flag );
623
625 bool antiAliasingEnabled() const;
626
628 void enableMapTileRendering( bool flag );
629
630 // following 2 methods should be moved elsewhere or changed to private
631 // currently used by pan map tool
633 void panActionEnd( QPoint releasePoint );
634
635#ifndef SIP_RUN
636
642 void panActionStart( QPoint releasePoint );
643#endif
644
646 void panAction( QMouseEvent *event );
647
649 QPoint mouseLastXY();
650
656 void setPreviewModeEnabled( bool previewEnabled );
657
664 bool previewModeEnabled() const;
665
674 void setPreviewMode( QgsPreviewEffect::PreviewMode mode );
675
683 QgsPreviewEffect::PreviewMode previewMode() const;
684
692 QgsSnappingUtils *snappingUtils() const;
693
701 void setSnappingUtils( QgsSnappingUtils *utils );
702
712 void setExpressionContextScope( const QgsExpressionContextScope &scope ) { mExpressionContextScope = scope; }
713
721 QgsExpressionContextScope &expressionContextScope() { return mExpressionContextScope; }
722
729 const QgsExpressionContextScope &expressionContextScope() const { return mExpressionContextScope; } SIP_SKIP
730
737 QgsExpressionContextScope *defaultExpressionContextScope() const SIP_FACTORY;
738
739 QgsExpressionContext createExpressionContext() const override;
740
745 void setSegmentationTolerance( double tolerance );
746
751 void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type );
752
756 QList< QgsMapCanvasAnnotationItem *> annotationItems() const;
757
762 bool annotationsVisible() const { return mAnnotationsVisible; }
763
768 void setAnnotationsVisible( bool visible );
769
773 void setLabelingEngineSettings( const QgsLabelingEngineSettings &settings );
774
778 const QgsLabelingEngineSettings &labelingEngineSettings() const;
779
787 bool previewJobsEnabled() const;
788
796 void setPreviewJobsEnabled( bool enabled );
797
803 void setCustomDropHandlers( const QVector<QPointer<QgsCustomDropHandler >> &handlers ) SIP_SKIP;
804
815 void setTemporalRange( const QgsDateTimeRange &range );
816
823 const QgsDateTimeRange &temporalRange() const;
824
836 void installInteractionBlocker( QgsMapCanvasInteractionBlocker *blocker );
837
845 void removeInteractionBlocker( QgsMapCanvasInteractionBlocker *blocker );
846
852 bool allowInteraction( QgsMapCanvasInteractionBlocker::Interaction interaction ) const;
853
861 void setMapController( QgsAbstract2DMapController *controller SIP_TRANSFER );
862
863 public slots:
864
866 void refresh();
867
876 void refreshAllLayers();
877
886 void redrawAllLayers();
887
889 void selectionChangedSlot();
890
892 void saveAsImage( const QString &fileName, QPixmap *QPixmap = nullptr, const QString & = "PNG" );
893
895 void layerStateChange();
896
904 void setRenderFlag( bool flag );
905
909 void stopRendering();
910
912 void readProject( const QDomDocument & );
913
915 void writeProject( QDomDocument & );
916
924 void setMagnificationFactor( double factor, const QgsPointXY *center = nullptr );
925
930 void setScaleLocked( bool isLocked );
931
933 void zoomIn();
934
936 void zoomOut();
937
942 void zoomToSelected( QgsMapLayer *layer = nullptr );
943
949 void zoomToSelected( const QList<QgsMapLayer *> &layers );
950
956 void setZoomResolutions( const QList<double> &resolutions ) { mZoomResolutions = resolutions; }
957
961 double zoomInFactor() const;
962
966 double zoomOutFactor() const;
967
973 const QList<double> &zoomResolutions() const { return mZoomResolutions; }
974
983 QgsDoubleRange zRange() const;
984
993 void setZRange( const QgsDoubleRange &range );
994
995 private slots:
997 void mapToolDestroyed();
998
1000 void rendererJobFinished();
1001
1003 void previewJobFinished();
1004
1005 void mapUpdateTimeout();
1006
1007 void refreshMap();
1008
1009 void mapThemeChanged( const QString &theme );
1011 void mapThemeRenamed( const QString &theme, const QString &newTheme );
1012
1013 void updateDevicePixelFromScreen();
1014
1015 void onElevationShadingRendererChanged();
1016
1017 signals:
1018
1023 void xyCoordinates( const QgsPointXY &p );
1024
1026 void scaleChanged( double );
1027
1034 void scaleLockChanged( bool locked );
1035
1036
1039
1043 void rotationChanged( double );
1044
1048 void magnificationChanged( double );
1049
1054
1055 // TODO: deprecate when decorations are reimplemented as map canvas items
1056
1067 void renderComplete( QPainter * );
1068
1069 // ### QGIS 3: renamte to mapRefreshFinished()
1072
1073 // ### QGIS 3: rename to mapRefreshStarted()
1076
1082
1085
1087 void keyPressed( QKeyEvent *e );
1088
1090 void keyReleased( QKeyEvent *e );
1091
1095 void mapToolSet( QgsMapTool *newTool, QgsMapTool *oldTool );
1096
1103
1106
1109
1114
1119
1124
1129
1134 void themeChanged( const QString &theme );
1135
1137 void messageEmitted( const QString &title, const QString &message, Qgis::MessageLevel = Qgis::MessageLevel::Info );
1138
1146 void renderErrorOccurred( const QString &error, QgsMapLayer *layer );
1147
1158 void panDistanceBearingChanged( double distance, Qgis::DistanceUnit unit, double bearing );
1159
1164 void tapAndHoldGestureOccurred( const QgsPointXY &mapPoint, QTapAndHoldGesture *gesture );
1165
1172
1182
1189 void contextMenuAboutToShow( QMenu *menu, QgsMapMouseEvent *event );
1190
1191 protected:
1192
1193 bool event( QEvent *e ) override;
1194 void keyPressEvent( QKeyEvent *e ) override;
1195 void keyReleaseEvent( QKeyEvent *e ) override;
1196 void mouseDoubleClickEvent( QMouseEvent *e ) override;
1197 void mouseMoveEvent( QMouseEvent *e ) override;
1198 void mousePressEvent( QMouseEvent *e ) override;
1199 void mouseReleaseEvent( QMouseEvent *e ) override;
1200 void wheelEvent( QWheelEvent *e ) override;
1201 void resizeEvent( QResizeEvent *e ) override;
1202 void paintEvent( QPaintEvent *e ) override;
1203 void dragEnterEvent( QDragEnterEvent *e ) override;
1204 bool viewportEvent( QEvent *event ) override;
1205
1207 void moveCanvasContents( bool reset = false );
1208
1209 void dropEvent( QDropEvent *event ) override;
1210
1211 void showEvent( QShowEvent *event ) override;
1212
1218 void emitExtentsChanged();
1219
1221 class CanvasProperties;
1222
1224 std::unique_ptr<CanvasProperties> mCanvasProperties;
1225
1226#if 0
1227
1232 void connectNotify( const char *signal ) override;
1233#endif
1234
1235 protected slots:
1237 void updateCanvasItemPositions();
1238
1239 private slots:
1240
1241 void layerRepaintRequested( bool deferred );
1242
1243 void autoRefreshTriggered();
1244
1245 void updateAutoRefreshTimer();
1246
1247 void projectThemesChanged();
1248
1249 void startPreviewJob( int number );
1250
1251 void temporalControllerModeChanged();
1252
1253 private:
1254
1255 // Restore scale RAII
1256 class ScaleRestorer
1257 {
1258 public:
1259 ScaleRestorer( QgsMapCanvas *canvas ):
1260 mCanvas( canvas )
1261 {
1262 mLockedScale = mCanvas->mapSettings().scale();
1263 };
1264
1265 ~ScaleRestorer()
1266 {
1267 QgsRectangle newExtent = mCanvas->mapSettings().extent();
1268 newExtent.scale( mLockedScale / mCanvas->mapSettings().scale() );
1269 mCanvas->mSettings.setExtent( newExtent );
1270 };
1271
1272 private:
1273 QgsMapCanvas *mCanvas;
1274 double mLockedScale;
1275 };
1276
1278 QgsMapSettings mSettings;
1279
1281 QgsMapCanvasMap *mMap = nullptr;
1282
1283 QgsScreenHelper *mScreenHelper = nullptr;
1284
1289 QgsTemporalController *mController = nullptr;
1290
1292 bool mFrozen = false;
1293
1295 bool mRefreshScheduled = false;
1296
1298 bool mRefreshAfterJob = false;
1299
1301 bool mRenderFlag = true;
1302
1304 QPointer< QgsMapLayer > mCurrentLayer;
1305
1307 QGraphicsScene *mScene = nullptr;
1308
1310 QgsMapTool *mMapTool = nullptr;
1311
1313 QgsProject *mProject = nullptr;
1314
1316 QList <QgsRectangle> mLastExtent;
1317 int mLastExtentIndex = -1;
1318
1320 double mWheelZoomFactor = 2.0;
1321
1323 QTimer mMapUpdateTimer;
1324
1326 QgsMapRendererQImageJob *mJob = nullptr;
1327
1329 bool mJobCanceled = false;
1330
1332 std::unique_ptr< QgsLabelingResults > mLabelingResults;
1333
1335 bool mLabelingResultsOutdated = false;
1336
1341 std::unique_ptr< QgsRenderedItemResults > mRenderedItemResults;
1342
1347 std::unique_ptr< QgsRenderedItemResults > mPreviousRenderedItemResults;
1348
1354 bool mRenderedItemResultsOutdated = false;
1355
1357 bool mUseParallelRendering = false;
1358
1360 bool mDrawRenderingStats = false;
1361
1363 QgsMapRendererCache *mCache = nullptr;
1364
1365 QTimer *mResizeTimer = nullptr;
1366 QTimer *mRefreshTimer = nullptr;
1367
1368 QgsPreviewEffect *mPreviewEffect = nullptr;
1369
1370 QgsRectangle imageRect( const QImage &img, const QgsMapSettings &mapSettings );
1371
1372 QgsSnappingUtils *mSnappingUtils = nullptr;
1373
1374 QList< QgsMapRendererQImageJob * > mPreviewJobs;
1375
1377 bool mScaleLocked = false;
1378
1379 QgsExpressionContextScope mExpressionContextScope;
1380
1382 QRect mZoomRect;
1383
1385 bool mZoomDragging = false;
1386
1388 std::unique_ptr< QgsRubberBand > mZoomRubberBand;
1389
1390 QCursor mZoomCursor;
1391
1392 QTimer mAutoRefreshTimer;
1393
1394 QTimer mPreviewTimer;
1395 QMetaObject::Connection mPreviewTimerConnection;
1396
1397 QString mTheme;
1398
1399 QgsPointXY mCursorPoint;
1400
1401 bool mAnnotationsVisible = true;
1402
1403 bool mUsePreviewJobs = false;
1404
1405 QHash< QString, int > mLastLayerRenderTime;
1406
1407 QVector<QPointer<QgsCustomDropHandler >> mDropHandlers;
1408
1409 QgsDistanceArea mDa;
1410 QList<double> mZoomResolutions;
1411
1412 QList< QgsMapCanvasInteractionBlocker * > mInteractionBlockers;
1413
1414 int mBlockItemPositionUpdates = 0;
1415 int mBlockExtentChangedSignal = 0;
1416 int mBlockScaleChangedSignal = 0;
1417
1418 std::unique_ptr< QgsTemporaryCursorOverride > mTemporaryCursorOverride;
1419
1427 QMap <QString, QDateTime> mRendererErrors;
1428
1429
1430 QPointer< QgsAbstract2DMapController > mMapController;
1431
1436 QgsPointXY cursorPoint() const;
1437
1441 void updateMapSize();
1442
1447 void beginZoomRect( QPoint pos );
1448
1453 void endZoomRect( QPoint pos );
1454
1456 void stopZoomRect();
1457
1459 void startPan();
1460
1462 void stopPan();
1463
1472 bool boundingBoxOfFeatureIds( const QgsFeatureIds &ids, QgsVectorLayer *layer, QgsRectangle &bbox, QString &errorMsg ) const;
1473
1480 QgsRectangle optimalExtentForPointLayer( QgsVectorLayer *layer, const QgsPointXY &center, int scaleFactor = 5 );
1481
1482 void setLayersPrivate( const QList<QgsMapLayer *> &layers );
1483
1484 void startPreviewJobs();
1485 void stopPreviewJobs();
1486 void schedulePreviewJob( int number );
1487
1491 bool panOperationInProgress();
1492
1493 int nextZoomLevel( const QList<double> &resolutions, bool zoomIn = true ) const;
1494
1499 void clearTemporalCache();
1500
1504 void clearElevationCache();
1505
1506 void showContextMenu( QgsMapMouseEvent *event );
1507
1512 void notifyRendererErrors( const QgsMapRendererJob::Errors &errors );
1513
1514 friend class TestQgsMapCanvas;
1515
1516}; // class QgsMapCanvas
1517
1518// clazy:excludeall=qstring-allocations
1519
1520#endif
The Qgis class provides global constants for use throughout the application.
Definition qgis.h:54
DistanceUnit
Units of distance.
Definition qgis.h:4062
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition qgis.h:99
@ Info
Information message.
Definition qgis.h:100
Abstract base class for all 2D map controllers.
Abstract base class for all geometries.
This class 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:201
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.
A class for highlight features on the map.
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.
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.
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.
QString theme() const
Returns the map's theme shown in the canvas, if set.
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.
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.
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.
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.
Base class for all map layer types.
Definition qgsmaplayer.h:75
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.
Abstract base class for all map tools.
Definition qgsmaptool.h:71
A class to represent 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.
A class for drawing transient features (e.g.
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.
Represents a vector layer which manages a vector based data sets.
#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