QGIS API Documentation  3.24.2-Tisler (13c1a02865)
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 
615  {
616  Unknown = -1,
617  Invalid,
618  GPS,
619  DGPS,
620  PPS,
621  RTK,
622  FloatRTK,
623  Estimated,
624  Manual,
625  Simulation,
626  };
627  Q_ENUM( GpsQualityIndicator )
628 
629 
634  enum class BabelFormatCapability : int
635  {
636  Import = 1 << 0,
637  Export = 1 << 1,
638  Waypoints = 1 << 2,
639  Routes = 1 << 3,
640  Tracks = 1 << 4,
641  };
643  Q_DECLARE_FLAGS( BabelFormatCapabilities, BabelFormatCapability )
644  Q_ENUM( BabelFormatCapability )
645 
646 
652  enum class BabelCommandFlag : int
653  {
654  QuoteFilePaths = 1 << 0,
655  };
657  Q_DECLARE_FLAGS( BabelCommandFlags, BabelCommandFlag )
658  Q_ENUM( BabelCommandFlag )
659 
660 
665  enum class GpsFeatureType : int
666  {
667  Waypoint,
668  Route,
669  Track,
670  };
671  Q_ENUM( GpsFeatureType )
672 
673 
681  {
682  Success = 0,
683  NothingHappened = 1000,
684  InvalidBaseGeometry,
685  InvalidInputGeometryType,
686  SelectionIsEmpty,
687  SelectionIsGreaterThanOne,
688  GeometryEngineError,
689  LayerNotEditable,
690  /* Add part issues */
691  AddPartSelectedGeometryNotFound,
692  AddPartNotMultiGeometry,
693  /* Add ring issues*/
694  AddRingNotClosed,
695  AddRingNotValid,
696  AddRingCrossesExistingRings,
697  AddRingNotInExistingFeature,
698  /* Split features */
699  SplitCannotSplitPoint,
700  };
701  Q_ENUM( GeometryOperationResult )
702 
703 
709  {
710  AllowSelfTouchingHoles SIP_MONKEYPATCH_COMPAT_NAME( FlagAllowSelfTouchingHoles ) = 1 << 0,
711  };
714  Q_ENUM( GeometryValidityFlag )
715 
716 
721  {
722  QgisInternal SIP_MONKEYPATCH_COMPAT_NAME( ValidatorQgisInternal ),
723  Geos SIP_MONKEYPATCH_COMPAT_NAME( ValidatorGeos ),
724  };
725  Q_ENUM( GeometryValidationEngine )
726 
727 
733  {
734  Left SIP_MONKEYPATCH_COMPAT_NAME( SideLeft ) = 0,
735  Right SIP_MONKEYPATCH_COMPAT_NAME( SideRight ),
736  };
737  Q_ENUM( BufferSide )
738 
739 
745  {
746  Round SIP_MONKEYPATCH_COMPAT_NAME( CapRound ) = 1,
747  Flat SIP_MONKEYPATCH_COMPAT_NAME( CapFlat ),
748  Square SIP_MONKEYPATCH_COMPAT_NAME( CapSquare ),
749  };
750  Q_ENUM( EndCapStyle )
751 
752 
758  {
759  Round SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleRound ) = 1,
760  Miter SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleMiter ),
761  Bevel SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleBevel ),
762  };
763  Q_ENUM( JoinStyle )
764 
765 
770  enum class SpatialFilterType : int
771  {
772  NoFilter,
773  BoundingBox,
774  DistanceWithin,
775  };
776  Q_ENUM( SpatialFilterType )
777 
778 
783  enum class FileOperationFlag : int
784  {
785  IncludeMetadataFile = 1 << 0,
786  IncludeStyleFile = 1 << 1,
787  };
789  Q_DECLARE_FLAGS( FileOperationFlags, FileOperationFlag )
790  Q_ENUM( FileOperationFlag )
791 
792 
797  enum class MapLayerProperty : int
798  {
799  UsersCannotToggleEditing = 1 << 0,
800  };
802  Q_DECLARE_FLAGS( MapLayerProperties, MapLayerProperty )
803  Q_ENUM( MapLayerProperty )
804 
805 
810  enum class AnnotationItemFlag : int
811  {
812  ScaleDependentBoundingBox = 1 << 0,
813  };
815  Q_DECLARE_FLAGS( AnnotationItemFlags, AnnotationItemFlag )
816  Q_ENUM( AnnotationItemFlag )
817 
818 
823  enum class AnnotationItemGuiFlag : int
824  {
825  FlagNoCreationTools = 1 << 0,
826  };
828  Q_DECLARE_FLAGS( AnnotationItemGuiFlags, AnnotationItemGuiFlag )
829  Q_ENUM( AnnotationItemGuiFlag )
830 
831 
836  enum class AnnotationItemNodeType : int
837  {
838  VertexHandle,
839  };
840  Q_ENUM( AnnotationItemNodeType )
841 
842 
848  {
849  Success,
850  Invalid,
851  ItemCleared,
852  };
853  Q_ENUM( AnnotationItemEditOperationResult )
854 
855 
861  {
862  FixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ModeFixedTemporalRange ) = 0,
863  FeatureDateTimeInstantFromField SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeInstantFromField ),
864  FeatureDateTimeStartAndEndFromFields SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndEndFromFields ),
865  FeatureDateTimeStartAndDurationFromFields SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndDurationFromFields ),
866  FeatureDateTimeStartAndEndFromExpressions SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndEndFromExpressions ),
867  RedrawLayerOnly SIP_MONKEYPATCH_COMPAT_NAME( ModeRedrawLayerOnly ),
868  };
869  Q_ENUM( VectorTemporalMode )
870 
871 
876  enum class VectorTemporalLimitMode : int
877  {
878  IncludeBeginExcludeEnd = 0,
879  IncludeBeginIncludeEnd,
880  };
881  Q_ENUM( VectorTemporalLimitMode )
882 
883 
889  {
890  HasFixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ProviderHasFixedTemporalRange ) = 0,
891  StoresFeatureDateTimeInstantInField SIP_MONKEYPATCH_COMPAT_NAME( ProviderStoresFeatureDateTimeInstantInField ),
892  StoresFeatureDateTimeStartAndEndInSeparateFields SIP_MONKEYPATCH_COMPAT_NAME( ProviderStoresFeatureDateTimeStartAndEndInSeparateFields ),
893  };
894  Q_ENUM( VectorDataProviderTemporalMode )
895 
896 
902  {
903  FixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ModeFixedTemporalRange ) = 0,
904  TemporalRangeFromDataProvider SIP_MONKEYPATCH_COMPAT_NAME( ModeTemporalRangeFromDataProvider ) = 1,
905  RedrawLayerOnly SIP_MONKEYPATCH_COMPAT_NAME( ModeRedrawLayerOnly ) = 2,
906  };
907  Q_ENUM( RasterTemporalMode )
908 
909 
915  {
916  MatchUsingWholeRange,
917  MatchExactUsingStartOfRange,
918  MatchExactUsingEndOfRange,
919  FindClosestMatchToStartOfRange,
920  FindClosestMatchToEndOfRange
921  };
922  Q_ENUM( TemporalIntervalMatchMethod )
923 
924 
930  {
931  Forward SIP_MONKEYPATCH_COMPAT_NAME( ForwardTransform ),
932  Reverse SIP_MONKEYPATCH_COMPAT_NAME( ReverseTransform )
933  };
934  Q_ENUM( TransformDirection )
935 
936 
942  {
943  Antialiasing = 0x01,
944  DrawEditingInfo = 0x02,
945  ForceVectorOutput = 0x04,
946  UseAdvancedEffects = 0x08,
947  DrawLabeling = 0x10,
948  UseRenderingOptimization = 0x20,
949  DrawSelection = 0x40,
950  DrawSymbolBounds = 0x80,
951  RenderMapTile = 0x100,
952  RenderPartialOutput = 0x200,
953  RenderPreviewJob = 0x400,
954  RenderBlocking = 0x800,
955  LosslessImageRendering = 0x1000,
956  Render3DMap = 0x2000,
957  HighQualityImageTransforms = 0x4000,
958  SkipSymbolRendering = 0x8000,
959  };
962  Q_ENUM( MapSettingsFlag )
963 
964 
970  {
971  DrawEditingInfo = 0x01,
972  ForceVectorOutput = 0x02,
973  UseAdvancedEffects = 0x04,
974  UseRenderingOptimization = 0x08,
975  DrawSelection = 0x10,
976  DrawSymbolBounds = 0x20,
977  RenderMapTile = 0x40,
978  Antialiasing = 0x80,
979  RenderPartialOutput = 0x100,
980  RenderPreviewJob = 0x200,
981  RenderBlocking = 0x400,
982  RenderSymbolPreview = 0x800,
983  LosslessImageRendering = 0x1000,
984  ApplyScalingWorkaroundForTextRendering = 0x2000,
985  Render3DMap = 0x4000,
986  ApplyClipAfterReprojection = 0x8000,
987  RenderingSubSymbol = 0x10000,
988  HighQualityImageTransforms = 0x20000,
989  SkipSymbolRendering = 0x40000,
990  };
993  Q_ENUM( RenderContextFlag )
994 
995  // refs for below dox: https://github.com/qgis/QGIS/pull/1286#issuecomment-39806854
996  // https://github.com/qgis/QGIS/pull/8573#issuecomment-445585826
997 
998 
1003  {
1004  AlwaysOutlines SIP_MONKEYPATCH_COMPAT_NAME( TextFormatAlwaysOutlines ),
1005  AlwaysText SIP_MONKEYPATCH_COMPAT_NAME( TextFormatAlwaysText ),
1006  };
1007  Q_ENUM( TextRenderFormat )
1008 
1009 
1015  {
1016  Generic,
1017  ShadowOffset,
1018  BlurSize,
1019  GlowSpread,
1020  };
1021  Q_ENUM( RenderSubcomponentProperty )
1022 
1023 
1028  {
1029  Segment SIP_MONKEYPATCH_COMPAT_NAME( SegmentVertex ) = 1,
1030  Curve SIP_MONKEYPATCH_COMPAT_NAME( CurveVertex ) = 2,
1031  };
1032  Q_ENUM( VertexType )
1033 
1034 
1042  {
1043  Square,
1044  Diamond,
1045  Pentagon,
1046  Hexagon,
1047  Triangle,
1048  EquilateralTriangle,
1049  Star,
1050  Arrow,
1051  Circle,
1052  Cross,
1053  CrossFill,
1054  Cross2,
1055  Line,
1056  ArrowHead,
1057  ArrowHeadFilled,
1058  SemiCircle,
1059  ThirdCircle,
1060  QuarterCircle,
1061  QuarterSquare,
1062  HalfSquare,
1063  DiagonalHalfSquare,
1064  RightHalfTriangle,
1065  LeftHalfTriangle,
1066  Octagon,
1067  SquareWithCorners,
1068  AsteriskFill,
1069  HalfArc,
1070  ThirdArc,
1071  QuarterArc,
1072  };
1073  Q_ENUM( MarkerShape )
1074 
1075 
1083  {
1084  Interval = 1 << 0,
1085  Vertex = 1 << 1,
1086  LastVertex = 1 << 2,
1087  FirstVertex = 1 << 3,
1088  CentralPoint = 1 << 4,
1089  CurvePoint = 1 << 5,
1090  SegmentCenter = 1 << 6,
1091  InnerVertices = 1 << 7,
1092  };
1093  Q_ENUM( MarkerLinePlacement )
1094  Q_DECLARE_FLAGS( MarkerLinePlacements, MarkerLinePlacement )
1095  Q_FLAG( MarkerLinePlacements )
1096 
1097 
1105  {
1106  SimpleTwoColor,
1107  ColorRamp,
1108  };
1109  Q_ENUM( GradientColorSource )
1110 
1111 
1119  {
1120  Linear,
1121  Radial,
1122  Conical,
1123  };
1124  Q_ENUM( GradientType )
1125 
1126 
1134  {
1135  Feature,
1136  Viewport,
1137  };
1138  Q_ENUM( SymbolCoordinateReference )
1139 
1140 
1149  {
1150  Pad,
1151  Reflect,
1152  Repeat,
1153  };
1154  Q_ENUM( GradientSpread )
1155 
1156 
1164  {
1165  Absolute SIP_MONKEYPATCH_COMPAT_NAME( AbsoluteCount ),
1166  DensityBased SIP_MONKEYPATCH_COMPAT_NAME( DensityBasedCount ),
1167  };
1168  Q_ENUM( PointCountMethod )
1169 
1170 
1175  enum class MarkerClipMode : int
1176  {
1177  NoClipping,
1178  Shape,
1179  CentroidWithin,
1180  CompletelyWithin,
1181  };
1182  Q_ENUM( MarkerClipMode )
1183 
1184 
1189  enum class LineClipMode : int
1190  {
1191  ClipPainterOnly,
1192  ClipToIntersection,
1193  NoClipping,
1194  };
1195  Q_ENUM( LineClipMode )
1196 
1197 
1202  enum class DashPatternLineEndingRule : int
1203  {
1204  NoRule,
1205  FullDash,
1206  HalfDash,
1207  FullGap,
1208  HalfGap,
1209  };
1210  Q_ENUM( DashPatternLineEndingRule )
1211 
1212 
1217  enum class DashPatternSizeAdjustment : int
1218  {
1219  ScaleBothDashAndGap,
1220  ScaleDashOnly,
1221  ScaleGapOnly,
1222  };
1223  Q_ENUM( DashPatternSizeAdjustment )
1224 
1225 
1226  // NOTE -- the hardcoded numbers here must match QFont::Capitalization!
1227 
1228 
1236  {
1237  MixedCase = 0,
1238  AllUppercase = 1,
1239  AllLowercase = 2,
1240  ForceFirstLetterToCapital = 4,
1241  SmallCaps = 5,
1242  TitleCase = 1004,
1243  UpperCamelCase = 1005,
1244  AllSmallCaps = 1006,
1245  };
1246  Q_ENUM( Capitalization )
1247 
1248 
1253  enum class TextRendererFlag : int
1254  {
1255  WrapLines = 1 << 0,
1256  };
1257  Q_ENUM( TextRendererFlag )
1258  Q_DECLARE_FLAGS( TextRendererFlags, TextRendererFlag )
1259  Q_FLAG( TextRendererFlags )
1260 
1261 
1267  {
1268  MapBox,
1269  Esri,
1270  };
1272 
1279  {
1280  Clockwise,
1281  CounterClockwise,
1282  };
1283  Q_ENUM( AngularDirection )
1284 
1285 
1290  enum class RendererUsage : int
1291  {
1292  View,
1293  Export,
1294  Unknown,
1295  };
1296  Q_ENUM( RendererUsage )
1297 
1298 
1303  enum class HistoryProviderBackend : int
1304  {
1305  LocalProfile = 1 << 0,
1306 // Project = 1 << 1, //!< QGIS Project (not yet implemented)
1307  };
1308  Q_ENUM( HistoryProviderBackend )
1309  Q_DECLARE_FLAGS( HistoryProviderBackends, HistoryProviderBackend )
1310  Q_FLAG( HistoryProviderBackends )
1311 
1312 
1318  {
1319  Wkt SIP_MONKEYPATCH_COMPAT_NAME( FormatWkt ),
1320  Proj SIP_MONKEYPATCH_COMPAT_NAME( FormatProj ),
1321  };
1322  Q_ENUM( CrsDefinitionFormat )
1323 
1324 
1328  static const double DEFAULT_SEARCH_RADIUS_MM;
1329 
1331  static const float DEFAULT_MAPTOPIXEL_THRESHOLD;
1332 
1339  static const QColor DEFAULT_HIGHLIGHT_COLOR;
1340 
1345  static const double DEFAULT_HIGHLIGHT_BUFFER_MM;
1346 
1351  static const double DEFAULT_HIGHLIGHT_MIN_WIDTH_MM;
1352 
1359  static const double SCALE_PRECISION;
1360 
1366  static const double DEFAULT_Z_COORDINATE;
1367 
1373  static const double DEFAULT_M_COORDINATE;
1374 
1380  static const double UI_SCALE_FACTOR;
1381 
1386  static const double DEFAULT_SNAP_TOLERANCE;
1387 
1392  static const QgsTolerance::UnitType DEFAULT_SNAP_UNITS;
1393 
1399  static QString defaultProjectScales();
1400 
1406  static int geosVersionInt();
1407 
1413  static int geosVersionMajor();
1414 
1420  static int geosVersionMinor();
1421 
1427  static int geosVersionPatch();
1428 
1434  static QString geosVersion();
1435 };
1436 
1437 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolRenderHints )
1438 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolFlags )
1439 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolPreviewFlags )
1440 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolLayerFlags )
1441 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BrowserItemCapabilities )
1442 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SublayerQueryFlags )
1443 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SublayerFlags )
1444 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SqlLayerDefinitionCapabilities )
1445 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BabelFormatCapabilities )
1446 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BabelCommandFlags )
1447 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::GeometryValidityFlags )
1448 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::FileOperationFlags )
1449 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::AnnotationItemFlags )
1450 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::AnnotationItemGuiFlags )
1451 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MapSettingsFlags )
1452 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::RenderContextFlags )
1453 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::VectorLayerTypeFlags )
1454 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MarkerLinePlacements )
1455 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::TextRendererFlags )
1456 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::HistoryProviderBackends )
1457 
1458 
1459 // hack to workaround warnings when casting void pointers
1460 // retrieved from QLibrary::resolve to function pointers.
1461 // It's assumed that this works on all systems supporting
1462 // QLibrary
1463 #define cast_to_fptr(f) f
1464 
1465 
1474 // based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
1475 template<class Object> class QgsSignalBlocker SIP_SKIP SIP_SKIP // clazy:exclude=rule-of-three
1476 {
1477  public:
1478 
1483  explicit QgsSignalBlocker( Object * object )
1484  : mObject( object )
1485  , mPreviousState( object->blockSignals( true ) )
1486  {}
1487 
1489  {
1490  mObject->blockSignals( mPreviousState );
1491  }
1492 
1494  Object *operator->() { return mObject; }
1495 
1496  private:
1497 
1498  Object *mObject = nullptr;
1499  bool mPreviousState;
1500 
1501 };
1502 
1516 // based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
1517 template<class Object> inline QgsSignalBlocker<Object> whileBlocking( Object *object ) SIP_SKIP SIP_SKIP
1518 {
1519  return QgsSignalBlocker<Object>( object );
1520 }
1521 
1523 CORE_EXPORT uint qHash( const QVariant &variant );
1524 
1530 inline QString qgsDoubleToString( double a, int precision = 17 )
1531 {
1532  QString str = QString::number( a, 'f', precision );
1533  if ( precision )
1534  {
1535  if ( str.contains( QLatin1Char( '.' ) ) )
1536  {
1537  // remove ending 0s
1538  int idx = str.length() - 1;
1539  while ( str.at( idx ) == '0' && idx > 1 )
1540  {
1541  idx--;
1542  }
1543  if ( idx < str.length() - 1 )
1544  str.truncate( str.at( idx ) == '.' ? idx : idx + 1 );
1545  }
1546  }
1547  // avoid printing -0
1548  // see https://bugreports.qt.io/browse/QTBUG-71439
1549  if ( str == QLatin1String( "-0" ) )
1550  {
1551  return QLatin1String( "0" );
1552  }
1553  return str;
1554 }
1555 
1562 inline bool qgsNanCompatibleEquals( double a, double b )
1563 {
1564  const bool aIsNan = std::isnan( a );
1565  const bool bIsNan = std::isnan( b );
1566  if ( aIsNan || bIsNan )
1567  return aIsNan && bIsNan;
1568 
1569  return a == b;
1570 }
1571 
1578 inline bool qgsDoubleNear( double a, double b, double epsilon = 4 * std::numeric_limits<double>::epsilon() )
1579 {
1580  const bool aIsNan = std::isnan( a );
1581  const bool bIsNan = std::isnan( b );
1582  if ( aIsNan || bIsNan )
1583  return aIsNan && bIsNan;
1584 
1585  const double diff = a - b;
1586  return diff > -epsilon && diff <= epsilon;
1587 }
1588 
1595 inline bool qgsFloatNear( float a, float b, float epsilon = 4 * FLT_EPSILON )
1596 {
1597  const bool aIsNan = std::isnan( a );
1598  const bool bIsNan = std::isnan( b );
1599  if ( aIsNan || bIsNan )
1600  return aIsNan && bIsNan;
1601 
1602  const float diff = a - b;
1603  return diff > -epsilon && diff <= epsilon;
1604 }
1605 
1607 inline bool qgsDoubleNearSig( double a, double b, int significantDigits = 10 )
1608 {
1609  const bool aIsNan = std::isnan( a );
1610  const bool bIsNan = std::isnan( b );
1611  if ( aIsNan || bIsNan )
1612  return aIsNan && bIsNan;
1613 
1614  // The most simple would be to print numbers as %.xe and compare as strings
1615  // but that is probably too costly
1616  // Then the fastest would be to set some bits directly, but little/big endian
1617  // has to be considered (maybe TODO)
1618  // Is there a better way?
1619  int aexp, bexp;
1620  const double ar = std::frexp( a, &aexp );
1621  const double br = std::frexp( b, &bexp );
1622 
1623  return aexp == bexp &&
1624  std::round( ar * std::pow( 10.0, significantDigits ) ) == std::round( br * std::pow( 10.0, significantDigits ) );
1625 }
1626 
1632 inline double qgsRound( double number, int places )
1633 {
1634  const double m = ( number < 0.0 ) ? -1.0 : 1.0;
1635  const double scaleFactor = std::pow( 10.0, places );
1636  return ( std::round( number * m * scaleFactor ) / scaleFactor ) * m;
1637 }
1638 
1639 
1640 #ifndef SIP_RUN
1641 
1643 
1653 namespace qgis
1654 {
1655 
1668  template<typename To, typename From> inline To down_cast( From *f )
1669  {
1670  static_assert(
1671  ( std::is_base_of<From,
1672  typename std::remove_pointer<To>::type>::value ),
1673  "target type not derived from source type" );
1674  Q_ASSERT( f == nullptr || dynamic_cast<To>( f ) != nullptr );
1675  return static_cast<To>( f );
1676  }
1677 
1678  template<class T>
1679  QSet<T> listToSet( const QList<T> &list )
1680  {
1681 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
1682  return list.toSet();
1683 #else
1684  return QSet<T>( list.begin(), list.end() );
1685 #endif
1686  }
1687 
1688  template<class T>
1689  QList<T> setToList( const QSet<T> &set )
1690  {
1691 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
1692  return set.toList();
1693 #else
1694  return QList<T>( set.begin(), set.end() );
1695 #endif
1696  }
1697 }
1698 
1699 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
1700 namespace std
1701 {
1702  template<> struct hash<QString>
1703  {
1704  std::size_t operator()( const QString &s ) const noexcept
1705  {
1706  return ( size_t ) qHash( s );
1707  }
1708  };
1709 }
1710 #endif
1711 
1713 #endif
1714 
1720 template<class T> const QMap<T, QString> qgsEnumMap() SIP_SKIP
1721 {
1722  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
1723  Q_ASSERT( metaEnum.isValid() );
1724  QMap<T, QString> enumMap;
1725  for ( int idx = 0; idx < metaEnum.keyCount(); ++idx )
1726  {
1727  const char *enumKey = metaEnum.key( idx );
1728  enumMap.insert( static_cast<T>( metaEnum.keyToValue( enumKey ) ), QString( enumKey ) );
1729  }
1730  return enumMap;
1731 }
1732 
1737 template<class T> QString qgsEnumValueToKey( const T &value ) SIP_SKIP
1738 {
1739  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
1740  Q_ASSERT( metaEnum.isValid() );
1741  return QString::fromUtf8( metaEnum.valueToKey( static_cast<int>( value ) ) );
1742 }
1743 
1750 template<class T> T qgsEnumKeyToValue( const QString &key, const T &defaultValue, bool tryValueAsKey = true ) SIP_SKIP
1751 {
1752  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
1753  Q_ASSERT( metaEnum.isValid() );
1754  bool ok = false;
1755  T v = static_cast<T>( metaEnum.keyToValue( key.toUtf8().data(), &ok ) );
1756  if ( ok )
1757  {
1758  return v;
1759  }
1760  else
1761  {
1762  // if conversion has failed, try with conversion from int value
1763  if ( tryValueAsKey )
1764  {
1765  bool canConvert = false;
1766  const int intValue = key.toInt( &canConvert );
1767  if ( canConvert && metaEnum.valueToKey( intValue ) )
1768  {
1769  return static_cast<T>( intValue );
1770  }
1771  }
1772  }
1773  return defaultValue;
1774 }
1775 
1780 template<class T> QString qgsFlagValueToKeys( const T &value ) SIP_SKIP
1781 {
1782  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
1783  Q_ASSERT( metaEnum.isValid() );
1784  return QString::fromUtf8( metaEnum.valueToKeys( static_cast<int>( value ) ) );
1785 }
1786 
1792 template<class T> T qgsFlagKeysToValue( const QString &keys, const T &defaultValue ) SIP_SKIP
1793 {
1794  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
1795  Q_ASSERT( metaEnum.isValid() );
1796  bool ok = false;
1797  T v = static_cast<T>( metaEnum.keysToValue( keys.toUtf8().constData(), &ok ) );
1798  if ( ok )
1799  return v;
1800  else
1801  return defaultValue;
1802 }
1803 
1804 
1814 CORE_EXPORT double qgsPermissiveToDouble( QString string, bool &ok );
1815 
1825 CORE_EXPORT int qgsPermissiveToInt( QString string, bool &ok );
1826 
1836 CORE_EXPORT qlonglong qgsPermissiveToLongLong( QString string, bool &ok );
1837 
1847 CORE_EXPORT bool qgsVariantLessThan( const QVariant &lhs, const QVariant &rhs );
1848 
1857 CORE_EXPORT bool qgsVariantEqual( const QVariant &lhs, const QVariant &rhs );
1858 
1865 CORE_EXPORT bool qgsVariantGreaterThan( const QVariant &lhs, const QVariant &rhs );
1866 
1867 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1868 
1875 inline bool operator> ( const QVariant &v1, const QVariant &v2 )
1876 {
1877  return qgsVariantGreaterThan( v1, v2 );
1878 }
1879 
1889 inline bool operator< ( const QVariant &v1, const QVariant &v2 )
1890 {
1891  return qgsVariantLessThan( v1, v2 );
1892 }
1893 #endif
1894 
1895 
1896 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
1897 
1901 template<> CORE_EXPORT bool qMapLessThanKey<QVariantList>( const QVariantList &key1, const QVariantList &key2 ) SIP_SKIP;
1902 #endif
1903 
1904 CORE_EXPORT QString qgsVsiPrefix( const QString &path );
1905 
1911 void CORE_EXPORT *qgsMalloc( size_t size ) SIP_SKIP;
1912 
1917 void CORE_EXPORT qgsFree( void *ptr ) SIP_SKIP;
1918 
1919 #ifndef SIP_RUN
1920 
1921 #ifdef _MSC_VER
1922 #define CONSTLATIN1STRING inline const QLatin1String
1923 #else
1924 #define CONSTLATIN1STRING constexpr QLatin1String
1925 #endif
1926 
1928 class ScopedIntIncrementor
1929 {
1930  public:
1931 
1932  ScopedIntIncrementor( int *variable )
1933  : mVariable( variable )
1934  {
1935  ( *mVariable )++;
1936  }
1937 
1938  ScopedIntIncrementor( const ScopedIntIncrementor &other ) = delete;
1939  ScopedIntIncrementor &operator=( const ScopedIntIncrementor &other ) = delete;
1940 
1941  void release()
1942  {
1943  if ( mVariable )
1944  ( *mVariable )--;
1945 
1946  mVariable = nullptr;
1947  }
1948 
1949  ~ScopedIntIncrementor()
1950  {
1951  release();
1952  }
1953 
1954  private:
1955  int *mVariable = nullptr;
1956 };
1958 
1964 {
1965  return QLatin1String(
1966  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]] )"""
1967  );
1968 }
1969 
1972 {
1973  return QLatin1String( "+proj=longlat +datum=WGS84 +no_defs" );
1974 }
1975 
1978 {
1979  return QLatin1String( "EPSG:4326" );
1980 }
1981 
1984 {
1985  return QLatin1String( "NONE" );
1986 }
1987 
1989 
1991 const int PREVIEW_JOB_DELAY_MS = 250;
1992 
1994 const int MAXIMUM_LAYER_PREVIEW_TIME_MS = 250;
1995 
1997 
1998 #endif
1999 
2001 const long GEOSRID = 4326;
2002 
2004 const long GEOCRS_ID = 3452;
2005 
2007 const long GEO_EPSG_CRS_ID = 4326;
2008 
2013 const int USER_CRS_START_ID = 100000;
2014 
2015 //
2016 // Constants for point symbols
2017 //
2018 
2020 const double DEFAULT_POINT_SIZE = 2.0;
2021 const double DEFAULT_LINE_WIDTH = 0.26;
2022 
2024 const double DEFAULT_SEGMENT_EPSILON = 1e-8;
2025 
2026 typedef QMap<QString, QString> QgsStringMap SIP_SKIP;
2027 
2036 typedef unsigned long long qgssize;
2037 
2038 #ifndef SIP_RUN
2039 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
2040 
2041 #define Q_NOWARN_DEPRECATED_PUSH \
2042  _Pragma("GCC diagnostic push") \
2043  _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
2044 #define Q_NOWARN_DEPRECATED_POP \
2045  _Pragma("GCC diagnostic pop");
2046 #define Q_NOWARN_UNREACHABLE_PUSH
2047 #define Q_NOWARN_UNREACHABLE_POP
2048 
2049 #elif defined(_MSC_VER)
2050 
2051 #define Q_NOWARN_DEPRECATED_PUSH \
2052  __pragma(warning(push)) \
2053  __pragma(warning(disable:4996))
2054 #define Q_NOWARN_DEPRECATED_POP \
2055  __pragma(warning(pop))
2056 #define Q_NOWARN_UNREACHABLE_PUSH \
2057  __pragma(warning(push)) \
2058  __pragma(warning(disable:4702))
2059 #define Q_NOWARN_UNREACHABLE_POP \
2060  __pragma(warning(pop))
2061 
2062 #else
2063 
2064 #define Q_NOWARN_DEPRECATED_PUSH
2065 #define Q_NOWARN_DEPRECATED_POP
2066 #define Q_NOWARN_UNREACHABLE_PUSH
2067 #define Q_NOWARN_UNREACHABLE_POP
2068 
2069 #endif
2070 #endif
2071 
2072 #ifndef QGISEXTERN
2073 #ifdef Q_OS_WIN
2074 # define QGISEXTERN extern "C" __declspec( dllexport )
2075 #else
2076 # if defined(__GNUC__) || defined(__clang__)
2077 # define QGISEXTERN extern "C" __attribute__ ((visibility ("default")))
2078 # else
2079 # define QGISEXTERN extern "C"
2080 # endif
2081 #endif
2082 #endif
2083 #endif
2084 
2085 #if __cplusplus >= 201500
2086 #define FALLTHROUGH [[fallthrough]];
2087 #elif defined(__clang__)
2088 #define FALLTHROUGH [[clang::fallthrough]];
2089 #elif defined(__GNUC__) && __GNUC__ >= 7
2090 #define FALLTHROUGH [[gnu::fallthrough]];
2091 #else
2092 #define FALLTHROUGH
2093 #endif
2094 
2095 // see https://infektor.net/posts/2017-01-19-using-cpp17-attributes-today.html#using-the-nodiscard-attribute
2096 #if __cplusplus >= 201703L
2097 #define NODISCARD [[nodiscard]]
2098 #elif defined(__clang__)
2099 #define NODISCARD [[nodiscard]]
2100 #elif defined(_MSC_VER)
2101 #define NODISCARD // no support
2102 #elif defined(__has_cpp_attribute)
2103 #if __has_cpp_attribute(nodiscard)
2104 #define NODISCARD [[nodiscard]]
2105 #elif __has_cpp_attribute(gnu::warn_unused_result)
2106 #define NODISCARD [[gnu::warn_unused_result]]
2107 #else
2108 #define NODISCARD Q_REQUIRED_RESULT
2109 #endif
2110 #else
2111 #define NODISCARD Q_REQUIRED_RESULT
2112 #endif
2113 
2114 #if __cplusplus >= 201703L
2115 #define MAYBE_UNUSED [[maybe_unused]]
2116 #elif defined(__clang__)
2117 #define MAYBE_UNUSED [[maybe_unused]]
2118 #elif defined(_MSC_VER)
2119 #define MAYBE_UNUSED // no support
2120 #elif defined(__has_cpp_attribute)
2121 #if __has_cpp_attribute(gnu::unused)
2122 #define MAYBE_UNUSED [[gnu::unused]]
2123 #else
2124 #define MAYBE_UNUSED
2125 #endif
2126 #else
2127 #define MAYBE_UNUSED
2128 #endif
2129 
2130 #ifndef FINAL
2131 #define FINAL final
2132 #endif
2133 
2134 #ifndef SIP_RUN
2135 #ifdef _MSC_VER
2136 #define BUILTIN_UNREACHABLE \
2137  __assume(false);
2138 #elif defined(__GNUC__) && !defined(__clang__)
2139 // Workaround a GCC bug where a -Wreturn-type warning is emitted in constructs
2140 // like:
2141 // switch( mVariableThatCanOnlyBeXorY )
2142 // {
2143 // case X:
2144 // return "foo";
2145 // case Y:
2146 // return "foo";
2147 // }
2148 // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
2149 #define BUILTIN_UNREACHABLE \
2150  __builtin_unreachable();
2151 #else
2152 #define BUILTIN_UNREACHABLE
2153 #endif
2154 #endif // SIP_RUN
2155 
2156 #ifdef SIP_RUN
2157 
2162 QString CORE_EXPORT geoWkt();
2163 
2165 QString CORE_EXPORT geoProj4();
2166 
2168 QString CORE_EXPORT geoEpsgCrsAuthId();
2169 
2171 QString CORE_EXPORT geoNone();
2172 
2173 #endif
The Qgis class provides global constants for use throughout the application.
Definition: qgis.h:64
GpsQualityIndicator
GPS signal quality indicator.
Definition: qgis.h:615
GeometryValidityFlag
Geometry validity check flags.
Definition: qgis.h:709
MapLayerProperty
File operation flags.
Definition: qgis.h:798
BufferSide
Side of line to buffer.
Definition: qgis.h:733
RasterResamplingStage
Stage at which raster resampling occurs.
Definition: qgis.h:502
VectorTemporalMode
Vector layer temporal feature modes.
Definition: qgis.h:861
SublayerFlag
Sublayer query flags.
Definition: qgis.h:472
DashPatternSizeAdjustment
Dash pattern size adjustment options.
Definition: qgis.h:1218
AnnotationItemNodeType
Annotation item GUI flags.
Definition: qgis.h:837
static const char * QGIS_DEV_VERSION
The development version.
Definition: qgis.h:90
AngularDirection
Angular directions.
Definition: qgis.h:1279
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:1083
GeometryOperationResult
Success or failure of a geometry operation.
Definition: qgis.h:681
BrowserItemState
Browser item states.
Definition: qgis.h:281
MarkerClipMode
Marker clipping modes.
Definition: qgis.h:1176
AnnotationItemFlag
Map layer properties.
Definition: qgis.h:811
RenderSubcomponentProperty
Rendering subcomponent properties.
Definition: qgis.h:1015
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:1190
BrowserDirectoryMonitoring
Browser directory item monitoring switches.
Definition: qgis.h:337
GradientColorSource
Gradient color sources.
Definition: qgis.h:1105
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:1149
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:1164
VertexType
Types of vertex.
Definition: qgis.h:1028
GeometryValidationEngine
Available engines for validating geometries.
Definition: qgis.h:721
Q_ENUM(ScaleToTileZoomLevelMethod)
FileOperationFlag
File operation flags.
Definition: qgis.h:784
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:848
ActionStart
Enum to determine when an operation would begin.
Definition: qgis.h:432
MarkerShape
Marker shapes.
Definition: qgis.h:1042
Capitalization
String capitalization options.
Definition: qgis.h:1236
TemporalIntervalMatchMethod
Method to use when resolving a temporal range to a data provider layer or band.
Definition: qgis.h:915
ScaleToTileZoomLevelMethod
Available methods for converting map scales to tile zoom levels.
Definition: qgis.h:1267
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:1318
SpatialFilterType
Feature request spatial filter types.
Definition: qgis.h:771
BrowserItemType
Symbol layer flags.
Definition: qgis.h:262
RasterTemporalMode
Raster layer temporal modes.
Definition: qgis.h:902
JoinStyle
Join styles for buffers.
Definition: qgis.h:758
BrowserLayerType
Browser item layer types.
Definition: qgis.h:314
VectorDataProviderTemporalMode
Vector data provider temporal handling modes.
Definition: qgis.h:889
TextRenderFormat
Options for rendering text.
Definition: qgis.h:1003
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:745
BabelCommandFlag
Babel GPS format capabilities.
Definition: qgis.h:653
RenderContextFlag
Flags which affect rendering operations.
Definition: qgis.h:970
RasterPipeInterfaceRole
Sublayer flags.
Definition: qgis.h:485
SymbolPreviewFlag
Symbol flags.
Definition: qgis.h:236
AnnotationItemGuiFlag
Annotation item flags.
Definition: qgis.h:824
DashPatternLineEndingRule
Dash pattern line ending rules.
Definition: qgis.h:1203
VertexMarkerType
Editing vertex markers, used for showing vertices during a edit operation.
Definition: qgis.h:588
HistoryProviderBackend
History provider backends.
Definition: qgis.h:1304
SublayerPromptMode
Specifies how to handle layer sources with multiple sublayers.
Definition: qgis.h:545
GradientType
Gradient types.
Definition: qgis.h:1119
GpsFeatureType
Babel command flags.
Definition: qgis.h:666
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:877
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:1291
BabelFormatCapability
Babel GPS format capabilities.
Definition: qgis.h:635
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:1134
TextRendererFlag
Flags which control the behavior of rendering text.
Definition: qgis.h:1254
TransformDirection
Indicates the direction (forward or inverse) of a transform.
Definition: qgis.h:930
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:942
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:1476
~QgsSignalBlocker()
Definition: qgis.h:1488
QgsSignalBlocker(Object *object)
Constructor for QgsSignalBlocker.
Definition: qgis.h:1483
Object * operator->()
Returns pointer to blocked QObject.
Definition: qgis.h:1494
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:1983
const double DEFAULT_LINE_WIDTH
Definition: qgis.h:2021
CORE_EXPORT uint qHash(const QVariant &variant)
Hash for QVariant.
Definition: qgis.cpp:217
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:1875
CORE_EXPORT QString qgsVsiPrefix(const QString &path)
Definition: qgis.cpp:192
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:266
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:1530
QString qgsEnumValueToKey(const T &value)
Returns the value for the given key of an enum.
Definition: qgis.h:1737
const QMap< T, QString > qgsEnumMap()
Returns a map of all enum entries.
Definition: qgis.h:1720
const long GEO_EPSG_CRS_ID
Magic number for a geographic coord sys in EpsgCrsId ID format.
Definition: qgis.h:2007
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:187
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:2036
bool qgsFloatNear(float a, float b, float epsilon=4 *FLT_EPSILON)
Compare two floats (but allow some difference)
Definition: qgis.h:1595
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:1632
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
Definition: qgis.h:1578
CONSTLATIN1STRING geoProj4()
PROJ4 string that represents a geographic coord sys.
Definition: qgis.h:1971
T qgsFlagKeysToValue(const QString &keys, const T &defaultValue)
Returns the value corresponding to the given keys of a flag.
Definition: qgis.h:1792
bool qgsNanCompatibleEquals(double a, double b)
Compare two doubles, treating nan values as equal.
Definition: qgis.h:1562
const double DEFAULT_SEGMENT_EPSILON
Default snapping tolerance for segments.
Definition: qgis.h:2024
QMap< QString, QString > QgsStringMap
Definition: qgis.h:2026
#define CONSTLATIN1STRING
Definition: qgis.h:1924
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition: qgis.h:1517
CONSTLATIN1STRING geoWkt()
Wkt string that represents a geographic coord sys.
Definition: qgis.h:1963
bool qgsDoubleNearSig(double a, double b, int significantDigits=10)
Compare two doubles using specified number of significant digits.
Definition: qgis.h:1607
const int USER_CRS_START_ID
Magick number that determines whether a projection crsid is a system (srs.db) or user (~/....
Definition: qgis.h:2013
QString qgsFlagValueToKeys(const T &value)
Returns the value for the given keys of a flag.
Definition: qgis.h:1780
void CORE_EXPORT qgsFree(void *ptr)
Frees the memory space pointed to by ptr.
Definition: qgis.cpp:114
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:119
const long GEOSRID
Magic number for a geographic coord sys in POSTGIS SRID.
Definition: qgis.h:2001
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:1889
CONSTLATIN1STRING geoEpsgCrsAuthId()
Geographic coord sys from EPSG authority.
Definition: qgis.h:1977
const long GEOCRS_ID
Magic number for a geographic coord sys in QGIS srs.db tbl_srs.srs_id.
Definition: qgis.h:2004
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:1750
const double DEFAULT_POINT_SIZE
Magic number that determines the default point size for point symbols.
Definition: qgis.h:2020
#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