/
qgsmapcanvas.sip.in
1046 lines (754 loc) · 25.1 KB
/
qgsmapcanvas.sip.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsmapcanvas.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapCanvas : QGraphicsView
{
%Docstring
Map canvas is a class for displaying all GIS data types on a canvas.
%End
%TypeHeaderCode
#include "qgsmapcanvas.h"
%End
%ConvertToSubClassCode
if ( qobject_cast<QgsMapCanvas *>( sipCpp ) != nullptr )
sipType = sipType_QgsMapCanvas;
else
sipType = nullptr;
%End
public:
QgsMapCanvas( QWidget *parent /TransferThis/ = 0 );
%Docstring
Constructor
%End
~QgsMapCanvas();
double magnificationFactor() const;
%Docstring
Returns the magnification factor
.. versionadded:: 2.16
%End
void setLayers( const QList<QgsMapLayer *> &layers );
%Docstring
Sets the list of ``layers`` that should be shown in the canvas.
If the map canvas has been associated with a map theme via a call
to setTheme(), then any calls to setLayers() are ignored. It is necessary
to first clear the theme association by calling setTheme() with an
empty string before setLayers() calls can be made.
.. seealso:: :py:func:`layers`
.. versionadded:: 3.0
%End
void setCurrentLayer( QgsMapLayer *layer );
const QgsMapSettings &mapSettings() const /KeepReference/;
%Docstring
Gets access to properties used for map rendering
.. versionadded:: 2.4
%End
void setDestinationCrs( const QgsCoordinateReferenceSystem &crs );
%Docstring
sets destination coordinate reference system
.. versionadded:: 2.4
%End
void setMapSettingsFlags( QgsMapSettings::Flags flags );
%Docstring
Resets the ``flags`` for the canvas' map settings.
.. versionadded:: 3.0
%End
const QgsLabelingResults *labelingResults() const;
%Docstring
Gets access to the labeling results (may be ``None``)
.. versionadded:: 2.4
%End
void setCachingEnabled( bool enabled );
%Docstring
Set whether to cache images of rendered layers
.. versionadded:: 2.4
%End
bool isCachingEnabled() const;
%Docstring
Check whether images of rendered layers are curerently being cached
.. versionadded:: 2.4
%End
void clearCache();
%Docstring
Make sure to remove any rendered images from cache (does nothing if cache is not enabled)
.. versionadded:: 2.4
%End
void waitWhileRendering();
%Docstring
Blocks until the rendering job has finished.
In almost all cases you do NOT want to call this, as it will hang the UI
until the rendering job is complete. It's included in API solely for
unit testing and standalone Python scripts.
.. versionadded:: 3.0
%End
void setParallelRenderingEnabled( bool enabled );
%Docstring
Set whether the layers are rendered in parallel or sequentially
.. versionadded:: 2.4
%End
bool isParallelRenderingEnabled() const;
%Docstring
Check whether the layers are rendered in parallel or sequentially
.. versionadded:: 2.4
%End
void setMapUpdateInterval( int timeMilliseconds );
%Docstring
Set how often map preview should be updated while it is being rendered (in milliseconds)
.. versionadded:: 2.4
%End
int mapUpdateInterval() const;
%Docstring
Find out how often map preview should be updated while it is being rendered (in milliseconds)
.. versionadded:: 2.4
%End
double scale() const;
%Docstring
Returns the last reported scale of the canvas.
The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
%End
double mapUnitsPerPixel() const;
%Docstring
Returns the mapUnitsPerPixel (map units per pixel) for the canvas
%End
QgsRectangle extent() const;
%Docstring
Returns the current zoom extent of the map canvas
%End
QgsRectangle fullExtent() const;
%Docstring
Returns the combined extent for all layers on the map canvas
%End
void setExtent( const QgsRectangle &r, bool magnified = false );
%Docstring
Sets the extent of the map canvas
%End
double rotation() const;
%Docstring
Gets the current map canvas rotation in clockwise degrees
.. versionadded:: 2.8
%End
void setRotation( double degrees );
%Docstring
Set the rotation of the map canvas in clockwise degrees
.. versionadded:: 2.8
%End
void setCenter( const QgsPointXY ¢er );
%Docstring
Set the center of the map canvas, in geographical coordinates
.. versionadded:: 2.8
%End
QgsPointXY center() const;
%Docstring
Gets map center, in geographical coordinates
.. versionadded:: 2.8
%End
void zoomToFullExtent();
%Docstring
Zoom to the full extent of all layers
%End
void zoomToPreviousExtent();
%Docstring
Zoom to the previous extent (view)
%End
void zoomToNextExtent();
%Docstring
Zoom to the next extent (view)
%End
void clearExtentHistory();
void zoomToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids );
%Docstring
Set canvas extent to the bounding box of a set of features
:param layer: the vector layer
:param ids: the feature ids*
%End
void panToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids, bool alwaysRecenter = true );
%Docstring
Centers canvas extent to feature ids
:param layer: the vector layer
:param ids: the feature ids
:param alwaysRecenter: if false, the canvas is recentered only if the bounding box is not contained within the current extent
%End
void panToSelected( QgsVectorLayer *layer = 0 );
%Docstring
Pan to the selected features of current (vector) layer keeping same extent.
%End
void flashFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds &ids,
const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ),
int flashes = 3, int duration = 500 );
%Docstring
Causes a set of features with matching ``ids`` from a vector ``layer`` to flash
within the canvas.
The ``startColor`` and ``endColor`` can be specified, along with the number of
``flashes`` and ``duration`` of each flash (in milliseconds).
.. note::
If the features or geometries are already available, flashGeometries() is much more efficient.
.. seealso:: :py:func:`flashGeometries`
.. versionadded:: 3.0
%End
void flashGeometries( const QList< QgsGeometry > &geometries, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem(),
const QColor &startColor = QColor( 255, 0, 0, 255 ), const QColor &endColor = QColor( 255, 0, 0, 0 ),
int flashes = 3, int duration = 500 );
%Docstring
Causes a set of ``geometries`` to flash within the canvas.
If ``crs`` is a valid coordinate reference system, the geometries will be automatically
transformed from this CRS to the canvas CRS.
The ``startColor`` and ``endColor`` can be specified, along with the number of
``flashes`` and ``duration`` of each flash (in milliseconds).
.. seealso:: :py:func:`flashFeatureIds`
.. versionadded:: 3.0
%End
void setMapTool( QgsMapTool *mapTool, bool clean = false );
%Docstring
Sets the map tool currently being used on the canvas
%End
void unsetMapTool( QgsMapTool *mapTool );
%Docstring
Unset the current map tool or last non zoom tool
This is called from destructor of map tools to make sure
that this map tool won't be used any more.
You don't have to call it manually, QgsMapTool takes care of it.
%End
QgsMapTool *mapTool();
%Docstring
Returns the currently active tool
%End
void setCanvasColor( const QColor &_newVal );
%Docstring
Write property of QColor bgColor.
%End
QColor canvasColor() const;
%Docstring
Read property of QColor bgColor.
%End
void setSelectionColor( const QColor &color );
%Docstring
Set color of selected vector features
.. versionadded:: 2.4
%End
QColor selectionColor() const;
%Docstring
Returns color for selected features
.. versionadded:: 3.0
%End
void updateScale();
%Docstring
Emits signal scaleChanged to update scale in main window
%End
QgsMapLayer *layer( int index );
%Docstring
Returns the map layer at position index in the layer stack
%End
int layerCount() const;
%Docstring
Returns number of layers on the map
%End
QList<QgsMapLayer *> layers() const;
%Docstring
Returns the list of layers shown within the map canvas.
.. seealso:: :py:func:`setLayers`
%End
void freeze( bool frozen = true );
%Docstring
Freeze/thaw the map canvas. This is used to prevent the canvas from
responding to events while layers are being added/removed etc.
:param frozen: Boolean specifying if the canvas should be frozen (``True``) or
thawed (``False``). Default is ``True``.
.. seealso:: :py:func:`isFrozen`
.. seealso:: :py:func:`setRenderFlag`
while setRenderFlag() should only be used when users disable rendering via GUI.
%End
bool isFrozen() const;
%Docstring
Returns ``True`` if canvas is frozen.
.. seealso:: :py:func:`renderFlag`
have been halted programmatically, while renderFlag() should be used to
determine whether a user has disabled rendering via GUI.
.. seealso:: :py:func:`freeze`
%End
bool renderFlag() const;
%Docstring
Returns ``True`` if canvas render is disabled as a result of user disabling
renders via the GUI.
.. seealso:: :py:func:`setRenderFlag`
.. seealso:: :py:func:`isFrozen`
have been halted programmatically, while renderFlag() should be used to
determine whether a user has disabled rendering via GUI.
%End
QgsUnitTypes::DistanceUnit mapUnits() const;
%Docstring
Convenience function for returning the current canvas map units. The map units
are dictated by the canvas' destinationCrs() map units.
%End
QMap<QString, QString> layerStyleOverrides() const;
%Docstring
Returns the stored overrides of styles for layers.
.. seealso:: :py:func:`setLayerStyleOverrides`
.. versionadded:: 2.12
%End
void setLayerStyleOverrides( const QMap<QString, QString> &overrides );
%Docstring
Sets the stored overrides of styles for rendering layers.
If the map canvas has been associated with a map theme via a call
to setTheme(), then any calls to setLayerStyleOverrides() are ignored. It is necessary
to first clear the theme association by calling setTheme() with an
empty string before setLayerStyleOverrides() calls can be made.
.. seealso:: :py:func:`layerStyleOverrides`
.. versionadded:: 2.12
%End
void setTheme( const QString &theme );
%Docstring
Sets a map ``theme`` to show in the canvas. The theme name must match
a theme present in the associated project's :py:class:`QgsMapThemeCollection`.
When the canvas is associated to a map theme, it will automatically follow
the layer selection and layer styles from that theme. Calls to setLayers()
or setLayerStyleOverrides() will have no effect, and canvases associated
with a QgsLayerTreeMapCanvasBridge will no longer synchronize their
state with the layer tree. In these cases it is necessary to call
setTheme() with an empty string to clear the theme association and
allow map updates with setLayers(), setLayerStyleOverrides(), or via
:py:class:`QgsLayerTreeMapCanvasBridge`.
If an empty string is passed then the current theme association will be
cleared.
.. seealso:: :py:func:`theme`
.. versionadded:: 3.0
%End
QString theme() const;
%Docstring
Returns the map's theme shown in the canvas, if set.
.. seealso:: :py:func:`setTheme`
.. versionadded:: 3.0
%End
const QgsMapToPixel *getCoordinateTransform();
%Docstring
Gets the current coordinate transform
%End
bool isDrawing();
%Docstring
Find out whether rendering is in progress
%End
QgsMapLayer *currentLayer();
%Docstring
returns current layer (set by legend widget)
%End
void setWheelFactor( double factor );
%Docstring
Sets wheel zoom factor (should be greater than 1)
%End
void zoomScale( double scale );
%Docstring
Zooms the canvas to a specific ``scale``.
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
%End
void zoomByFactor( double scaleFactor, const QgsPointXY *center = 0 );
%Docstring
Zoom with the factor supplied. Factor > 1 zooms out, interval (0,1) zooms in
If point is given, re-center on it
%End
void zoomWithCenter( int x, int y, bool zoomIn );
%Docstring
Zooms in/out with a given center
%End
void zoomToFeatureExtent( QgsRectangle &rect );
%Docstring
Zooms to feature extent. Adds a small margin around the extent
and does a pan if rect is empty (point extent)
%End
bool scaleLocked() const;
%Docstring
Returns whether the scale is locked, so zooming can be performed using magnication.
.. seealso:: :py:func:`setScaleLocked`
.. versionadded:: 2.16
%End
void enableAntiAliasing( bool flag );
%Docstring
used to determine if anti-aliasing is enabled or not
%End
bool antiAliasingEnabled() const;
%Docstring
``True`` if antialising is enabled
%End
void enableMapTileRendering( bool flag );
%Docstring
sets map tile rendering flag
%End
void panActionEnd( QPoint releasePoint );
%Docstring
Ends pan action and redraws the canvas.
%End
void panAction( QMouseEvent *event );
%Docstring
Called when mouse is moving and pan is activated
%End
QPoint mouseLastXY();
%Docstring
returns last position of mouse cursor
%End
void setPreviewModeEnabled( bool previewEnabled );
%Docstring
Enables a preview mode for the map canvas
:param previewEnabled: set to ``True`` to enable a preview mode
.. seealso:: :py:func:`setPreviewMode`
.. versionadded:: 2.3
%End
bool previewModeEnabled() const;
%Docstring
Returns whether a preview mode is enabled for the map canvas
:return: ``True`` if a preview mode is currently enabled
.. seealso:: :py:func:`setPreviewModeEnabled`
.. seealso:: :py:func:`previewMode`
.. versionadded:: 2.3
%End
void setPreviewMode( QgsPreviewEffect::PreviewMode mode );
%Docstring
Sets a preview mode for the map canvas. This setting only has an effect if
previewModeEnabled is ``True``.
:param mode: preview mode for the canvas
.. seealso:: :py:func:`previewMode`
.. seealso:: :py:func:`setPreviewModeEnabled`
.. seealso:: :py:func:`previewModeEnabled`
.. versionadded:: 2.3
%End
QgsPreviewEffect::PreviewMode previewMode() const;
%Docstring
Returns the current preview mode for the map canvas. This setting only has an effect if
previewModeEnabled is ``True``.
:return: preview mode for map canvas
.. seealso:: :py:func:`setPreviewMode`
.. seealso:: :py:func:`previewModeEnabled`
.. versionadded:: 2.3
%End
QgsSnappingUtils *snappingUtils() const;
%Docstring
Returns snapping utility class that is associated with map canvas.
If no snapping utils instance has been associated previously, an internal will be created for convenience
(so map tools do not need to test for existence of the instance).
Main canvas in QGIS returns an instance which is always up-to-date with the project's snapping configuration.
.. versionadded:: 2.8
%End
void setSnappingUtils( QgsSnappingUtils *utils );
%Docstring
Assign an instance of snapping utils to the map canvas.
The instance is not owned by the canvas, so it is possible to use one instance in multiple canvases.
For main canvas in QGIS, do not associate a different instance from the existing one (it is updated from
the project's snapping configuration).
.. versionadded:: 2.8
%End
void setExpressionContextScope( const QgsExpressionContextScope &scope );
%Docstring
Sets an expression context scope for the map canvas. This scope is injected into the expression
context used for rendering the map, and can be used to apply specific variable overrides for
expression evaluation for the map canvas render. This method will overwrite the existing expression
context scope for the canvas.
:param scope: new expression context scope
.. seealso:: :py:func:`expressionContextScope`
.. seealso:: :py:func:`defaultExpressionContextScope`
.. versionadded:: 2.12
%End
QgsExpressionContextScope &expressionContextScope();
%Docstring
Returns a reference to the expression context scope for the map canvas. This scope is injected
into the expression context used for rendering the map, and can be used to apply specific variable
overrides for expression evaluation for the map canvas render.
.. seealso:: :py:func:`setExpressionContextScope`
.. seealso:: :py:func:`defaultExpressionContextScope`
.. versionadded:: 2.12
%End
QgsExpressionContextScope *defaultExpressionContextScope() /Factory/;
%Docstring
Creates a new scope which contains default variables and functions relating to the map canvas.
.. seealso:: :py:func:`expressionContextScope`
.. seealso:: :py:func:`setExpressionContextScope`
.. versionadded:: 3.4
%End
void setSegmentationTolerance( double tolerance );
%Docstring
Sets the segmentation tolerance applied when rendering curved geometries
:param tolerance: the segmentation tolerance*
%End
void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type );
%Docstring
Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation)
:param type: the segmentation tolerance typename*
%End
QList< QgsMapCanvasAnnotationItem *> annotationItems() const;
%Docstring
Returns a list of all annotation items in the canvas.
.. versionadded:: 3.0
%End
bool annotationsVisible() const;
%Docstring
Returns ``True`` if annotations are visible within the map canvas.
.. seealso:: :py:func:`setAnnotationsVisible`
.. versionadded:: 3.0
%End
void setAnnotationsVisible( bool visible );
%Docstring
Sets whether annotations are ``visible`` in the canvas.
.. seealso:: :py:func:`annotationsVisible`
.. versionadded:: 3.0
%End
void setLabelingEngineSettings( const QgsLabelingEngineSettings &settings );
%Docstring
Sets global labeling engine settings in the internal map settings
.. versionadded:: 3.0
%End
const QgsLabelingEngineSettings &labelingEngineSettings() const;
%Docstring
Returns global labeling engine settings from the internal map settings
.. versionadded:: 3.0
%End
bool previewJobsEnabled() const;
%Docstring
Returns ``True`` if canvas map preview jobs (low priority render jobs which render portions
of the view just outside of the canvas extent, to allow preview of these
out-of-canvas areas when panning or zooming out the map) are enabled
for the canvas.
.. seealso:: :py:func:`setPreviewJobsEnabled`
.. versionadded:: 3.0
%End
void setPreviewJobsEnabled( bool enabled );
%Docstring
Sets whether canvas map preview jobs (low priority render jobs which render portions
of the view just outside of the canvas extent, to allow preview of these
out-of-canvas areas when panning or zooming out the map) are ``enabled``
for the canvas.
.. seealso:: :py:func:`previewJobsEnabled`
.. versionadded:: 3.0
%End
public slots:
void refresh();
%Docstring
Repaints the canvas map
%End
void refreshAllLayers();
%Docstring
Reload all layers, clear the cache and refresh the canvas
.. versionadded:: 2.9
%End
void selectionChangedSlot();
%Docstring
Receives signal about selection change, and pass it on with layer info
%End
void saveAsImage( const QString &fileName, QPixmap *QPixmap = 0, const QString & = "PNG" );
%Docstring
Save the contents of the map canvas to disk as an image
%End
void layerStateChange();
%Docstring
This slot is connected to the visibility change of one or more layers
%End
void setRenderFlag( bool flag );
%Docstring
Sets whether a user has disabled canvas renders via the GUI.
:param flag: set to ``False`` to indicate that user has disabled renders
.. seealso:: :py:func:`renderFlag`
.. seealso:: :py:func:`freeze`
while setRenderFlag() should only be used when users disable rendering via GUI.
%End
void stopRendering();
%Docstring
stop rendering (if there is any right now)
.. versionadded:: 2.4
%End
void readProject( const QDomDocument & );
%Docstring
called to read map canvas settings from project
%End
void writeProject( QDomDocument & );
%Docstring
called to write map canvas settings to project
%End
void setMagnificationFactor( double factor );
%Docstring
Sets the factor of magnification to apply to the map canvas. Indeed, we
increase/decrease the DPI of the map settings according to this factor
in order to render marker point, labels, ... bigger.
.. versionadded:: 2.16
%End
void setScaleLocked( bool isLocked );
%Docstring
Lock the scale, so zooming can be performed using magnication
.. seealso:: :py:func:`scaleLocked`
.. versionadded:: 2.16
%End
void zoomIn();
%Docstring
Zoom in with fixed factor
%End
void zoomOut();
%Docstring
Zoom out with fixed factor
%End
void zoomToSelected( QgsVectorLayer *layer = 0 );
%Docstring
Zoom to the extent of the selected features of provided (vector) layer.
:param layer: optionally specify different than current layer
%End
signals:
void xyCoordinates( const QgsPointXY &p );
%Docstring
Emits current mouse position
.. note::
changed in 1.3 *
%End
void scaleChanged( double );
%Docstring
Emitted when the scale of the map changes
%End
void extentsChanged();
%Docstring
Emitted when the extents of the map change
%End
void rotationChanged( double );
%Docstring
Emitted when the rotation of the map changes
.. versionadded:: 2.8
%End
void magnificationChanged( double );
%Docstring
Emitted when the scale of the map changes
.. versionadded:: 2.16
%End
void canvasColorChanged();
%Docstring
Emitted when canvas background color changes
.. versionadded:: 3.0
%End
void renderComplete( QPainter * );
%Docstring
TODO: deprecate when decorations are reimplemented as map canvas items
- anything related to rendering progress is not visible outside of map canvas
- additional drawing shall be done directly within the renderer job or independently as a map canvas item
%End
void mapCanvasRefreshed();
%Docstring
Emitted when canvas finished a refresh request.
%End
void renderStarting();
%Docstring
Emitted when the canvas is about to be rendered.
%End
void layersChanged();
%Docstring
Emitted when a new set of layers has been received
%End
void keyPressed( QKeyEvent *e );
%Docstring
Emit key press event
%End
void keyReleased( QKeyEvent *e );
%Docstring
Emit key release event
%End
void mapToolSet( QgsMapTool *newTool, QgsMapTool *oldTool );
%Docstring
Emit map tool changed with the old tool
.. versionadded:: 2.3
%End
void selectionChanged( QgsVectorLayer *layer );
%Docstring
Emitted when selection in any layer gets changed
%End
void zoomLastStatusChanged( bool );
%Docstring
Emitted when zoom last status changed
%End
void zoomNextStatusChanged( bool );
%Docstring
Emitted when zoom next status changed
%End
void destinationCrsChanged();
%Docstring
Emitted when map CRS has changed
.. versionadded:: 2.4
%End
void transformContextChanged();
%Docstring
Emitted when the canvas transform context is changed.
.. versionadded:: 3.0
%End
void currentLayerChanged( QgsMapLayer *layer );
%Docstring
Emitted when the current layer is changed
.. versionadded:: 2.8
%End
void layerStyleOverridesChanged();
%Docstring
Emitted when the configuration of overridden layer styles changes
.. versionadded:: 2.12
%End
void themeChanged( const QString &theme );
%Docstring
Emitted when the canvas has been assigned a different map theme.
.. seealso:: :py:func:`setTheme`
.. versionadded:: 3.0
%End
void messageEmitted( const QString &title, const QString &message, Qgis::MessageLevel = Qgis::Info );
%Docstring
emit a message (usually to be displayed in a message bar)
%End
protected:
virtual bool event( QEvent *e );
%Docstring
Overridden standard event to be gestures aware
%End
virtual void keyPressEvent( QKeyEvent *e );
%Docstring
Overridden key press event
%End
virtual void keyReleaseEvent( QKeyEvent *e );
%Docstring
Overridden key release event
%End
virtual void mouseDoubleClickEvent( QMouseEvent *e );
%Docstring
Overridden mouse double-click event
%End
virtual void mouseMoveEvent( QMouseEvent *e );
%Docstring
Overridden mouse move event
%End
virtual void mousePressEvent( QMouseEvent *e );
%Docstring
Overridden mouse press event
%End
virtual void mouseReleaseEvent( QMouseEvent *e );
%Docstring
Overridden mouse release event
%End
virtual void wheelEvent( QWheelEvent *e );