QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
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
118 double magnificationFactor() const;
119
131 void setLayers( const QList<QgsMapLayer *> &layers );
132
133 void setCurrentLayer( QgsMapLayer *layer );
134
139 const QgsMapSettings &mapSettings() const SIP_KEEPREFERENCE;
140
147 QgsMapSettings &mapSettings() SIP_SKIP;
148
155 void setTemporalController( QgsTemporalController *controller );
156
163 const QgsTemporalController *temporalController() const;
164
169 void setDestinationCrs( const QgsCoordinateReferenceSystem &crs );
170
175 void setMapSettingsFlags( Qgis::MapSettingsFlags flags );
176
185 const QgsLabelingResults *labelingResults( bool allowOutdatedResults = true ) const;
186
196 const QgsRenderedItemResults *renderedItemResults( bool allowOutdatedResults = true ) const;
197
206 void setCachingEnabled( bool enabled );
207
216 bool isCachingEnabled() const;
217
222 void clearCache();
223
232 QgsMapRendererCache *cache();
233
238 void cancelJobs() SIP_SKIP;
239
249 void waitWhileRendering();
250
255 void setParallelRenderingEnabled( bool enabled );
256
261 bool isParallelRenderingEnabled() const;
262
267 void setMapUpdateInterval( int timeMilliseconds );
268
273 int mapUpdateInterval() const;
274
279 double scale() const;
280
282 double mapUnitsPerPixel() const;
283
285 QgsRectangle extent() const;
286
295 QgsRectangle fullExtent() const;
296
306 QgsRectangle projectExtent() const;
307
319 void setExtent( const QgsRectangle &r, bool magnified = false );
320
329 bool setReferencedExtent( const QgsReferencedRectangle &extent ) SIP_THROW( QgsCsException );
330
335 double rotation() const;
336
341 void setRotation( double degrees );
342
347 void setCenter( const QgsPointXY &center );
348
353 QgsPointXY center() const;
354
360 void zoomToFullExtent();
361
370 void zoomToProjectExtent();
371
373 void zoomToPreviousExtent();
374
376 void zoomToNextExtent();
377
379 void clearExtentHistory();
380
381
387 void zoomToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids );
388
395 void panToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids, bool alwaysRecenter = true );
396
398 void panToSelected( QgsMapLayer *layer = nullptr );
399
405 void panToSelected( const QList<QgsMapLayer *> &layers );
406
419 void flashFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids,
420 const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ),
421 int flashes = 3, int duration = 500 );
422
435 void flashGeometries( const QList< QgsGeometry > &geometries, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem(),
436 const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ),
437 int flashes = 3, int duration = 500 );
438
440 void setMapTool( QgsMapTool *mapTool, bool clean = false );
441
449 void unsetMapTool( QgsMapTool *mapTool );
450
452 QgsMapTool *mapTool();
453
459 void setProject( QgsProject *project );
460
467 QgsProject *project();
468
470 void setCanvasColor( const QColor &_newVal );
472 QColor canvasColor() const;
473
478 void setSelectionColor( const QColor &color );
479
484 QColor selectionColor() const;
485
487 void updateScale();
488
490 QgsMapLayer *layer( int index );
491
502 QgsMapLayer *layer( const QString &id );
503
507 int layerCount() const;
508
517 QList<QgsMapLayer *> layers( bool expandGroupLayers = false ) const;
518
528 void freeze( bool frozen = true );
529
537 bool isFrozen() const;
538
547 bool renderFlag() const { return mRenderFlag; }
548
553 Qgis::DistanceUnit mapUnits() const;
554
560 QMap<QString, QString> layerStyleOverrides() const;
561
573 void setLayerStyleOverrides( const QMap<QString, QString> &overrides );
574
593 void setTheme( const QString &theme );
594
600 QString theme() const { return mTheme; }
601
603 const QgsMapToPixel *getCoordinateTransform();
604
606 bool isDrawing();
607
609 QgsMapLayer *currentLayer();
610
612 void setWheelFactor( double factor );
613
621 void zoomScale( double scale, bool ignoreScaleLock = false );
622
630 void zoomByFactor( double scaleFactor, const QgsPointXY *center = nullptr, bool ignoreScaleLock = false );
631
633 void zoomWithCenter( int x, int y, bool zoomIn );
634
639 void zoomToFeatureExtent( QgsRectangle &rect );
640
646 bool scaleLocked() const { return mScaleLocked;}
647
649 void enableAntiAliasing( bool flag );
650
652 bool antiAliasingEnabled() const;
653
655 void enableMapTileRendering( bool flag );
656
657 // following 2 methods should be moved elsewhere or changed to private
658 // currently used by pan map tool
660 void panActionEnd( QPoint releasePoint );
661
662#ifndef SIP_RUN
663
669 void panActionStart( QPoint releasePoint );
670#endif
671
673 void panAction( QMouseEvent *event );
674
676 QPoint mouseLastXY();
677
684 void setPreviewModeEnabled( bool previewEnabled );
685
693 bool previewModeEnabled() const;
694
704 void setPreviewMode( QgsPreviewEffect::PreviewMode mode );
705
714 QgsPreviewEffect::PreviewMode previewMode() const;
715
724 QgsSnappingUtils *snappingUtils() const;
725
734 void setSnappingUtils( QgsSnappingUtils *utils );
735
746 void setExpressionContextScope( const QgsExpressionContextScope &scope ) { mExpressionContextScope = scope; }
747
756 QgsExpressionContextScope &expressionContextScope() { return mExpressionContextScope; }
757
765 const QgsExpressionContextScope &expressionContextScope() const { return mExpressionContextScope; } SIP_SKIP
766
773 QgsExpressionContextScope *defaultExpressionContextScope() const SIP_FACTORY;
774
775 QgsExpressionContext createExpressionContext() const override;
776
781 void setSegmentationTolerance( double tolerance );
782
787 void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type );
788
793 QList< QgsMapCanvasAnnotationItem *> annotationItems() const;
794
800 bool annotationsVisible() const { return mAnnotationsVisible; }
801
807 void setAnnotationsVisible( bool visible );
808
813 void setLabelingEngineSettings( const QgsLabelingEngineSettings &settings );
814
819 const QgsLabelingEngineSettings &labelingEngineSettings() const;
820
829 bool previewJobsEnabled() const;
830
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
920 void refreshAllLayers();
921
930 void redrawAllLayers();
931
933 void selectionChangedSlot();
934
936 void saveAsImage( const QString &fileName, QPixmap *QPixmap = nullptr, const QString & = "PNG" );
937
939 void layerStateChange();
940
948 void setRenderFlag( bool flag );
949
954 void stopRendering();
955
957 void readProject( const QDomDocument & );
958
960 void writeProject( QDomDocument & );
961
970 void setMagnificationFactor( double factor, const QgsPointXY *center = nullptr );
971
977 void setScaleLocked( bool isLocked );
978
980 void zoomIn();
981
983 void zoomOut();
984
989 void zoomToSelected( QgsMapLayer *layer = nullptr );
990
996 void zoomToSelected( const QList<QgsMapLayer *> &layers );
997
1003 void setZoomResolutions( const QList<double> &resolutions ) { mZoomResolutions = resolutions; }
1004
1008 double zoomInFactor() const;
1009
1013 double zoomOutFactor() const;
1014
1020 const QList<double> &zoomResolutions() const { return mZoomResolutions; }
1021
1030 QgsDoubleRange zRange() const;
1031
1040 void setZRange( const QgsDoubleRange &range );
1041
1042 private slots:
1044 void mapToolDestroyed();
1045
1047 void rendererJobFinished();
1048
1050 void previewJobFinished();
1051
1052 void mapUpdateTimeout();
1053
1054 void refreshMap();
1055
1056 void mapThemeChanged( const QString &theme );
1058 void mapThemeRenamed( const QString &theme, const QString &newTheme );
1059
1060 void updateDevicePixelFromScreen();
1061
1062 void onElevationShadingRendererChanged();
1063
1064 signals:
1065
1070 void xyCoordinates( const QgsPointXY &p );
1071
1073 void scaleChanged( double );
1074
1081 void scaleLockChanged( bool locked );
1082
1083
1086
1091 void rotationChanged( double );
1092
1097 void magnificationChanged( double );
1098
1104
1105 // TODO: deprecate when decorations are reimplemented as map canvas items
1106
1117 void renderComplete( QPainter * );
1118
1119 // ### QGIS 3: renamte to mapRefreshFinished()
1122
1123 // ### QGIS 3: rename to mapRefreshStarted()
1126
1132
1135
1137 void keyPressed( QKeyEvent *e );
1138
1140 void keyReleased( QKeyEvent *e );
1141
1146 void mapToolSet( QgsMapTool *newTool, QgsMapTool *oldTool );
1147
1154
1157
1160
1166
1172
1178
1184
1190 void themeChanged( const QString &theme );
1191
1193 void messageEmitted( const QString &title, const QString &message, Qgis::MessageLevel = Qgis::MessageLevel::Info );
1194
1202 void renderErrorOccurred( const QString &error, QgsMapLayer *layer );
1203
1214 void panDistanceBearingChanged( double distance, Qgis::DistanceUnit unit, double bearing );
1215
1220 void tapAndHoldGestureOccurred( const QgsPointXY &mapPoint, QTapAndHoldGesture *gesture );
1221
1228
1238
1245 void contextMenuAboutToShow( QMenu *menu, QgsMapMouseEvent *event );
1246
1247 protected:
1248
1249 bool event( QEvent *e ) override;
1250 void keyPressEvent( QKeyEvent *e ) override;
1251 void keyReleaseEvent( QKeyEvent *e ) override;
1252 void mouseDoubleClickEvent( QMouseEvent *e ) override;
1253 void mouseMoveEvent( QMouseEvent *e ) override;
1254 void mousePressEvent( QMouseEvent *e ) override;
1255 void mouseReleaseEvent( QMouseEvent *e ) override;
1256 void wheelEvent( QWheelEvent *e ) override;
1257 void resizeEvent( QResizeEvent *e ) override;
1258 void paintEvent( QPaintEvent *e ) override;
1259 void dragEnterEvent( QDragEnterEvent *e ) override;
1260 bool viewportEvent( QEvent *event ) override;
1261
1263 void moveCanvasContents( bool reset = false );
1264
1265 void dropEvent( QDropEvent *event ) override;
1266
1267 void showEvent( QShowEvent *event ) override;
1268
1274 void emitExtentsChanged();
1275
1277 class CanvasProperties;
1278
1280 std::unique_ptr<CanvasProperties> mCanvasProperties;
1281
1282#if 0
1283
1288 void connectNotify( const char *signal ) override;
1289#endif
1290
1291 protected slots:
1293 void updateCanvasItemPositions();
1294
1295 private slots:
1296
1297 void layerRepaintRequested( bool deferred );
1298
1299 void autoRefreshTriggered();
1300
1301 void updateAutoRefreshTimer();
1302
1303 void projectThemesChanged();
1304
1305 void startPreviewJob( int number );
1306
1307 void temporalControllerModeChanged();
1308
1309 private:
1310
1311 // Restore scale RAII
1312 class ScaleRestorer
1313 {
1314 public:
1315 ScaleRestorer( QgsMapCanvas *canvas ):
1316 mCanvas( canvas )
1317 {
1318 mLockedScale = mCanvas->mapSettings().scale();
1319 };
1320
1321 ~ScaleRestorer()
1322 {
1323 QgsRectangle newExtent = mCanvas->mapSettings().extent();
1324 newExtent.scale( mLockedScale / mCanvas->mapSettings().scale() );
1325 mCanvas->mSettings.setExtent( newExtent );
1326 };
1327
1328 private:
1329 QgsMapCanvas *mCanvas;
1330 double mLockedScale;
1331 };
1332
1334 QgsMapSettings mSettings;
1335
1337 QgsMapCanvasMap *mMap = nullptr;
1338
1339 QgsScreenHelper *mScreenHelper = nullptr;
1340
1345 QgsTemporalController *mController = nullptr;
1346
1348 bool mFrozen = false;
1349
1351 bool mRefreshScheduled = false;
1352
1354 bool mRefreshAfterJob = false;
1355
1357 bool mRenderFlag = true;
1358
1360 QPointer< QgsMapLayer > mCurrentLayer;
1361
1363 QGraphicsScene *mScene = nullptr;
1364
1366 QgsMapTool *mMapTool = nullptr;
1367
1369 QgsMapTool *mLastNonZoomMapTool = nullptr;
1370
1372 QgsProject *mProject = nullptr;
1373
1375 QList <QgsRectangle> mLastExtent;
1376 int mLastExtentIndex = -1;
1377
1379 double mWheelZoomFactor = 2.0;
1380
1382 QTimer mMapUpdateTimer;
1383
1385 QgsMapRendererQImageJob *mJob = nullptr;
1386
1388 bool mJobCanceled = false;
1389
1391 std::unique_ptr< QgsLabelingResults > mLabelingResults;
1392
1394 bool mLabelingResultsOutdated = false;
1395
1400 std::unique_ptr< QgsRenderedItemResults > mRenderedItemResults;
1401
1406 std::unique_ptr< QgsRenderedItemResults > mPreviousRenderedItemResults;
1407
1413 bool mRenderedItemResultsOutdated = false;
1414
1416 bool mUseParallelRendering = false;
1417
1419 bool mDrawRenderingStats = false;
1420
1422 QgsMapRendererCache *mCache = nullptr;
1423
1424 QTimer *mResizeTimer = nullptr;
1425 QTimer *mRefreshTimer = nullptr;
1426
1427 QgsPreviewEffect *mPreviewEffect = nullptr;
1428
1429 QgsRectangle imageRect( const QImage &img, const QgsMapSettings &mapSettings );
1430
1431 QgsSnappingUtils *mSnappingUtils = nullptr;
1432
1433 QList< QgsMapRendererQImageJob * > mPreviewJobs;
1434
1436 bool mScaleLocked = false;
1437
1438 QgsExpressionContextScope mExpressionContextScope;
1439
1441 QRect mZoomRect;
1442
1444 bool mZoomDragging = false;
1445
1447 std::unique_ptr< QgsRubberBand > mZoomRubberBand;
1448
1449 QCursor mZoomCursor;
1450
1451 QTimer mAutoRefreshTimer;
1452
1453 QTimer mPreviewTimer;
1454 QMetaObject::Connection mPreviewTimerConnection;
1455
1456 QString mTheme;
1457
1458 QgsPointXY mCursorPoint;
1459
1460 bool mAnnotationsVisible = true;
1461
1462 bool mUsePreviewJobs = false;
1463
1464 QHash< QString, int > mLastLayerRenderTime;
1465
1466 QVector<QPointer<QgsCustomDropHandler >> mDropHandlers;
1467
1468 QgsDistanceArea mDa;
1469 QList<double> mZoomResolutions;
1470
1471 QList< QgsMapCanvasInteractionBlocker * > mInteractionBlockers;
1472
1473 int mBlockItemPositionUpdates = 0;
1474 int mBlockExtentChangedSignal = 0;
1475 int mBlockScaleChangedSignal = 0;
1476
1477 std::unique_ptr< QgsTemporaryCursorOverride > mTemporaryCursorOverride;
1478
1486 QMap <QString, QDateTime> mRendererErrors;
1487
1488
1489 QPointer< QgsAbstract2DMapController > mMapController;
1490
1495 QgsPointXY cursorPoint() const;
1496
1501 void updateMapSize();
1502
1508 void beginZoomRect( QPoint pos );
1509
1515 void endZoomRect( QPoint pos );
1516
1518 void stopZoomRect();
1519
1521 void startPan();
1522
1524 void stopPan();
1525
1534 bool boundingBoxOfFeatureIds( const QgsFeatureIds &ids, QgsVectorLayer *layer, QgsRectangle &bbox, QString &errorMsg ) const;
1535
1542 QgsRectangle optimalExtentForPointLayer( QgsVectorLayer *layer, const QgsPointXY &center, int scaleFactor = 5 );
1543
1544 void setLayersPrivate( const QList<QgsMapLayer *> &layers );
1545
1546 void startPreviewJobs();
1547 void stopPreviewJobs();
1548 void schedulePreviewJob( int number );
1549
1553 bool panOperationInProgress();
1554
1555 int nextZoomLevel( const QList<double> &resolutions, bool zoomIn = true ) const;
1556
1561 void clearTemporalCache();
1562
1566 void clearElevationCache();
1567
1568 void showContextMenu( QgsMapMouseEvent *event );
1569
1574 void notifyRendererErrors( const QgsMapRendererJob::Errors &errors );
1575
1576 friend class TestQgsMapCanvas;
1577
1578}; // class QgsMapCanvas
1579
1580// clazy:excludeall=qstring-allocations
1581
1582#endif
The Qgis class provides global constants for use throughout the application.
Definition qgis.h:54
DistanceUnit
Units of distance.
Definition qgis.h:3496
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: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 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:74
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: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.
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: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_TRANSFER
Definition qgis_sip.h:36
#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
const QgsCoordinateReferenceSystem & crs