QGIS API Documentation  3.23.0-Master (7c4a6de034)
qgis.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgis.h - QGIS namespace
3  -------------------
4  begin : Sat 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 QGIS_H
19 #define QGIS_H
20 
21 
22 #include <QMetaEnum>
23 #include <cfloat>
24 #include <memory>
25 #include <cmath>
26 
27 #include "qgstolerance.h"
28 #include "qgis_core.h"
29 #include "qgis_sip.h"
30 
31 #ifdef SIP_RUN
32 % ModuleHeaderCode
33 #include <qgis.h>
34 % End
35 
36 % ModuleCode
37 int QgisEvent = QEvent::User + 1;
38 % End
39 #endif
40 
47  {
48  VectorLayer,
49  RasterLayer,
50  PluginLayer,
51  MeshLayer,
55  GroupLayer,
56 };
57 
58 
63 class CORE_EXPORT Qgis
64 {
65  Q_GADGET
66  public:
67 
73  static QString version();
74 
80  static int versionInt();
81 
87  static QString releaseName();
88 
90  static const char *QGIS_DEV_VERSION;
91 
97  static QString devVersion();
98 
99  // Enumerations
100  //
101 
107  {
108  Info = 0,
109  Warning = 1,
110  Critical = 2,
111  Success = 3,
112  NoLevel = 4,
113  };
114  Q_ENUM( MessageLevel )
115 
116 
121  {
122  UnknownDataType = 0,
123  Byte = 1,
124  UInt16 = 2,
125  Int16 = 3,
126  UInt32 = 4,
127  Int32 = 5,
128  Float32 = 6,
129  Float64 = 7,
130  CInt16 = 8,
131  CInt32 = 9,
132  CFloat32 = 10,
133  CFloat64 = 11,
134  ARGB32 = 12,
135  ARGB32_Premultiplied = 13
136  };
137  Q_ENUM( DataType )
138 
139 
144  enum class VectorLayerTypeFlag : int
145  {
146  SqlQuery = 1 << 0
147  };
148  Q_ENUM( VectorLayerTypeFlag )
150  Q_DECLARE_FLAGS( VectorLayerTypeFlags, VectorLayerTypeFlag )
151 
152 
157  {
158  Never = 0,
159  Ask = 1,
160  SessionOnly = 2,
161  Always = 3,
162  NotForThisSession,
163  };
164  Q_ENUM( PythonMacroMode )
165 
166 
172  {
173  Uncounted = -2,
174  UnknownCount = -1,
175  };
176  Q_ENUM( FeatureCountState )
177 
178 
183  {
184  Marker,
185  Line,
186  Fill,
187  Hybrid
188  };
189  Q_ENUM( SymbolType )
190 
191 
197  {
198  ScaleArea,
199  ScaleDiameter
200  };
201  Q_ENUM( ScaleMethod )
202 
203 
209  {
210  DynamicRotation = 2,
211  };
212  Q_ENUM( SymbolRenderHint )
214  Q_DECLARE_FLAGS( SymbolRenderHints, SymbolRenderHint ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsSymbol, RenderHints )
215 
216 
222  enum class SymbolFlag : int
223  {
224  RendererShouldUseSymbolLevels = 1 << 0,
225  };
226  Q_ENUM( SymbolFlag )
228  Q_DECLARE_FLAGS( SymbolFlags, SymbolFlag )
229 
230 
236  {
237  FlagIncludeCrosshairsForMarkerSymbols = 1 << 0,
238  };
239  Q_ENUM( SymbolPreviewFlag )
241  Q_DECLARE_FLAGS( SymbolPreviewFlags, SymbolPreviewFlag ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsSymbol, SymbolPreviewFlags )
242 
248  enum class SymbolLayerFlag : int
249  {
250  DisableFeatureClipping = 1 << 0,
251  };
252  Q_ENUM( SymbolLayerFlag )
254  Q_DECLARE_FLAGS( SymbolLayerFlags, SymbolLayerFlag )
255 
256 
262  {
263  Collection,
264  Directory,
265  Layer,
266  Error,
267  Favorites,
268  Project,
269  Custom,
270  Fields,
271  Field,
272  };
273  Q_ENUM( BrowserItemType )
274 
275 
281  {
282  NotPopulated,
283  Populating,
284  Populated,
285  };
286  Q_ENUM( BrowserItemState )
287 
288 
294  {
295  NoCapabilities = 0,
296  SetCrs = 1 << 0,
297  Fertile = 1 << 1,
298  Fast = 1 << 2,
299  Collapse = 1 << 3,
300  Rename = 1 << 4,
301  Delete = 1 << 5,
302  ItemRepresentsFile = 1 << 6,
303  };
304  Q_ENUM( BrowserItemCapability )
306  Q_DECLARE_FLAGS( BrowserItemCapabilities, BrowserItemCapability ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsDataItem, Capabilities )
307 
314  {
315  NoType,
316  Vector,
317  Raster,
318  Point,
319  Line,
320  Polygon,
321  TableLayer,
322  Database,
323  Table,
324  Plugin,
325  Mesh,
326  VectorTile,
327  PointCloud
328  };
329  Q_ENUM( BrowserLayerType )
330 
331 
336  enum class BrowserDirectoryMonitoring : int
337  {
338  Default,
339  NeverMonitor,
340  AlwaysMonitor,
341  };
342  Q_ENUM( BrowserDirectoryMonitoring )
343 
344 
348  enum class HttpMethod : int
349  {
350  Get = 0,
351  Post = 1
352  };
353  Q_ENUM( HttpMethod )
354 
355 
361  {
362  Success SIP_MONKEYPATCH_COMPAT_NAME( NoError ) = 0,
363  ErrorCreatingDataSource SIP_MONKEYPATCH_COMPAT_NAME( ErrCreateDataSource ),
364  ErrorCreatingLayer SIP_MONKEYPATCH_COMPAT_NAME( ErrCreateLayer ),
365  ErrorAttributeTypeUnsupported SIP_MONKEYPATCH_COMPAT_NAME( ErrAttributeTypeUnsupported ),
366  ErrorAttributeCreationFailed SIP_MONKEYPATCH_COMPAT_NAME( ErrAttributeCreationFailed ),
367  ErrorProjectingFeatures SIP_MONKEYPATCH_COMPAT_NAME( ErrProjection ),
368  ErrorFeatureWriteFailed SIP_MONKEYPATCH_COMPAT_NAME( ErrFeatureWriteFailed ),
369  ErrorInvalidLayer SIP_MONKEYPATCH_COMPAT_NAME( ErrInvalidLayer ),
370  ErrorInvalidProvider SIP_MONKEYPATCH_COMPAT_NAME( ErrInvalidProvider ),
371  ErrorProviderUnsupportedFeature SIP_MONKEYPATCH_COMPAT_NAME( ErrProviderUnsupportedFeature ),
372  ErrorConnectionFailed SIP_MONKEYPATCH_COMPAT_NAME( ErrConnectionFailed ),
373  UserCanceled SIP_MONKEYPATCH_COMPAT_NAME( ErrUserCanceled ),
374  };
375  Q_ENUM( VectorExportResult )
376 
377 
382  {
383  SubsetStringFilter = 1 << 1,
384  GeometryColumn = 1 << 2,
385  PrimaryKeys = 1 << 3,
386  UnstableFeatureIds = 1 << 4
387  };
388  Q_ENUM( SqlLayerDefinitionCapability )
390  Q_DECLARE_FLAGS( SqlLayerDefinitionCapabilities, SqlLayerDefinitionCapability )
391 
392 
397  enum class SqlKeywordCategory : int
398  {
399  Keyword,
400  Constant,
401  Function,
402  Geospatial,
403  Operator,
404  Math,
405  Aggregate,
406  String,
407  Identifier
408  };
409  Q_ENUM( SqlKeywordCategory )
410 
411 
415  enum class DriveType : int
416  {
417  Unknown,
418  Invalid,
419  Removable,
420  Fixed,
421  Remote,
422  CdRom,
423  RamDisk,
424  };
425  Q_ENUM( DriveType )
426 
427 
432  {
433  Deferred SIP_MONKEYPATCH_COMPAT_NAME( DownloadLater ),
434  Immediate SIP_MONKEYPATCH_COMPAT_NAME( DownloadImmediately ),
435  };
436  Q_ENUM( ActionStart )
437 
438 
443  enum class UnplacedLabelVisibility : int
444  {
445  FollowEngineSetting,
446  NeverShow,
447  };
448  Q_ENUM( UnplacedLabelVisibility )
449 
450 
455  enum class SublayerQueryFlag : int
456  {
457  FastScan = 1 << 0,
458  ResolveGeometryType = 1 << 1,
459  CountFeatures = 1 << 2,
460  IncludeSystemTables = 1 << 3,
461  };
463  Q_DECLARE_FLAGS( SublayerQueryFlags, SublayerQueryFlag )
464  Q_ENUM( SublayerQueryFlag )
465 
466 
471  enum class SublayerFlag : int
472  {
473  SystemTable = 1 << 0,
474  };
476  Q_DECLARE_FLAGS( SublayerFlags, SublayerFlag )
477  Q_ENUM( SublayerFlag )
478 
479 
485  {
486  Unknown SIP_MONKEYPATCH_COMPAT_NAME( UnknownRole ) = 0,
487  Provider SIP_MONKEYPATCH_COMPAT_NAME( ProviderRole ) = 1,
488  Renderer SIP_MONKEYPATCH_COMPAT_NAME( RendererRole ) = 2,
489  Brightness SIP_MONKEYPATCH_COMPAT_NAME( BrightnessRole ) = 3,
490  Resampler SIP_MONKEYPATCH_COMPAT_NAME( ResamplerRole ) = 4,
491  Projector SIP_MONKEYPATCH_COMPAT_NAME( ProjectorRole ) = 5,
492  Nuller SIP_MONKEYPATCH_COMPAT_NAME( NullerRole ) = 6,
493  HueSaturation SIP_MONKEYPATCH_COMPAT_NAME( HueSaturationRole ) = 7,
494  };
495  Q_ENUM( RasterPipeInterfaceRole )
496 
497 
502  {
504  ResampleFilter,
506  Provider
507  };
508  Q_ENUM( RasterResamplingStage )
509 
510 
515  enum class MeshEditingErrorType : int
516  {
517  NoError,
518  InvalidFace,
519  TooManyVerticesInFace,
520  FlatFace,
521  UniqueSharedVertex,
522  InvalidVertex,
523  ManifoldFace,
524  };
525  Q_ENUM( MeshEditingErrorType )
526 
527 
532  enum class FilePathType : int
533  {
534  Absolute,
535  Relative,
536  };
537  Q_ENUM( FilePathType )
538 
539 
544  enum class SublayerPromptMode : int
545  {
546  AlwaysAsk,
547  AskExcludingRasterBands,
548  NeverAskSkip,
549  NeverAskLoadAll,
550  };
551  Q_ENUM( SublayerPromptMode )
552 
553 
559  {
560  SetSelection,
561  AddToSelection,
562  IntersectSelection,
563  RemoveFromSelection,
564  };
565  Q_ENUM( SelectBehavior )
566 
567 
573  {
574  Success = 0,
575  EmptyGeometry = 1,
576  EditFailed = 2,
577  FetchFeatureFailed = 3,
578  InvalidLayer = 4,
579  };
580  Q_ENUM( VectorEditResult )
581 
582 
588  {
589  SemiTransparentCircle,
590  Cross,
591  NoMarker,
592  };
593  Q_ENUM( VertexMarkerType )
594 
595 
599  enum class ContentStatus : int
600  {
601  NotStarted,
602  Running,
603  Finished,
604  Failed,
605  Canceled,
606  };
607  Q_ENUM( ContentStatus )
608 
609 
614  enum class BabelFormatCapability : int
615  {
616  Import = 1 << 0,
617  Export = 1 << 1,
618  Waypoints = 1 << 2,
619  Routes = 1 << 3,
620  Tracks = 1 << 4,
621  };
623  Q_DECLARE_FLAGS( BabelFormatCapabilities, BabelFormatCapability )
624  Q_ENUM( BabelFormatCapability )
625 
626 
632  enum class BabelCommandFlag : int
633  {
634  QuoteFilePaths = 1 << 0,
635  };
637  Q_DECLARE_FLAGS( BabelCommandFlags, BabelCommandFlag )
638  Q_ENUM( BabelCommandFlag )
639 
640 
645  enum class GpsFeatureType : int
646  {
647  Waypoint,
648  Route,
649  Track,
650  };
651  Q_ENUM( GpsFeatureType )
652 
653 
661  {
662  Success = 0,
663  NothingHappened = 1000,
664  InvalidBaseGeometry,
665  InvalidInputGeometryType,
666  SelectionIsEmpty,
667  SelectionIsGreaterThanOne,
668  GeometryEngineError,
669  LayerNotEditable,
670  /* Add part issues */
671  AddPartSelectedGeometryNotFound,
672  AddPartNotMultiGeometry,
673  /* Add ring issues*/
674  AddRingNotClosed,
675  AddRingNotValid,
676  AddRingCrossesExistingRings,
677  AddRingNotInExistingFeature,
678  /* Split features */
679  SplitCannotSplitPoint,
680  };
681  Q_ENUM( GeometryOperationResult )
682 
683 
689  {
690  AllowSelfTouchingHoles SIP_MONKEYPATCH_COMPAT_NAME( FlagAllowSelfTouchingHoles ) = 1 << 0,
691  };
694  Q_ENUM( GeometryValidityFlag )
695 
696 
701  {
702  QgisInternal SIP_MONKEYPATCH_COMPAT_NAME( ValidatorQgisInternal ),
703  Geos SIP_MONKEYPATCH_COMPAT_NAME( ValidatorGeos ),
704  };
705  Q_ENUM( GeometryValidationEngine )
706 
707 
713  {
714  Left SIP_MONKEYPATCH_COMPAT_NAME( SideLeft ) = 0,
715  Right SIP_MONKEYPATCH_COMPAT_NAME( SideRight ),
716  };
717  Q_ENUM( BufferSide )
718 
719 
725  {
726  Round SIP_MONKEYPATCH_COMPAT_NAME( CapRound ) = 1,
727  Flat SIP_MONKEYPATCH_COMPAT_NAME( CapFlat ),
728  Square SIP_MONKEYPATCH_COMPAT_NAME( CapSquare ),
729  };
730  Q_ENUM( EndCapStyle )
731 
732 
738  {
739  Round SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleRound ) = 1,
740  Miter SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleMiter ),
741  Bevel SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleBevel ),
742  };
743  Q_ENUM( JoinStyle )
744 
745 
750  enum class SpatialFilterType : int
751  {
752  NoFilter,
753  BoundingBox,
754  DistanceWithin,
755  };
756  Q_ENUM( SpatialFilterType )
757 
758 
763  enum class FileOperationFlag : int
764  {
765  IncludeMetadataFile = 1 << 0,
766  IncludeStyleFile = 1 << 1,
767  };
769  Q_DECLARE_FLAGS( FileOperationFlags, FileOperationFlag )
770  Q_ENUM( FileOperationFlag )
771 
772 
777  enum class MapLayerProperty : int
778  {
779  UsersCannotToggleEditing = 1 << 0,
780  };
782  Q_DECLARE_FLAGS( MapLayerProperties, MapLayerProperty )
783  Q_ENUM( MapLayerProperty )
784 
785 
790  enum class AnnotationItemFlag : int
791  {
792  ScaleDependentBoundingBox = 1 << 0,
793  };
795  Q_DECLARE_FLAGS( AnnotationItemFlags, AnnotationItemFlag )
796  Q_ENUM( AnnotationItemFlag )
797 
798 
803  enum class AnnotationItemGuiFlag : int
804  {
805  FlagNoCreationTools = 1 << 0,
806  };
808  Q_DECLARE_FLAGS( AnnotationItemGuiFlags, AnnotationItemGuiFlag )
809  Q_ENUM( AnnotationItemGuiFlag )
810 
811 
816  enum class AnnotationItemNodeType : int
817  {
818  VertexHandle,
819  };
820  Q_ENUM( AnnotationItemNodeType )
821 
822 
828  {
829  Success,
830  Invalid,
831  ItemCleared,
832  };
833  Q_ENUM( AnnotationItemEditOperationResult )
834 
835 
841  {
842  FixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ModeFixedTemporalRange ) = 0,
843  FeatureDateTimeInstantFromField SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeInstantFromField ),
844  FeatureDateTimeStartAndEndFromFields SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndEndFromFields ),
845  FeatureDateTimeStartAndDurationFromFields SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndDurationFromFields ),
846  FeatureDateTimeStartAndEndFromExpressions SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndEndFromExpressions ),
847  RedrawLayerOnly SIP_MONKEYPATCH_COMPAT_NAME( ModeRedrawLayerOnly ),
848  };
849  Q_ENUM( VectorTemporalMode )
850 
851 
856  enum class VectorTemporalLimitMode : int
857  {
858  IncludeBeginExcludeEnd = 0,
859  IncludeBeginIncludeEnd,
860  };
861  Q_ENUM( VectorTemporalLimitMode )
862 
863 
869  {
870  HasFixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ProviderHasFixedTemporalRange ) = 0,
871  StoresFeatureDateTimeInstantInField SIP_MONKEYPATCH_COMPAT_NAME( ProviderStoresFeatureDateTimeInstantInField ),
872  StoresFeatureDateTimeStartAndEndInSeparateFields SIP_MONKEYPATCH_COMPAT_NAME( ProviderStoresFeatureDateTimeStartAndEndInSeparateFields ),
873  };
874  Q_ENUM( VectorDataProviderTemporalMode )
875 
876 
882  {
883  FixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ModeFixedTemporalRange ) = 0,
884  TemporalRangeFromDataProvider SIP_MONKEYPATCH_COMPAT_NAME( ModeTemporalRangeFromDataProvider ) = 1,
885  RedrawLayerOnly SIP_MONKEYPATCH_COMPAT_NAME( ModeRedrawLayerOnly ) = 2,
886  };
887  Q_ENUM( RasterTemporalMode )
888 
889 
895  {
896  MatchUsingWholeRange,
897  MatchExactUsingStartOfRange,
898  MatchExactUsingEndOfRange,
899  FindClosestMatchToStartOfRange,
900  FindClosestMatchToEndOfRange
901  };
902  Q_ENUM( TemporalIntervalMatchMethod )
903 
904 
910  {
911  Forward SIP_MONKEYPATCH_COMPAT_NAME( ForwardTransform ),
912  Reverse SIP_MONKEYPATCH_COMPAT_NAME( ReverseTransform )
913  };
914  Q_ENUM( TransformDirection )
915 
916 
922  {
923  Antialiasing = 0x01,
924  DrawEditingInfo = 0x02,
925  ForceVectorOutput = 0x04,
926  UseAdvancedEffects = 0x08,
927  DrawLabeling = 0x10,
928  UseRenderingOptimization = 0x20,
929  DrawSelection = 0x40,
930  DrawSymbolBounds = 0x80,
931  RenderMapTile = 0x100,
932  RenderPartialOutput = 0x200,
933  RenderPreviewJob = 0x400,
934  RenderBlocking = 0x800,
935  LosslessImageRendering = 0x1000,
936  Render3DMap = 0x2000,
937  HighQualityImageTransforms = 0x4000,
938  SkipSymbolRendering = 0x8000,
939  };
942  Q_ENUM( MapSettingsFlag )
943 
944 
950  {
951  DrawEditingInfo = 0x01,
952  ForceVectorOutput = 0x02,
953  UseAdvancedEffects = 0x04,
954  UseRenderingOptimization = 0x08,
955  DrawSelection = 0x10,
956  DrawSymbolBounds = 0x20,
957  RenderMapTile = 0x40,
958  Antialiasing = 0x80,
959  RenderPartialOutput = 0x100,
960  RenderPreviewJob = 0x200,
961  RenderBlocking = 0x400,
962  RenderSymbolPreview = 0x800,
963  LosslessImageRendering = 0x1000,
964  ApplyScalingWorkaroundForTextRendering = 0x2000,
965  Render3DMap = 0x4000,
966  ApplyClipAfterReprojection = 0x8000,
967  RenderingSubSymbol = 0x10000,
968  HighQualityImageTransforms = 0x20000,
969  SkipSymbolRendering = 0x40000,
970  };
973  Q_ENUM( RenderContextFlag )
974 
975  // refs for below dox: https://github.com/qgis/QGIS/pull/1286#issuecomment-39806854
976  // https://github.com/qgis/QGIS/pull/8573#issuecomment-445585826
977 
978 
983  {
984  AlwaysOutlines SIP_MONKEYPATCH_COMPAT_NAME( TextFormatAlwaysOutlines ),
985  AlwaysText SIP_MONKEYPATCH_COMPAT_NAME( TextFormatAlwaysText ),
986  };
987  Q_ENUM( TextRenderFormat )
988 
989 
994  enum class RenderSubcomponentProperty : int
995  {
996  Generic,
997  ShadowOffset,
998  BlurSize,
999  GlowSpread,
1000  };
1001  Q_ENUM( RenderSubcomponentProperty )
1002 
1003 
1008  {
1009  Segment SIP_MONKEYPATCH_COMPAT_NAME( SegmentVertex ) = 1,
1010  Curve SIP_MONKEYPATCH_COMPAT_NAME( CurveVertex ) = 2,
1011  };
1012  Q_ENUM( VertexType )
1013 
1014 
1022  {
1023  Square,
1024  Diamond,
1025  Pentagon,
1026  Hexagon,
1027  Triangle,
1028  EquilateralTriangle,
1029  Star,
1030  Arrow,
1031  Circle,
1032  Cross,
1033  CrossFill,
1034  Cross2,
1035  Line,
1036  ArrowHead,
1037  ArrowHeadFilled,
1038  SemiCircle,
1039  ThirdCircle,
1040  QuarterCircle,
1041  QuarterSquare,
1042  HalfSquare,
1043  DiagonalHalfSquare,
1044  RightHalfTriangle,
1045  LeftHalfTriangle,
1046  Octagon,
1047  SquareWithCorners,
1048  AsteriskFill,
1049  HalfArc,
1050  ThirdArc,
1051  QuarterArc,
1052  };
1053  Q_ENUM( MarkerShape )
1054 
1055 
1063  {
1064  Interval = 1 << 0,
1065  Vertex = 1 << 1,
1066  LastVertex = 1 << 2,
1067  FirstVertex = 1 << 3,
1068  CentralPoint = 1 << 4,
1069  CurvePoint = 1 << 5,
1070  SegmentCenter = 1 << 6,
1071  InnerVertices = 1 << 7,
1072  };
1073  Q_ENUM( MarkerLinePlacement )
1074  Q_DECLARE_FLAGS( MarkerLinePlacements, MarkerLinePlacement )
1075  Q_FLAG( MarkerLinePlacements )
1076 
1077 
1085  {
1086  SimpleTwoColor,
1087  ColorRamp,
1088  };
1089  Q_ENUM( GradientColorSource )
1090 
1091 
1099  {
1100  Linear,
1101  Radial,
1102  Conical,
1103  };
1104  Q_ENUM( GradientType )
1105 
1106 
1114  {
1115  Feature,
1116  Viewport,
1117  };
1118  Q_ENUM( SymbolCoordinateReference )
1119 
1120 
1129  {
1130  Pad,
1131  Reflect,
1132  Repeat,
1133  };
1134  Q_ENUM( GradientSpread )
1135 
1136 
1144  {
1145  Absolute SIP_MONKEYPATCH_COMPAT_NAME( AbsoluteCount ),
1146  DensityBased SIP_MONKEYPATCH_COMPAT_NAME( DensityBasedCount ),
1147  };
1148  Q_ENUM( PointCountMethod )
1149 
1150 
1155  enum class MarkerClipMode : int
1156  {
1157  NoClipping,
1158  Shape,
1159  CentroidWithin,
1160  CompletelyWithin,
1161  };
1162  Q_ENUM( MarkerClipMode )
1163 
1164 
1169  enum class LineClipMode : int
1170  {
1171  ClipPainterOnly,
1172  ClipToIntersection,
1173  NoClipping,
1174  };
1175  Q_ENUM( LineClipMode )
1176 
1177 
1182  enum class DashPatternLineEndingRule : int
1183  {
1184  NoRule,
1185  FullDash,
1186  HalfDash,
1187  FullGap,
1188  HalfGap,
1189  };
1190  Q_ENUM( DashPatternLineEndingRule )
1191 
1192 
1197  enum class DashPatternSizeAdjustment : int
1198  {
1199  ScaleBothDashAndGap,
1200  ScaleDashOnly,
1201  ScaleGapOnly,
1202  };
1203  Q_ENUM( DashPatternSizeAdjustment )
1204 
1205 
1206  // NOTE -- the hardcoded numbers here must match QFont::Capitalization!
1207 
1208 
1216  {
1217  MixedCase = 0,
1218  AllUppercase = 1,
1219  AllLowercase = 2,
1220  ForceFirstLetterToCapital = 4,
1221  SmallCaps = 5,
1222  TitleCase = 1004,
1223  UpperCamelCase = 1005,
1224  AllSmallCaps = 1006,
1225  };
1226  Q_ENUM( Capitalization )
1227 
1228 
1233  enum class TextRendererFlag : int
1234  {
1235  WrapLines = 1 << 0,
1236  };
1237  Q_ENUM( TextRendererFlag )
1238  Q_DECLARE_FLAGS( TextRendererFlags, TextRendererFlag )
1239  Q_FLAG( TextRendererFlags )
1240 
1241 
1247  {
1248  Clockwise,
1249  CounterClockwise,
1250  };
1251  Q_ENUM( AngularDirection )
1252 
1253 
1258  enum class RendererUsage : int
1259  {
1260  View,
1261  Export,
1262  Unknown,
1263  };
1264  Q_ENUM( RendererUsage )
1265 
1266 
1271  enum class HistoryProviderBackend : int
1272  {
1273  LocalProfile = 1 << 0,
1274 // Project = 1 << 1, //!< QGIS Project (not yet implemented)
1275  };
1276  Q_ENUM( HistoryProviderBackend )
1277  Q_DECLARE_FLAGS( HistoryProviderBackends, HistoryProviderBackend )
1278  Q_FLAG( HistoryProviderBackends )
1279 
1280 
1286  {
1287  Wkt SIP_MONKEYPATCH_COMPAT_NAME( FormatWkt ),
1288  Proj SIP_MONKEYPATCH_COMPAT_NAME( FormatProj ),
1289  };
1290  Q_ENUM( CrsDefinitionFormat )
1291 
1292 
1296  static const double DEFAULT_SEARCH_RADIUS_MM;
1297 
1299  static const float DEFAULT_MAPTOPIXEL_THRESHOLD;
1300 
1307  static const QColor DEFAULT_HIGHLIGHT_COLOR;
1308 
1313  static const double DEFAULT_HIGHLIGHT_BUFFER_MM;
1314 
1319  static const double DEFAULT_HIGHLIGHT_MIN_WIDTH_MM;
1320 
1327  static const double SCALE_PRECISION;
1328 
1334  static const double DEFAULT_Z_COORDINATE;
1335 
1341  static const double DEFAULT_M_COORDINATE;
1342 
1348  static const double UI_SCALE_FACTOR;
1349 
1354  static const double DEFAULT_SNAP_TOLERANCE;
1355 
1360  static const QgsTolerance::UnitType DEFAULT_SNAP_UNITS;
1361 
1367  static QString defaultProjectScales();
1368 
1374  static int geosVersionInt();
1375 
1381  static int geosVersionMajor();
1382 
1388  static int geosVersionMinor();
1389 
1395  static int geosVersionPatch();
1396 
1402  static QString geosVersion();
1403 };
1404 
1405 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolRenderHints )
1406 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolFlags )
1407 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolPreviewFlags )
1408 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolLayerFlags )
1409 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BrowserItemCapabilities )
1410 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SublayerQueryFlags )
1411 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SublayerFlags )
1412 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SqlLayerDefinitionCapabilities )
1413 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BabelFormatCapabilities )
1414 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BabelCommandFlags )
1415 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::GeometryValidityFlags )
1416 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::FileOperationFlags )
1417 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::AnnotationItemFlags )
1418 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::AnnotationItemGuiFlags )
1419 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MapSettingsFlags )
1420 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::RenderContextFlags )
1421 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::VectorLayerTypeFlags )
1422 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MarkerLinePlacements )
1423 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::TextRendererFlags )
1424 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::HistoryProviderBackends )
1425 
1426 
1427 // hack to workaround warnings when casting void pointers
1428 // retrieved from QLibrary::resolve to function pointers.
1429 // It's assumed that this works on all systems supporting
1430 // QLibrary
1431 #define cast_to_fptr(f) f
1432 
1433 
1442 // based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
1443 template<class Object> class QgsSignalBlocker SIP_SKIP SIP_SKIP // clazy:exclude=rule-of-three
1444 {
1445  public:
1446 
1451  explicit QgsSignalBlocker( Object * object )
1452  : mObject( object )
1453  , mPreviousState( object->blockSignals( true ) )
1454  {}
1455 
1457  {
1458  mObject->blockSignals( mPreviousState );
1459  }
1460 
1462  Object *operator->() { return mObject; }
1463 
1464  private:
1465 
1466  Object *mObject = nullptr;
1467  bool mPreviousState;
1468 
1469 };
1470 
1484 // based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
1485 template<class Object> inline QgsSignalBlocker<Object> whileBlocking( Object *object ) SIP_SKIP SIP_SKIP
1486 {
1487  return QgsSignalBlocker<Object>( object );
1488 }
1489 
1491 CORE_EXPORT uint qHash( const QVariant &variant );
1492 
1498 inline QString qgsDoubleToString( double a, int precision = 17 )
1499 {
1500  QString str = QString::number( a, 'f', precision );
1501  if ( precision )
1502  {
1503  if ( str.contains( QLatin1Char( '.' ) ) )
1504  {
1505  // remove ending 0s
1506  int idx = str.length() - 1;
1507  while ( str.at( idx ) == '0' && idx > 1 )
1508  {
1509  idx--;
1510  }
1511  if ( idx < str.length() - 1 )
1512  str.truncate( str.at( idx ) == '.' ? idx : idx + 1 );
1513  }
1514  }
1515  // avoid printing -0
1516  // see https://bugreports.qt.io/browse/QTBUG-71439
1517  if ( str == QLatin1String( "-0" ) )
1518  {
1519  return QLatin1String( "0" );
1520  }
1521  return str;
1522 }
1523 
1530 inline bool qgsNanCompatibleEquals( double a, double b )
1531 {
1532  const bool aIsNan = std::isnan( a );
1533  const bool bIsNan = std::isnan( b );
1534  if ( aIsNan || bIsNan )
1535  return aIsNan && bIsNan;
1536 
1537  return a == b;
1538 }
1539 
1546 inline bool qgsDoubleNear( double a, double b, double epsilon = 4 * std::numeric_limits<double>::epsilon() )
1547 {
1548  const bool aIsNan = std::isnan( a );
1549  const bool bIsNan = std::isnan( b );
1550  if ( aIsNan || bIsNan )
1551  return aIsNan && bIsNan;
1552 
1553  const double diff = a - b;
1554  return diff > -epsilon && diff <= epsilon;
1555 }
1556 
1563 inline bool qgsFloatNear( float a, float b, float epsilon = 4 * FLT_EPSILON )
1564 {
1565  const bool aIsNan = std::isnan( a );
1566  const bool bIsNan = std::isnan( b );
1567  if ( aIsNan || bIsNan )
1568  return aIsNan && bIsNan;
1569 
1570  const float diff = a - b;
1571  return diff > -epsilon && diff <= epsilon;
1572 }
1573 
1575 inline bool qgsDoubleNearSig( double a, double b, int significantDigits = 10 )
1576 {
1577  const bool aIsNan = std::isnan( a );
1578  const bool bIsNan = std::isnan( b );
1579  if ( aIsNan || bIsNan )
1580  return aIsNan && bIsNan;
1581 
1582  // The most simple would be to print numbers as %.xe and compare as strings
1583  // but that is probably too costly
1584  // Then the fastest would be to set some bits directly, but little/big endian
1585  // has to be considered (maybe TODO)
1586  // Is there a better way?
1587  int aexp, bexp;
1588  const double ar = std::frexp( a, &aexp );
1589  const double br = std::frexp( b, &bexp );
1590 
1591  return aexp == bexp &&
1592  std::round( ar * std::pow( 10.0, significantDigits ) ) == std::round( br * std::pow( 10.0, significantDigits ) );
1593 }
1594 
1600 inline double qgsRound( double number, int places )
1601 {
1602  const double m = ( number < 0.0 ) ? -1.0 : 1.0;
1603  const double scaleFactor = std::pow( 10.0, places );
1604  return ( std::round( number * m * scaleFactor ) / scaleFactor ) * m;
1605 }
1606 
1607 
1608 #ifndef SIP_RUN
1609 
1611 
1621 namespace qgis
1622 {
1623 
1636  template<typename To, typename From> inline To down_cast( From *f )
1637  {
1638  static_assert(
1639  ( std::is_base_of<From,
1640  typename std::remove_pointer<To>::type>::value ),
1641  "target type not derived from source type" );
1642  Q_ASSERT( f == nullptr || dynamic_cast<To>( f ) != nullptr );
1643  return static_cast<To>( f );
1644  }
1645 
1646  template<class T>
1647  QSet<T> listToSet( const QList<T> &list )
1648  {
1649 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
1650  return list.toSet();
1651 #else
1652  return QSet<T>( list.begin(), list.end() );
1653 #endif
1654  }
1655 
1656  template<class T>
1657  QList<T> setToList( const QSet<T> &set )
1658  {
1659 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
1660  return set.toList();
1661 #else
1662  return QList<T>( set.begin(), set.end() );
1663 #endif
1664  }
1665 }
1666 
1667 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
1668 namespace std
1669 {
1670  template<> struct hash<QString>
1671  {
1672  std::size_t operator()( const QString &s ) const noexcept
1673  {
1674  return ( size_t ) qHash( s );
1675  }
1676  };
1677 }
1678 #endif
1679 
1681 #endif
1682 
1688 template<class T> const QMap<T, QString> qgsEnumMap() SIP_SKIP
1689 {
1690  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
1691  Q_ASSERT( metaEnum.isValid() );
1692  QMap<T, QString> enumMap;
1693  for ( int idx = 0; idx < metaEnum.keyCount(); ++idx )
1694  {
1695  const char *enumKey = metaEnum.key( idx );
1696  enumMap.insert( static_cast<T>( metaEnum.keyToValue( enumKey ) ), QString( enumKey ) );
1697  }
1698  return enumMap;
1699 }
1700 
1705 template<class T> QString qgsEnumValueToKey( const T &value ) SIP_SKIP
1706 {
1707  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
1708  Q_ASSERT( metaEnum.isValid() );
1709  return QString::fromUtf8( metaEnum.valueToKey( static_cast<int>( value ) ) );
1710 }
1711 
1718 template<class T> T qgsEnumKeyToValue( const QString &key, const T &defaultValue, bool tryValueAsKey = true ) SIP_SKIP
1719 {
1720  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
1721  Q_ASSERT( metaEnum.isValid() );
1722  bool ok = false;
1723  T v = static_cast<T>( metaEnum.keyToValue( key.toUtf8().data(), &ok ) );
1724  if ( ok )
1725  {
1726  return v;
1727  }
1728  else
1729  {
1730  // if conversion has failed, try with conversion from int value
1731  if ( tryValueAsKey )
1732  {
1733  bool canConvert = false;
1734  const int intValue = key.toInt( &canConvert );
1735  if ( canConvert && metaEnum.valueToKey( intValue ) )
1736  {
1737  return static_cast<T>( intValue );
1738  }
1739  }
1740  }
1741  return defaultValue;
1742 }
1743 
1748 template<class T> QString qgsFlagValueToKeys( const T &value ) SIP_SKIP
1749 {
1750  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
1751  Q_ASSERT( metaEnum.isValid() );
1752  return QString::fromUtf8( metaEnum.valueToKeys( static_cast<int>( value ) ) );
1753 }
1754 
1760 template<class T> T qgsFlagKeysToValue( const QString &keys, const T &defaultValue ) SIP_SKIP
1761 {
1762  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
1763  Q_ASSERT( metaEnum.isValid() );
1764  bool ok = false;
1765  T v = static_cast<T>( metaEnum.keysToValue( keys.toUtf8().constData(), &ok ) );
1766  if ( ok )
1767  return v;
1768  else
1769  return defaultValue;
1770 }
1771 
1772 
1782 CORE_EXPORT double qgsPermissiveToDouble( QString string, bool &ok );
1783 
1793 CORE_EXPORT int qgsPermissiveToInt( QString string, bool &ok );
1794 
1804 CORE_EXPORT qlonglong qgsPermissiveToLongLong( QString string, bool &ok );
1805 
1815 CORE_EXPORT bool qgsVariantLessThan( const QVariant &lhs, const QVariant &rhs );
1816 
1825 CORE_EXPORT bool qgsVariantEqual( const QVariant &lhs, const QVariant &rhs );
1826 
1833 CORE_EXPORT bool qgsVariantGreaterThan( const QVariant &lhs, const QVariant &rhs );
1834 
1835 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1836 
1843 inline bool operator> ( const QVariant &v1, const QVariant &v2 )
1844 {
1845  return qgsVariantGreaterThan( v1, v2 );
1846 }
1847 
1857 inline bool operator< ( const QVariant &v1, const QVariant &v2 )
1858 {
1859  return qgsVariantLessThan( v1, v2 );
1860 }
1861 #endif
1862 
1863 
1864 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
1865 
1869 template<> CORE_EXPORT bool qMapLessThanKey<QVariantList>( const QVariantList &key1, const QVariantList &key2 ) SIP_SKIP;
1870 #endif
1871 
1872 CORE_EXPORT QString qgsVsiPrefix( const QString &path );
1873 
1879 void CORE_EXPORT *qgsMalloc( size_t size ) SIP_SKIP;
1880 
1888 void CORE_EXPORT *qgsCalloc( size_t nmemb, size_t size ) SIP_SKIP;
1889 
1894 void CORE_EXPORT qgsFree( void *ptr ) SIP_SKIP;
1895 
1896 #ifndef SIP_RUN
1897 
1898 #ifdef _MSC_VER
1899 #define CONSTLATIN1STRING inline const QLatin1String
1900 #else
1901 #define CONSTLATIN1STRING constexpr QLatin1String
1902 #endif
1903 
1905 class ScopedIntIncrementor
1906 {
1907  public:
1908 
1909  ScopedIntIncrementor( int *variable )
1910  : mVariable( variable )
1911  {
1912  ( *mVariable )++;
1913  }
1914 
1915  ScopedIntIncrementor( const ScopedIntIncrementor &other ) = delete;
1916  ScopedIntIncrementor &operator=( const ScopedIntIncrementor &other ) = delete;
1917 
1918  void release()
1919  {
1920  if ( mVariable )
1921  ( *mVariable )--;
1922 
1923  mVariable = nullptr;
1924  }
1925 
1926  ~ScopedIntIncrementor()
1927  {
1928  release();
1929  }
1930 
1931  private:
1932  int *mVariable = nullptr;
1933 };
1935 
1941 {
1942  return QLatin1String(
1943  R"""(GEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["unknown"],AREA["World"],BBOX[-90,-180,90,180]],ID["EPSG",4326]] )"""
1944  );
1945 }
1946 
1949 {
1950  return QLatin1String( "+proj=longlat +datum=WGS84 +no_defs" );
1951 }
1952 
1955 {
1956  return QLatin1String( "EPSG:4326" );
1957 }
1958 
1961 {
1962  return QLatin1String( "NONE" );
1963 }
1964 
1966 
1968 const int PREVIEW_JOB_DELAY_MS = 250;
1969 
1971 const int MAXIMUM_LAYER_PREVIEW_TIME_MS = 250;
1972 
1974 
1975 #endif
1976 
1978 const long GEOSRID = 4326;
1979 
1981 const long GEOCRS_ID = 3452;
1982 
1984 const long GEO_EPSG_CRS_ID = 4326;
1985 
1990 const int USER_CRS_START_ID = 100000;
1991 
1992 //
1993 // Constants for point symbols
1994 //
1995 
1997 const double DEFAULT_POINT_SIZE = 2.0;
1998 const double DEFAULT_LINE_WIDTH = 0.26;
1999 
2001 const double DEFAULT_SEGMENT_EPSILON = 1e-8;
2002 
2003 typedef QMap<QString, QString> QgsStringMap SIP_SKIP;
2004 
2013 typedef unsigned long long qgssize;
2014 
2015 #ifndef SIP_RUN
2016 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
2017 
2018 #define Q_NOWARN_DEPRECATED_PUSH \
2019  _Pragma("GCC diagnostic push") \
2020  _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
2021 #define Q_NOWARN_DEPRECATED_POP \
2022  _Pragma("GCC diagnostic pop");
2023 #define Q_NOWARN_UNREACHABLE_PUSH
2024 #define Q_NOWARN_UNREACHABLE_POP
2025 
2026 #elif defined(_MSC_VER)
2027 
2028 #define Q_NOWARN_DEPRECATED_PUSH \
2029  __pragma(warning(push)) \
2030  __pragma(warning(disable:4996))
2031 #define Q_NOWARN_DEPRECATED_POP \
2032  __pragma(warning(pop))
2033 #define Q_NOWARN_UNREACHABLE_PUSH \
2034  __pragma(warning(push)) \
2035  __pragma(warning(disable:4702))
2036 #define Q_NOWARN_UNREACHABLE_POP \
2037  __pragma(warning(pop))
2038 
2039 #else
2040 
2041 #define Q_NOWARN_DEPRECATED_PUSH
2042 #define Q_NOWARN_DEPRECATED_POP
2043 #define Q_NOWARN_UNREACHABLE_PUSH
2044 #define Q_NOWARN_UNREACHABLE_POP
2045 
2046 #endif
2047 #endif
2048 
2049 #ifndef QGISEXTERN
2050 #ifdef Q_OS_WIN
2051 # define QGISEXTERN extern "C" __declspec( dllexport )
2052 #else
2053 # if defined(__GNUC__) || defined(__clang__)
2054 # define QGISEXTERN extern "C" __attribute__ ((visibility ("default")))
2055 # else
2056 # define QGISEXTERN extern "C"
2057 # endif
2058 #endif
2059 #endif
2060 #endif
2061 
2062 #if __cplusplus >= 201500
2063 #define FALLTHROUGH [[fallthrough]];
2064 #elif defined(__clang__)
2065 #define FALLTHROUGH [[clang::fallthrough]];
2066 #elif defined(__GNUC__) && __GNUC__ >= 7
2067 #define FALLTHROUGH [[gnu::fallthrough]];
2068 #else
2069 #define FALLTHROUGH
2070 #endif
2071 
2072 // see https://infektor.net/posts/2017-01-19-using-cpp17-attributes-today.html#using-the-nodiscard-attribute
2073 #if __cplusplus >= 201703L
2074 #define NODISCARD [[nodiscard]]
2075 #elif defined(__clang__)
2076 #define NODISCARD [[nodiscard]]
2077 #elif defined(_MSC_VER)
2078 #define NODISCARD // no support
2079 #elif defined(__has_cpp_attribute)
2080 #if __has_cpp_attribute(nodiscard)
2081 #define NODISCARD [[nodiscard]]
2082 #elif __has_cpp_attribute(gnu::warn_unused_result)
2083 #define NODISCARD [[gnu::warn_unused_result]]
2084 #else
2085 #define NODISCARD Q_REQUIRED_RESULT
2086 #endif
2087 #else
2088 #define NODISCARD Q_REQUIRED_RESULT
2089 #endif
2090 
2091 #if __cplusplus >= 201703L
2092 #define MAYBE_UNUSED [[maybe_unused]]
2093 #elif defined(__clang__)
2094 #define MAYBE_UNUSED [[maybe_unused]]
2095 #elif defined(_MSC_VER)
2096 #define MAYBE_UNUSED // no support
2097 #elif defined(__has_cpp_attribute)
2098 #if __has_cpp_attribute(gnu::unused)
2099 #define MAYBE_UNUSED [[gnu::unused]]
2100 #else
2101 #define MAYBE_UNUSED
2102 #endif
2103 #else
2104 #define MAYBE_UNUSED
2105 #endif
2106 
2107 #ifndef FINAL
2108 #define FINAL final
2109 #endif
2110 
2111 #ifndef SIP_RUN
2112 #ifdef _MSC_VER
2113 #define BUILTIN_UNREACHABLE \
2114  __assume(false);
2115 #elif defined(__GNUC__) && !defined(__clang__)
2116 // Workaround a GCC bug where a -Wreturn-type warning is emitted in constructs
2117 // like:
2118 // switch( mVariableThatCanOnlyBeXorY )
2119 // {
2120 // case X:
2121 // return "foo";
2122 // case Y:
2123 // return "foo";
2124 // }
2125 // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
2126 #define BUILTIN_UNREACHABLE \
2127  __builtin_unreachable();
2128 #else
2129 #define BUILTIN_UNREACHABLE
2130 #endif
2131 #endif // SIP_RUN
2132 
2133 #ifdef SIP_RUN
2134 
2139 QString CORE_EXPORT geoWkt();
2140 
2142 QString CORE_EXPORT geoProj4();
2143 
2145 QString CORE_EXPORT geoEpsgCrsAuthId();
2146 
2148 QString CORE_EXPORT geoNone();
2149 
2150 #endif
The Qgis class provides global constants for use throughout the application.
Definition: qgis.h:64
GeometryValidityFlag
Geometry validity check flags.
Definition: qgis.h:689
MapLayerProperty
File operation flags.
Definition: qgis.h:778
BufferSide
Side of line to buffer.
Definition: qgis.h:713
RasterResamplingStage
Stage at which raster resampling occurs.
Definition: qgis.h:502
VectorTemporalMode
Vector layer temporal feature modes.
Definition: qgis.h:841
SublayerFlag
Sublayer query flags.
Definition: qgis.h:472
DashPatternSizeAdjustment
Dash pattern size adjustment options.
Definition: qgis.h:1198
AnnotationItemNodeType
Annotation item GUI flags.
Definition: qgis.h:817
static const char * QGIS_DEV_VERSION
The development version.
Definition: qgis.h:90
AngularDirection
Angular directions.
Definition: qgis.h:1247
DriveType
Drive types.
Definition: qgis.h:416
ContentStatus
Status for fetched or stored content.
Definition: qgis.h:600
MarkerLinePlacement
Defines how/where the symbols should be placed on a line.
Definition: qgis.h:1063
GeometryOperationResult
Success or failure of a geometry operation.
Definition: qgis.h:661
BrowserItemState
Browser item states.
Definition: qgis.h:281
MarkerClipMode
Marker clipping modes.
Definition: qgis.h:1156
AnnotationItemFlag
Map layer properties.
Definition: qgis.h:791
RenderSubcomponentProperty
Rendering subcomponent properties.
Definition: qgis.h:995
SymbolRenderHint
Flags controlling behavior of symbols during rendering.
Definition: qgis.h:209
BrowserItemCapability
Browser item capabilities.
Definition: qgis.h:294
LineClipMode
Line clipping modes.
Definition: qgis.h:1170
BrowserDirectoryMonitoring
Browser directory item monitoring switches.
Definition: qgis.h:337
GradientColorSource
Gradient color sources.
Definition: qgis.h:1085
VectorExportResult
Vector layer export result codes.
Definition: qgis.h:361
SymbolLayerFlag
Flags controlling behavior of symbol layers.
Definition: qgis.h:249
GradientSpread
Gradient spread options, which control how gradients are rendered outside of their start and end poin...
Definition: qgis.h:1129
ScaleMethod
Scale methods.
Definition: qgis.h:197
FilePathType
File path types.
Definition: qgis.h:533
PointCountMethod
Methods which define the number of points randomly filling a polygon.
Definition: qgis.h:1144
VertexType
Types of vertex.
Definition: qgis.h:1008
GeometryValidationEngine
Available engines for validating geometries.
Definition: qgis.h:701
FileOperationFlag
File operation flags.
Definition: qgis.h:764
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition: qgis.h:107
SqlKeywordCategory
SQL layer definition capabilities.
Definition: qgis.h:398
MeshEditingErrorType
Type of error that can occur during mesh frame editing.
Definition: qgis.h:516
AnnotationItemEditOperationResult
Results from an edit operation on an annotation item.
Definition: qgis.h:828
ActionStart
Enum to determine when an operation would begin.
Definition: qgis.h:432
MarkerShape
Marker shapes.
Definition: qgis.h:1022
Capitalization
String capitalization options.
Definition: qgis.h:1216
TemporalIntervalMatchMethod
Method to use when resolving a temporal range to a data provider layer or band.
Definition: qgis.h:895
SublayerQueryFlag
Flags which control how data providers will scan for sublayers in a dataset.
Definition: qgis.h:456
PythonMacroMode
Vector layer type flags.
Definition: qgis.h:157
UnplacedLabelVisibility
Unplaced label visibility.
Definition: qgis.h:444
CrsDefinitionFormat
CRS definition formats.
Definition: qgis.h:1286
SpatialFilterType
Feature request spatial filter types.
Definition: qgis.h:751
BrowserItemType
Symbol layer flags.
Definition: qgis.h:262
RasterTemporalMode
Raster layer temporal modes.
Definition: qgis.h:882
JoinStyle
Join styles for buffers.
Definition: qgis.h:738
BrowserLayerType
Browser item layer types.
Definition: qgis.h:314
VectorDataProviderTemporalMode
Vector data provider temporal handling modes.
Definition: qgis.h:869
TextRenderFormat
Options for rendering text.
Definition: qgis.h:983
DataType
Raster data types.
Definition: qgis.h:121
Q_DECLARE_FLAGS(RenderContextFlags, RenderContextFlag) SIP_MONKEYPATCH_FLAGS_UNNEST(QgsRenderContext
Render context flags.
EndCapStyle
End cap styles for buffers.
Definition: qgis.h:725
BabelCommandFlag
Babel GPS format capabilities.
Definition: qgis.h:633
RenderContextFlag
Flags which affect rendering operations.
Definition: qgis.h:950
RasterPipeInterfaceRole
Sublayer flags.
Definition: qgis.h:485
SymbolPreviewFlag
Symbol flags.
Definition: qgis.h:236
AnnotationItemGuiFlag
Annotation item flags.
Definition: qgis.h:804
DashPatternLineEndingRule
Dash pattern line ending rules.
Definition: qgis.h:1183
VertexMarkerType
Editing vertex markers, used for showing vertices during a edit operation.
Definition: qgis.h:588
HistoryProviderBackend
History provider backends.
Definition: qgis.h:1272
SublayerPromptMode
Specifies how to handle layer sources with multiple sublayers.
Definition: qgis.h:545
GradientType
Gradient types.
Definition: qgis.h:1099
GpsFeatureType
Babel command flags.
Definition: qgis.h:646
VectorLayerTypeFlag
Vector layer type flags.
Definition: qgis.h:145
VectorTemporalLimitMode
Mode for the handling of the limits of the filtering timeframe for vector features.
Definition: qgis.h:857
SqlLayerDefinitionCapability
SqlLayerDefinitionCapability enum lists the arguments supported by the provider when creating SQL que...
Definition: qgis.h:382
VectorEditResult
Specifies the result of a vector layer edit operation.
Definition: qgis.h:573
Q_DECLARE_FLAGS(GeometryValidityFlags, GeometryValidityFlag) SIP_MONKEYPATCH_FLAGS_UNNEST(QgsGeometry
Geometry validity flags.
SymbolType
Symbol types.
Definition: qgis.h:183
RendererUsage
Usage of the renderer.
Definition: qgis.h:1259
BabelFormatCapability
Babel GPS format capabilities.
Definition: qgis.h:615
SymbolFlag
Flags controlling behavior of symbols.
Definition: qgis.h:223
HttpMethod
Different methods of HTTP requests.
Definition: qgis.h:349
SymbolCoordinateReference
Symbol coordinate reference modes.
Definition: qgis.h:1114
TextRendererFlag
Flags which control the behavior of rendering text.
Definition: qgis.h:1234
TransformDirection
Indicates the direction (forward or inverse) of a transform.
Definition: qgis.h:910
Q_DECLARE_FLAGS(MapSettingsFlags, MapSettingsFlag) SIP_MONKEYPATCH_FLAGS_UNNEST(QgsMapSettings
Map settings flags.
MapSettingsFlag
Flags which adjust the way maps are rendered.
Definition: qgis.h:922
SelectBehavior
Specifies how a selection should be applied.
Definition: qgis.h:559
This class represents a coordinate reference system (CRS).
Class for doing transforms between two map coordinate systems.
Abstract base class for curved geometry type.
Definition: qgscurve.h:36
Base class for all items in the model.
Definition: qgsdataitem.h:46
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:125
Item that represents a layer that can be opened with one of the providers.
Definition: qgslayeritem.h:30
Base class for all map layer types.
Definition: qgsmaplayer.h:73
The QgsMapSettings class contains configuration for rendering of the map.
Registry for temporary fetched files.
A fill symbol layer which places markers at random locations within polygons.
Implementation of data provider temporal properties for QgsRasterDataProviders.
Implementation of map layer temporal properties for raster layers.
Contains a pipeline of raster interfaces for sequential raster processing.
Definition: qgsrasterpipe.h:50
Contains information about the context of a rendering operation.
RAII signal blocking class.
Definition: qgis.h:1444
~QgsSignalBlocker()
Definition: qgis.h:1456
QgsSignalBlocker(Object *object)
Constructor for QgsSignalBlocker.
Definition: qgis.h:1451
Object * operator->()
Returns pointer to blocked QObject.
Definition: qgis.h:1462
Abstract base class for simple marker symbol layers.
Utility functions for working with strings.
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:38
Base class for templated line symbols, e.g.
This is the class is providing tolerance value in map unit values.
Definition: qgstolerance.h:33
Implementation of data provider temporal properties for QgsVectorDataProviders.
This is the base class for vector data providers.
A convenience class for exporting vector layers to a destination data provider.
Implementation of map layer temporal properties for vector layers.
Represents a vector layer which manages a vector based data sets.
FeatureCountState
Enumeration of feature count states.
Definition: qgis.h:172
QgsMapLayerType
Types of layers that can be added to a map.
Definition: qgis.h:47
@ PointCloudLayer
Point cloud layer. Added in QGIS 3.18.
@ MeshLayer
Mesh layer. Added in QGIS 3.2.
@ VectorLayer
Vector layer.
@ RasterLayer
Raster layer.
@ GroupLayer
Composite group layer. Added in QGIS 3.24.
@ VectorTileLayer
Vector tile layer. Added in QGIS 3.14.
@ AnnotationLayer
Contains freeform, georeferenced annotations. Added in QGIS 3.16.
@ PluginLayer
Plugin based layer.
int significantDigits(const Qgis::DataType rasterDataType)
Returns the maximum number of significant digits a for the given rasterDataType.
#define str(x)
Definition: qgis.cpp:37
CONSTLATIN1STRING geoNone()
Constant that holds the string representation for "No ellips/No CRS".
Definition: qgis.h:1960
const double DEFAULT_LINE_WIDTH
Definition: qgis.h:1998
CORE_EXPORT uint qHash(const QVariant &variant)
Hash for QVariant.
Definition: qgis.cpp:225
bool operator>(const QVariant &v1, const QVariant &v2)
Compares two QVariant values and returns whether the first is greater than the second.
Definition: qgis.h:1843
void CORE_EXPORT * qgsCalloc(size_t nmemb, size_t size)
Allocates memory for an array of nmemb elements of size bytes each and returns a pointer to the alloc...
Definition: qgis.cpp:107
CORE_EXPORT QString qgsVsiPrefix(const QString &path)
Definition: qgis.cpp:200
CORE_EXPORT bool qgsVariantEqual(const QVariant &lhs, const QVariant &rhs)
Compares two QVariant values and returns whether they are equal, two NULL values are always treated a...
Definition: qgis.cpp:274
void CORE_EXPORT * qgsMalloc(size_t size)
Allocates size bytes and returns a pointer to the allocated memory.
Definition: qgis.cpp:92
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
Definition: qgis.h:1498
QString qgsEnumValueToKey(const T &value)
Returns the value for the given key of an enum.
Definition: qgis.h:1705
const QMap< T, QString > qgsEnumMap()
Returns a map of all enum entries.
Definition: qgis.h:1688
const long GEO_EPSG_CRS_ID
Magic number for a geographic coord sys in EpsgCrsId ID format.
Definition: qgis.h:1984
CORE_EXPORT bool qgsVariantGreaterThan(const QVariant &lhs, const QVariant &rhs)
Compares two QVariant values and returns whether the first is greater than the second.
Definition: qgis.cpp:195
unsigned long long qgssize
Qgssize is used instead of size_t, because size_t is stdlib type, unknown by SIP, and it would be har...
Definition: qgis.h:2013
bool qgsFloatNear(float a, float b, float epsilon=4 *FLT_EPSILON)
Compare two floats (but allow some difference)
Definition: qgis.h:1563
CORE_EXPORT double qgsPermissiveToDouble(QString string, bool &ok)
Converts a string to a double in a permissive way, e.g., allowing for incorrect numbers of digits bet...
Definition: qgis.cpp:71
double qgsRound(double number, int places)
Returns a double number, rounded (as close as possible) to the specified number of places.
Definition: qgis.h:1600
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
Definition: qgis.h:1546
CONSTLATIN1STRING geoProj4()
PROJ4 string that represents a geographic coord sys.
Definition: qgis.h:1948
T qgsFlagKeysToValue(const QString &keys, const T &defaultValue)
Returns the value corresponding to the given keys of a flag.
Definition: qgis.h:1760
bool qgsNanCompatibleEquals(double a, double b)
Compare two doubles, treating nan values as equal.
Definition: qgis.h:1530
const double DEFAULT_SEGMENT_EPSILON
Default snapping tolerance for segments.
Definition: qgis.h:2001
QMap< QString, QString > QgsStringMap
Definition: qgis.h:2003
#define CONSTLATIN1STRING
Definition: qgis.h:1901
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition: qgis.h:1485
CONSTLATIN1STRING geoWkt()
Wkt string that represents a geographic coord sys.
Definition: qgis.h:1940
bool qgsDoubleNearSig(double a, double b, int significantDigits=10)
Compare two doubles using specified number of significant digits.
Definition: qgis.h:1575
const int USER_CRS_START_ID
Magick number that determines whether a projection crsid is a system (srs.db) or user (~/....
Definition: qgis.h:1990
QString qgsFlagValueToKeys(const T &value)
Returns the value for the given keys of a flag.
Definition: qgis.h:1748
void CORE_EXPORT qgsFree(void *ptr)
Frees the memory space pointed to by ptr.
Definition: qgis.cpp:122
CORE_EXPORT qlonglong qgsPermissiveToLongLong(QString string, bool &ok)
Converts a string to an qlonglong in a permissive way, e.g., allowing for incorrect numbers of digits...
Definition: qgis.cpp:85
CORE_EXPORT int qgsPermissiveToInt(QString string, bool &ok)
Converts a string to an integer in a permissive way, e.g., allowing for incorrect numbers of digits b...
Definition: qgis.cpp:78
CORE_EXPORT bool qgsVariantLessThan(const QVariant &lhs, const QVariant &rhs)
Compares two QVariant values and returns whether the first is less than the second.
Definition: qgis.cpp:127
const long GEOSRID
Magic number for a geographic coord sys in POSTGIS SRID.
Definition: qgis.h:1978
bool operator<(const QVariant &v1, const QVariant &v2)
Compares two QVariant values and returns whether the first is less than the second.
Definition: qgis.h:1857
CONSTLATIN1STRING geoEpsgCrsAuthId()
Geographic coord sys from EPSG authority.
Definition: qgis.h:1954
const long GEOCRS_ID
Magic number for a geographic coord sys in QGIS srs.db tbl_srs.srs_id.
Definition: qgis.h:1981
T qgsEnumKeyToValue(const QString &key, const T &defaultValue, bool tryValueAsKey=true)
Returns the value corresponding to the given key of an enum.
Definition: qgis.h:1718
const double DEFAULT_POINT_SIZE
Magic number that determines the default point size for point symbols.
Definition: qgis.h:1997
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition: qgis_sip.h:257
#define SIP_MONKEYPATCH_FLAGS_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition: qgis_sip.h:258
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)
Definition: qgis_sip.h:259
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
int precision
Utility class for identifying a unique vertex within a geometry.
Definition: qgsvertexid.h:31