QGIS API Documentation  3.27.0-Master (bef583a8ef)
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 #ifndef SIP_RUN
59 // qHash implementation for scoped enum type
60 // https://gitlab.com/frostasm/programming-knowledge-base/-/snippets/20120
61 #define QHASH_FOR_CLASS_ENUM(T) \
62  inline uint qHash(const T &t, uint seed) { \
63  return ::qHash(static_cast<typename std::underlying_type<T>::type>(t), seed); \
64  }
65 #endif
66 
71 class CORE_EXPORT Qgis
72 {
73  Q_GADGET
74  public:
75 
81  static QString version();
82 
88  static int versionInt();
89 
95  static QString releaseName();
96 
98  static const char *QGIS_DEV_VERSION;
99 
105  static QString devVersion();
106 
107  // Enumerations
108  //
109 
115  {
116  Info = 0,
117  Warning = 1,
118  Critical = 2,
119  Success = 3,
120  NoLevel = 4,
121  };
122  Q_ENUM( MessageLevel )
123 
124 
129  {
130  UnknownDataType = 0,
131  Byte = 1,
132  UInt16 = 2,
133  Int16 = 3,
134  UInt32 = 4,
135  Int32 = 5,
136  Float32 = 6,
137  Float64 = 7,
138  CInt16 = 8,
139  CInt32 = 9,
140  CFloat32 = 10,
141  CFloat64 = 11,
142  ARGB32 = 12,
143  ARGB32_Premultiplied = 13
144  };
145  Q_ENUM( DataType )
146 
147 
152  enum class CaptureTechnique : int
153  {
154  StraightSegments,
155  CircularString,
156  Streaming,
157  Shape,
158  };
159  Q_ENUM( CaptureTechnique )
160 
161 
166  enum class VectorLayerTypeFlag : int
167  {
168  SqlQuery = 1 << 0
169  };
170  Q_ENUM( VectorLayerTypeFlag )
172  Q_DECLARE_FLAGS( VectorLayerTypeFlags, VectorLayerTypeFlag )
173  Q_FLAG( VectorLayerTypeFlags )
174 
175 
180  {
181  Never = 0,
182  Ask = 1,
183  SessionOnly = 2,
184  Always = 3,
185  NotForThisSession,
186  };
187  Q_ENUM( PythonMacroMode )
188 
189 
195  {
196  Uncounted = -2,
197  UnknownCount = -1,
198  };
199  Q_ENUM( FeatureCountState )
200 
201 
206  {
207  Marker,
208  Line,
209  Fill,
210  Hybrid
211  };
212  Q_ENUM( SymbolType )
213 
214 
220  {
221  ScaleArea,
222  ScaleDiameter
223  };
224  Q_ENUM( ScaleMethod )
225 
226 
231  {
232  Variant,
233  String,
234  StringList,
235  Bool,
236  Integer,
237  Double,
238  EnumFlag,
239  Color
240  };
241  Q_ENUM( SettingsType )
242 
243 
247  enum class SettingsOption : int
248  {
249  SaveFormerValue = 1 << 1, //<! Save the former value of the settings
250  SaveEnumFlagAsInt = 1 << 2,
251  };
252  Q_ENUM( SettingsOption )
253  Q_DECLARE_FLAGS( SettingsOptions, SettingsOption )
254  Q_FLAG( SettingsOptions )
255 
256 
261  {
262  ActiveLayer = 1,
263  AllLayers = 2,
264  AdvancedConfiguration = 3,
265  };
266  Q_ENUM( SnappingMode )
267 
268 
273  {
274  NoSnap SIP_MONKEYPATCH_COMPAT_NAME( NoSnapFlag ) = 0,
275  Vertex SIP_MONKEYPATCH_COMPAT_NAME( VertexFlag ) = 1 << 0,
276  Segment SIP_MONKEYPATCH_COMPAT_NAME( SegmentFlag ) = 1 << 1,
277  Area SIP_MONKEYPATCH_COMPAT_NAME( AreaFlag ) = 1 << 2,
278  Centroid SIP_MONKEYPATCH_COMPAT_NAME( CentroidFlag ) = 1 << 3,
279  MiddleOfSegment SIP_MONKEYPATCH_COMPAT_NAME( MiddleOfSegmentFlag ) = 1 << 4,
280  LineEndpoint SIP_MONKEYPATCH_COMPAT_NAME( LineEndpointFlag ) = 1 << 5,
281  };
282  Q_ENUM( SnappingType )
284  Q_DECLARE_FLAGS( SnappingTypes, SnappingType ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsSnappingConfig, SnappingTypeFlag )
285  Q_FLAG( SnappingTypes )
286 
293  {
294  DynamicRotation = 2,
295  };
296  Q_ENUM( SymbolRenderHint )
298  Q_DECLARE_FLAGS( SymbolRenderHints, SymbolRenderHint ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsSymbol, RenderHints )
299  Q_FLAG( SymbolRenderHints )
300 
306  enum class SymbolFlag : int
307  {
308  RendererShouldUseSymbolLevels = 1 << 0,
309  };
310  Q_ENUM( SymbolFlag )
312  Q_DECLARE_FLAGS( SymbolFlags, SymbolFlag )
313  Q_FLAG( SymbolFlags )
314 
315 
321  {
322  FlagIncludeCrosshairsForMarkerSymbols = 1 << 0,
323  };
324  Q_ENUM( SymbolPreviewFlag )
326  Q_DECLARE_FLAGS( SymbolPreviewFlags, SymbolPreviewFlag ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsSymbol, SymbolPreviewFlags )
327  Q_FLAG( SymbolPreviewFlags )
328 
334  enum class SymbolLayerFlag : int
335  {
336  DisableFeatureClipping = 1 << 0,
337  };
338  Q_ENUM( SymbolLayerFlag )
340  Q_DECLARE_FLAGS( SymbolLayerFlags, SymbolLayerFlag )
341  Q_FLAG( SymbolLayerFlags )
342 
343 
349  {
350  Collection,
351  Directory,
352  Layer,
353  Error,
354  Favorites,
355  Project,
356  Custom,
357  Fields,
358  Field,
359  };
360  Q_ENUM( BrowserItemType )
361 
362 
368  {
369  NotPopulated,
370  Populating,
371  Populated,
372  };
373  Q_ENUM( BrowserItemState )
374 
375 
381  {
382  NoCapabilities = 0,
383  SetCrs = 1 << 0,
384  Fertile = 1 << 1,
385  Fast = 1 << 2,
386  Collapse = 1 << 3,
387  Rename = 1 << 4,
388  Delete = 1 << 5,
389  ItemRepresentsFile = 1 << 6,
390  RefreshChildrenWhenItemIsRefreshed = 1 << 7,
391  };
392  Q_ENUM( BrowserItemCapability )
394  Q_DECLARE_FLAGS( BrowserItemCapabilities, BrowserItemCapability ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsDataItem, Capabilities )
395  Q_FLAG( BrowserItemCapabilities )
396 
403  {
404  NoType,
405  Vector,
406  Raster,
407  Point,
408  Line,
409  Polygon,
410  TableLayer,
411  Database,
412  Table,
413  Plugin,
414  Mesh,
415  VectorTile,
416  PointCloud
417  };
418  Q_ENUM( BrowserLayerType )
419 
420 
425  enum class BrowserDirectoryMonitoring : int
426  {
427  Default,
428  NeverMonitor,
429  AlwaysMonitor,
430  };
431  Q_ENUM( BrowserDirectoryMonitoring )
432 
433 
437  enum class HttpMethod : int
438  {
439  Get = 0,
440  Post = 1
441  };
442  Q_ENUM( HttpMethod )
443 
444 
450  {
451  Success SIP_MONKEYPATCH_COMPAT_NAME( NoError ) = 0,
452  ErrorCreatingDataSource SIP_MONKEYPATCH_COMPAT_NAME( ErrCreateDataSource ),
453  ErrorCreatingLayer SIP_MONKEYPATCH_COMPAT_NAME( ErrCreateLayer ),
454  ErrorAttributeTypeUnsupported SIP_MONKEYPATCH_COMPAT_NAME( ErrAttributeTypeUnsupported ),
455  ErrorAttributeCreationFailed SIP_MONKEYPATCH_COMPAT_NAME( ErrAttributeCreationFailed ),
456  ErrorProjectingFeatures SIP_MONKEYPATCH_COMPAT_NAME( ErrProjection ),
457  ErrorFeatureWriteFailed SIP_MONKEYPATCH_COMPAT_NAME( ErrFeatureWriteFailed ),
458  ErrorInvalidLayer SIP_MONKEYPATCH_COMPAT_NAME( ErrInvalidLayer ),
459  ErrorInvalidProvider SIP_MONKEYPATCH_COMPAT_NAME( ErrInvalidProvider ),
460  ErrorProviderUnsupportedFeature SIP_MONKEYPATCH_COMPAT_NAME( ErrProviderUnsupportedFeature ),
461  ErrorConnectionFailed SIP_MONKEYPATCH_COMPAT_NAME( ErrConnectionFailed ),
462  UserCanceled SIP_MONKEYPATCH_COMPAT_NAME( ErrUserCanceled ),
463  };
464  Q_ENUM( VectorExportResult )
465 
466 
471  {
472  SubsetStringFilter = 1 << 1,
473  GeometryColumn = 1 << 2,
474  PrimaryKeys = 1 << 3,
475  UnstableFeatureIds = 1 << 4
476  };
477  Q_ENUM( SqlLayerDefinitionCapability )
479  Q_DECLARE_FLAGS( SqlLayerDefinitionCapabilities, SqlLayerDefinitionCapability )
480  Q_FLAG( SqlLayerDefinitionCapabilities )
481 
482 
487  enum class SqlKeywordCategory : int
488  {
489  Keyword,
490  Constant,
491  Function,
492  Geospatial,
493  Operator,
494  Math,
495  Aggregate,
496  String,
497  Identifier
498  };
499  Q_ENUM( SqlKeywordCategory )
500 
501 
505  enum class DriveType : int
506  {
507  Unknown,
508  Invalid,
509  Removable,
510  Fixed,
511  Remote,
512  CdRom,
513  RamDisk,
514  };
515  Q_ENUM( DriveType )
516 
517 
522  {
523  Deferred SIP_MONKEYPATCH_COMPAT_NAME( DownloadLater ),
524  Immediate SIP_MONKEYPATCH_COMPAT_NAME( DownloadImmediately ),
525  };
526  Q_ENUM( ActionStart )
527 
528 
533  enum class UnplacedLabelVisibility : int
534  {
535  FollowEngineSetting,
536  NeverShow,
537  };
538  Q_ENUM( UnplacedLabelVisibility )
539 
540 
545  enum class LabelOverlapHandling : int
546  {
547  PreventOverlap,
548  AllowOverlapIfRequired,
549  AllowOverlapAtNoCost,
550  };
551  Q_ENUM( LabelOverlapHandling )
552 
553 
561  {
562  AroundPoint,
563  OverPoint,
564  Line,
565  Curved,
566  Horizontal,
567  Free,
568  OrderedPositionsAroundPoint,
569  PerimeterCurved,
570  OutsidePolygons,
571  };
572  Q_ENUM( LabelPlacement )
573 
574 
575 
583  {
584  TopLeft,
585  TopSlightlyLeft,
586  TopMiddle,
587  TopSlightlyRight,
588  TopRight,
589  MiddleLeft,
590  MiddleRight,
591  BottomLeft,
592  BottomSlightlyLeft,
593  BottomMiddle,
594  BottomSlightlyRight,
595  BottomRight,
596  };
597  Q_ENUM( LabelPredefinedPointPosition )
598 
599 
608  {
609  FromPoint,
610  FromSymbolBounds,
611  };
612  Q_ENUM( LabelOffsetType )
613 
614 
622  {
623  AboveLeft SIP_MONKEYPATCH_COMPAT_NAME( QuadrantAboveLeft ),
624  Above SIP_MONKEYPATCH_COMPAT_NAME( QuadrantAbove ),
625  AboveRight SIP_MONKEYPATCH_COMPAT_NAME( QuadrantAboveRight ),
626  Left SIP_MONKEYPATCH_COMPAT_NAME( QuadrantLeft ),
627  Over SIP_MONKEYPATCH_COMPAT_NAME( QuadrantOver ),
628  Right SIP_MONKEYPATCH_COMPAT_NAME( QuadrantRight ),
629  BelowLeft SIP_MONKEYPATCH_COMPAT_NAME( QuadrantBelowLeft ),
630  Below SIP_MONKEYPATCH_COMPAT_NAME( QuadrantBelow ),
631  BelowRight SIP_MONKEYPATCH_COMPAT_NAME( QuadrantBelowRight ),
632  };
633  Q_ENUM( LabelQuadrantPosition )
634 
635 
643  {
644  FlipUpsideDownLabels SIP_MONKEYPATCH_COMPAT_NAME( Upright ),
645  AllowUpsideDownWhenRotationIsDefined SIP_MONKEYPATCH_COMPAT_NAME( ShowDefined ),
646  AlwaysAllowUpsideDown SIP_MONKEYPATCH_COMPAT_NAME( ShowAll )
647  };
648  Q_ENUM( UpsideDownLabelHandling )
649 
650 
658  {
659  Left SIP_MONKEYPATCH_COMPAT_NAME( MultiLeft ) = 0,
660  Center SIP_MONKEYPATCH_COMPAT_NAME( MultiCenter ),
661  Right SIP_MONKEYPATCH_COMPAT_NAME( MultiRight ),
662  FollowPlacement SIP_MONKEYPATCH_COMPAT_NAME( MultiFollowPlacement ),
663  Justify SIP_MONKEYPATCH_COMPAT_NAME( MultiJustify ),
664  };
665  Q_ENUM( LabelMultiLineAlignment )
666 
667 
672  enum class SublayerQueryFlag : int
673  {
674  FastScan = 1 << 0,
675  ResolveGeometryType = 1 << 1,
676  CountFeatures = 1 << 2,
677  IncludeSystemTables = 1 << 3,
678  };
680  Q_DECLARE_FLAGS( SublayerQueryFlags, SublayerQueryFlag )
681  Q_ENUM( SublayerQueryFlag )
682  Q_FLAG( SublayerQueryFlags )
683 
684 
689  enum class SublayerFlag : int
690  {
691  SystemTable = 1 << 0,
692  };
694  Q_DECLARE_FLAGS( SublayerFlags, SublayerFlag )
695  Q_ENUM( SublayerFlag )
696  Q_FLAG( SublayerFlags )
697 
698 
704  {
705  Unknown SIP_MONKEYPATCH_COMPAT_NAME( UnknownRole ) = 0,
706  Provider SIP_MONKEYPATCH_COMPAT_NAME( ProviderRole ) = 1,
707  Renderer SIP_MONKEYPATCH_COMPAT_NAME( RendererRole ) = 2,
708  Brightness SIP_MONKEYPATCH_COMPAT_NAME( BrightnessRole ) = 3,
709  Resampler SIP_MONKEYPATCH_COMPAT_NAME( ResamplerRole ) = 4,
710  Projector SIP_MONKEYPATCH_COMPAT_NAME( ProjectorRole ) = 5,
711  Nuller SIP_MONKEYPATCH_COMPAT_NAME( NullerRole ) = 6,
712  HueSaturation SIP_MONKEYPATCH_COMPAT_NAME( HueSaturationRole ) = 7,
713  };
714  Q_ENUM( RasterPipeInterfaceRole )
715 
716 
721  {
723  ResampleFilter,
725  Provider
726  };
727  Q_ENUM( RasterResamplingStage )
728 
729 
734  enum class MeshEditingErrorType : int
735  {
736  NoError,
737  InvalidFace,
738  TooManyVerticesInFace,
739  FlatFace,
740  UniqueSharedVertex,
741  InvalidVertex,
742  ManifoldFace,
743  };
744  Q_ENUM( MeshEditingErrorType )
745 
746 
751  enum class FilePathType : int
752  {
753  Absolute,
754  Relative,
755  };
756  Q_ENUM( FilePathType )
757 
758 
763  enum class SublayerPromptMode : int
764  {
765  AlwaysAsk,
766  AskExcludingRasterBands,
767  NeverAskSkip,
768  NeverAskLoadAll,
769  };
770  Q_ENUM( SublayerPromptMode )
771 
772 
778  {
779  SetSelection,
780  AddToSelection,
781  IntersectSelection,
782  RemoveFromSelection,
783  };
784  Q_ENUM( SelectBehavior )
785 
786 
792  {
793  Success = 0,
794  EmptyGeometry = 1,
795  EditFailed = 2,
796  FetchFeatureFailed = 3,
797  InvalidLayer = 4,
798  };
799  Q_ENUM( VectorEditResult )
800 
801 
807  {
808  SemiTransparentCircle,
809  Cross,
810  NoMarker,
811  };
812  Q_ENUM( VertexMarkerType )
813 
814 
818  enum class ContentStatus : int
819  {
820  NotStarted,
821  Running,
822  Finished,
823  Failed,
824  Canceled,
825  };
826  Q_ENUM( ContentStatus )
827 
828 
834  {
835  Unknown = -1,
836  Invalid,
837  GPS,
838  DGPS,
839  PPS,
840  RTK,
841  FloatRTK,
842  Estimated,
843  Manual,
844  Simulation,
845  };
846  Q_ENUM( GpsQualityIndicator )
847 
848 
853  enum class BabelFormatCapability : int
854  {
855  Import = 1 << 0,
856  Export = 1 << 1,
857  Waypoints = 1 << 2,
858  Routes = 1 << 3,
859  Tracks = 1 << 4,
860  };
862  Q_DECLARE_FLAGS( BabelFormatCapabilities, BabelFormatCapability )
863  Q_ENUM( BabelFormatCapability )
864  Q_FLAG( BabelFormatCapabilities )
865 
866 
872  enum class BabelCommandFlag : int
873  {
874  QuoteFilePaths = 1 << 0,
875  };
877  Q_DECLARE_FLAGS( BabelCommandFlags, BabelCommandFlag )
878  Q_ENUM( BabelCommandFlag )
879  Q_FLAG( BabelCommandFlags )
880 
881 
886  enum class GpsFeatureType : int
887  {
888  Waypoint,
889  Route,
890  Track,
891  };
892  Q_ENUM( GpsFeatureType )
893 
894 
902  {
903  Success = 0,
904  NothingHappened = 1000,
905  InvalidBaseGeometry,
906  InvalidInputGeometryType,
907  SelectionIsEmpty,
908  SelectionIsGreaterThanOne,
909  GeometryEngineError,
910  LayerNotEditable,
911  /* Add part issues */
912  AddPartSelectedGeometryNotFound,
913  AddPartNotMultiGeometry,
914  /* Add ring issues*/
915  AddRingNotClosed,
916  AddRingNotValid,
917  AddRingCrossesExistingRings,
918  AddRingNotInExistingFeature,
919  /* Split features */
920  SplitCannotSplitPoint,
921  };
922  Q_ENUM( GeometryOperationResult )
923 
924 
930  {
931  AllowSelfTouchingHoles SIP_MONKEYPATCH_COMPAT_NAME( FlagAllowSelfTouchingHoles ) = 1 << 0,
932  };
935  Q_ENUM( GeometryValidityFlag )
936  Q_FLAG( GeometryValidityFlags )
937 
938 
943  {
944  QgisInternal SIP_MONKEYPATCH_COMPAT_NAME( ValidatorQgisInternal ),
945  Geos SIP_MONKEYPATCH_COMPAT_NAME( ValidatorGeos ),
946  };
947  Q_ENUM( GeometryValidationEngine )
948 
949 
955  {
956  Left SIP_MONKEYPATCH_COMPAT_NAME( SideLeft ) = 0,
957  Right SIP_MONKEYPATCH_COMPAT_NAME( SideRight ),
958  };
959  Q_ENUM( BufferSide )
960 
961 
967  {
968  Round SIP_MONKEYPATCH_COMPAT_NAME( CapRound ) = 1,
969  Flat SIP_MONKEYPATCH_COMPAT_NAME( CapFlat ),
970  Square SIP_MONKEYPATCH_COMPAT_NAME( CapSquare ),
971  };
972  Q_ENUM( EndCapStyle )
973 
974 
980  {
981  Round SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleRound ) = 1,
982  Miter SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleMiter ),
983  Bevel SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleBevel ),
984  };
985  Q_ENUM( JoinStyle )
986 
987 
992  enum class SpatialFilterType : int
993  {
994  NoFilter,
995  BoundingBox,
996  DistanceWithin,
997  };
998  Q_ENUM( SpatialFilterType )
999 
1000 
1005  enum class FileOperationFlag : int
1006  {
1007  IncludeMetadataFile = 1 << 0,
1008  IncludeStyleFile = 1 << 1,
1009  };
1011  Q_DECLARE_FLAGS( FileOperationFlags, FileOperationFlag )
1012  Q_ENUM( FileOperationFlag )
1013  Q_FLAG( FileOperationFlags )
1014 
1015 
1020  enum class MapLayerProperty : int
1021  {
1022  UsersCannotToggleEditing = 1 << 0,
1023  IsBasemapLayer = 1 << 1,
1024  };
1026  Q_DECLARE_FLAGS( MapLayerProperties, MapLayerProperty )
1027  Q_ENUM( MapLayerProperty )
1028  Q_FLAG( MapLayerProperties )
1029 
1030 
1035  enum class DataProviderFlag : int
1036  {
1037  IsBasemapSource = 1 << 1,
1038  };
1040  Q_DECLARE_FLAGS( DataProviderFlags, DataProviderFlag )
1041  Q_ENUM( DataProviderFlag )
1042  Q_FLAG( DataProviderFlags )
1043 
1044 
1051  enum class CrsAxisDirection : int
1052  {
1053  North,
1054  NorthNorthEast,
1055  NorthEast,
1056  EastNorthEast,
1057  East,
1058  EastSouthEast,
1059  SouthEast,
1060  SouthSouthEast,
1061  South,
1062  SouthSouthWest,
1063  SouthWest,
1064  WestSouthWest,
1065  West,
1066  WestNorthWest,
1067  NorthWest,
1068  NorthNorthWest,
1069  GeocentricX,
1070  GeocentricY,
1071  GeocentricZ,
1072  Up,
1073  Down,
1074  Forward,
1075  Aft,
1076  Port,
1077  Starboard,
1078  Clockwise,
1079  CounterClockwise,
1080  ColumnPositive,
1081  ColumnNegative,
1082  RowPositive,
1083  RowNegative,
1084  DisplayRight,
1085  DisplayLeft,
1086  DisplayUp,
1087  DisplayDown,
1088  Future,
1089  Past,
1090  Towards,
1091  AwayFrom,
1092  Unspecified,
1093  };
1094  Q_ENUM( CrsAxisDirection )
1095 
1096 
1101  enum class CoordinateOrder : int
1102  {
1103  Default,
1104  XY,
1105  YX,
1106  };
1107  Q_ENUM( CoordinateOrder )
1108 
1109 
1114  enum class AnnotationItemFlag : int
1115  {
1116  ScaleDependentBoundingBox = 1 << 0,
1117  };
1119  Q_DECLARE_FLAGS( AnnotationItemFlags, AnnotationItemFlag )
1120  Q_ENUM( AnnotationItemFlag )
1121  Q_FLAG( AnnotationItemFlags )
1122 
1123 
1128  enum class AnnotationItemGuiFlag : int
1129  {
1130  FlagNoCreationTools = 1 << 0,
1131  };
1133  Q_DECLARE_FLAGS( AnnotationItemGuiFlags, AnnotationItemGuiFlag )
1134  Q_ENUM( AnnotationItemGuiFlag )
1135  Q_FLAG( AnnotationItemGuiFlags )
1136 
1137 
1142  enum class AnnotationItemNodeType : int
1143  {
1144  VertexHandle,
1145  };
1146  Q_ENUM( AnnotationItemNodeType )
1147 
1148 
1154  {
1155  Success,
1156  Invalid,
1157  ItemCleared,
1158  };
1159  Q_ENUM( AnnotationItemEditOperationResult )
1160 
1161 
1167  {
1168  FixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ModeFixedTemporalRange ) = 0,
1169  FeatureDateTimeInstantFromField SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeInstantFromField ),
1170  FeatureDateTimeStartAndEndFromFields SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndEndFromFields ),
1171  FeatureDateTimeStartAndDurationFromFields SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndDurationFromFields ),
1172  FeatureDateTimeStartAndEndFromExpressions SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndEndFromExpressions ),
1173  RedrawLayerOnly SIP_MONKEYPATCH_COMPAT_NAME( ModeRedrawLayerOnly ),
1174  };
1175  Q_ENUM( VectorTemporalMode )
1176 
1177 
1182  enum class VectorTemporalLimitMode : int
1183  {
1184  IncludeBeginExcludeEnd = 0,
1185  IncludeBeginIncludeEnd,
1186  };
1187  Q_ENUM( VectorTemporalLimitMode )
1188 
1189 
1195  {
1196  HasFixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ProviderHasFixedTemporalRange ) = 0,
1197  StoresFeatureDateTimeInstantInField SIP_MONKEYPATCH_COMPAT_NAME( ProviderStoresFeatureDateTimeInstantInField ),
1198  StoresFeatureDateTimeStartAndEndInSeparateFields SIP_MONKEYPATCH_COMPAT_NAME( ProviderStoresFeatureDateTimeStartAndEndInSeparateFields ),
1199  };
1200  Q_ENUM( VectorDataProviderTemporalMode )
1201 
1202 
1208  {
1209  FixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ModeFixedTemporalRange ) = 0,
1210  TemporalRangeFromDataProvider SIP_MONKEYPATCH_COMPAT_NAME( ModeTemporalRangeFromDataProvider ) = 1,
1211  RedrawLayerOnly SIP_MONKEYPATCH_COMPAT_NAME( ModeRedrawLayerOnly ) = 2,
1212  };
1213  Q_ENUM( RasterTemporalMode )
1214 
1215 
1221  {
1222  MatchUsingWholeRange,
1223  MatchExactUsingStartOfRange,
1224  MatchExactUsingEndOfRange,
1225  FindClosestMatchToStartOfRange,
1226  FindClosestMatchToEndOfRange
1227  };
1228  Q_ENUM( TemporalIntervalMatchMethod )
1229 
1230 
1236  {
1237  RequestedTimesMustExactlyMatchAllAvailableTemporalRanges = 1 << 0,
1238  };
1239  Q_ENUM( RasterTemporalCapabilityFlag )
1240 
1241 
1246  Q_DECLARE_FLAGS( RasterTemporalCapabilityFlags, RasterTemporalCapabilityFlag )
1247  Q_ENUM( RasterTemporalCapabilityFlags )
1248 
1249 
1255  {
1256  Forward SIP_MONKEYPATCH_COMPAT_NAME( ForwardTransform ),
1257  Reverse SIP_MONKEYPATCH_COMPAT_NAME( ReverseTransform )
1258  };
1259  Q_ENUM( TransformDirection )
1260 
1261 
1267  {
1268  BallparkTransformsAreAppropriate = 1 << 0,
1269  IgnoreImpossibleTransformations = 1 << 1,
1270  };
1271  Q_ENUM( CoordinateTransformationFlag )
1272 
1273 
1278  Q_DECLARE_FLAGS( CoordinateTransformationFlags, CoordinateTransformationFlag )
1279  Q_ENUM( CoordinateTransformationFlags )
1280 
1281 
1287  {
1288  Antialiasing = 0x01,
1289  DrawEditingInfo = 0x02,
1290  ForceVectorOutput = 0x04,
1291  UseAdvancedEffects = 0x08,
1292  DrawLabeling = 0x10,
1293  UseRenderingOptimization = 0x20,
1294  DrawSelection = 0x40,
1295  DrawSymbolBounds = 0x80,
1296  RenderMapTile = 0x100,
1297  RenderPartialOutput = 0x200,
1298  RenderPreviewJob = 0x400,
1299  RenderBlocking = 0x800,
1300  LosslessImageRendering = 0x1000,
1301  Render3DMap = 0x2000,
1302  HighQualityImageTransforms = 0x4000,
1303  SkipSymbolRendering = 0x8000,
1304  };
1307  Q_ENUM( MapSettingsFlag )
1308  Q_FLAG( MapSettingsFlags )
1309 
1310 
1316  {
1317  DrawEditingInfo = 0x01,
1318  ForceVectorOutput = 0x02,
1319  UseAdvancedEffects = 0x04,
1320  UseRenderingOptimization = 0x08,
1321  DrawSelection = 0x10,
1322  DrawSymbolBounds = 0x20,
1323  RenderMapTile = 0x40,
1324  Antialiasing = 0x80,
1325  RenderPartialOutput = 0x100,
1326  RenderPreviewJob = 0x200,
1327  RenderBlocking = 0x400,
1328  RenderSymbolPreview = 0x800,
1329  LosslessImageRendering = 0x1000,
1330  ApplyScalingWorkaroundForTextRendering = 0x2000,
1331  Render3DMap = 0x4000,
1332  ApplyClipAfterReprojection = 0x8000,
1333  RenderingSubSymbol = 0x10000,
1334  HighQualityImageTransforms = 0x20000,
1335  SkipSymbolRendering = 0x40000,
1336  };
1339  Q_ENUM( RenderContextFlag )
1340  Q_FLAG( RenderContextFlags )
1341 
1342  // refs for below dox: https://github.com/qgis/QGIS/pull/1286#issuecomment-39806854
1343  // https://github.com/qgis/QGIS/pull/8573#issuecomment-445585826
1344 
1345 
1350  {
1351  AlwaysOutlines SIP_MONKEYPATCH_COMPAT_NAME( TextFormatAlwaysOutlines ),
1352  AlwaysText SIP_MONKEYPATCH_COMPAT_NAME( TextFormatAlwaysText ),
1353  };
1354  Q_ENUM( TextRenderFormat )
1355 
1356 
1362  {
1363  Generic,
1364  ShadowOffset,
1365  BlurSize,
1366  GlowSpread,
1367  };
1368  Q_ENUM( RenderSubcomponentProperty )
1369 
1370 
1375  {
1376  Segment SIP_MONKEYPATCH_COMPAT_NAME( SegmentVertex ) = 1,
1377  Curve SIP_MONKEYPATCH_COMPAT_NAME( CurveVertex ) = 2,
1378  };
1379  Q_ENUM( VertexType )
1380 
1381 
1389  {
1390  Square,
1391  Diamond,
1392  Pentagon,
1393  Hexagon,
1394  Triangle,
1395  EquilateralTriangle,
1396  Star,
1397  Arrow,
1398  Circle,
1399  Cross,
1400  CrossFill,
1401  Cross2,
1402  Line,
1403  ArrowHead,
1404  ArrowHeadFilled,
1405  SemiCircle,
1406  ThirdCircle,
1407  QuarterCircle,
1408  QuarterSquare,
1409  HalfSquare,
1410  DiagonalHalfSquare,
1411  RightHalfTriangle,
1412  LeftHalfTriangle,
1413  Octagon,
1414  SquareWithCorners,
1415  AsteriskFill,
1416  HalfArc,
1417  ThirdArc,
1418  QuarterArc,
1419  };
1420  Q_ENUM( MarkerShape )
1421 
1422 
1430  {
1431  Interval = 1 << 0,
1432  Vertex = 1 << 1,
1433  LastVertex = 1 << 2,
1434  FirstVertex = 1 << 3,
1435  CentralPoint = 1 << 4,
1436  CurvePoint = 1 << 5,
1437  SegmentCenter = 1 << 6,
1438  InnerVertices = 1 << 7,
1439  };
1440  Q_ENUM( MarkerLinePlacement )
1441  Q_DECLARE_FLAGS( MarkerLinePlacements, MarkerLinePlacement )
1442  Q_FLAG( MarkerLinePlacements )
1443 
1444 
1452  {
1453  SimpleTwoColor,
1454  ColorRamp,
1455  };
1456  Q_ENUM( GradientColorSource )
1457 
1458 
1466  {
1467  Linear,
1468  Radial,
1469  Conical,
1470  };
1471  Q_ENUM( GradientType )
1472 
1473 
1481  {
1482  Feature,
1483  Viewport,
1484  };
1485  Q_ENUM( SymbolCoordinateReference )
1486 
1487 
1496  {
1497  Pad,
1498  Reflect,
1499  Repeat,
1500  };
1501  Q_ENUM( GradientSpread )
1502 
1503 
1511  {
1512  Absolute SIP_MONKEYPATCH_COMPAT_NAME( AbsoluteCount ),
1513  DensityBased SIP_MONKEYPATCH_COMPAT_NAME( DensityBasedCount ),
1514  };
1515  Q_ENUM( PointCountMethod )
1516 
1517 
1522  enum class MarkerClipMode : int
1523  {
1524  NoClipping,
1525  Shape,
1526  CentroidWithin,
1527  CompletelyWithin,
1528  };
1529  Q_ENUM( MarkerClipMode )
1530 
1531 
1536  enum class LineClipMode : int
1537  {
1538  ClipPainterOnly,
1539  ClipToIntersection,
1540  NoClipping,
1541  };
1542  Q_ENUM( LineClipMode )
1543 
1544 
1549  enum class DashPatternLineEndingRule : int
1550  {
1551  NoRule,
1552  FullDash,
1553  HalfDash,
1554  FullGap,
1555  HalfGap,
1556  };
1557  Q_ENUM( DashPatternLineEndingRule )
1558 
1559 
1564  enum class DashPatternSizeAdjustment : int
1565  {
1566  ScaleBothDashAndGap,
1567  ScaleDashOnly,
1568  ScaleGapOnly,
1569  };
1570  Q_ENUM( DashPatternSizeAdjustment )
1571 
1572 
1580  {
1581  Color SIP_MONKEYPATCH_COMPAT_NAME( GraduatedColor ),
1582  Size SIP_MONKEYPATCH_COMPAT_NAME( GraduatedSize ),
1583  };
1584  Q_ENUM( GraduatedMethod )
1585 
1586 
1590  enum class DpiMode
1591  {
1592  All = 7,
1593  Off = 0,
1594  QGIS = 1,
1595  UMN = 2,
1596  GeoServer = 4,
1597  };
1598  Q_ENUM( DpiMode )
1599 
1600 
1601  // NOTE -- the hardcoded numbers here must match QFont::Capitalization!
1602 
1603 
1611  {
1612  MixedCase = 0,
1613  AllUppercase = 1,
1614  AllLowercase = 2,
1615  ForceFirstLetterToCapital = 4,
1616  SmallCaps = 5,
1617  TitleCase = 1004,
1618  UpperCamelCase = 1005,
1619  AllSmallCaps = 1006,
1620  };
1621  Q_ENUM( Capitalization )
1622 
1623 
1628  enum class TextRendererFlag : int
1629  {
1630  WrapLines = 1 << 0,
1631  };
1632  Q_ENUM( TextRendererFlag )
1633  Q_DECLARE_FLAGS( TextRendererFlags, TextRendererFlag )
1634  Q_FLAG( TextRendererFlags )
1635 
1636 
1642  {
1643  MapBox,
1644  Esri,
1645  };
1647 
1654  {
1655  Clockwise,
1656  CounterClockwise,
1657  };
1658  Q_ENUM( AngularDirection )
1659 
1660 
1665  enum class RendererUsage : int
1666  {
1667  View,
1668  Export,
1669  Unknown,
1670  };
1671  Q_ENUM( RendererUsage )
1672 
1673 
1678  enum class ViewSyncModeFlag : int
1679  {
1680  Sync3DTo2D = 1 << 0,
1681  Sync2DTo3D = 1 << 1,
1682  };
1683  Q_ENUM( ViewSyncModeFlag )
1684  Q_DECLARE_FLAGS( ViewSyncModeFlags, ViewSyncModeFlag )
1685 
1686 
1691  enum class HistoryProviderBackend : int
1692  {
1693  LocalProfile = 1 << 0,
1694 // Project = 1 << 1, //!< QGIS Project (not yet implemented)
1695  };
1696  Q_ENUM( HistoryProviderBackend )
1697  Q_DECLARE_FLAGS( HistoryProviderBackends, HistoryProviderBackend )
1698  Q_FLAG( HistoryProviderBackends )
1699 
1700 
1706  {
1707  Wkt SIP_MONKEYPATCH_COMPAT_NAME( FormatWkt ),
1708  Proj SIP_MONKEYPATCH_COMPAT_NAME( FormatProj ),
1709  };
1710  Q_ENUM( CrsDefinitionFormat )
1711 
1712 
1720  enum class FieldDomainSplitPolicy : int
1721  {
1722  DefaultValue,
1723  Duplicate,
1724  GeometryRatio,
1725  };
1726  Q_ENUM( FieldDomainSplitPolicy )
1727 
1728 
1736  enum class FieldDomainMergePolicy : int
1737  {
1738  DefaultValue,
1739  Sum,
1740  GeometryWeighted,
1741  };
1742  Q_ENUM( FieldDomainMergePolicy )
1743 
1744 
1749  enum class FieldDomainType : int
1750  {
1751  Coded,
1752  Range,
1753  Glob,
1754  };
1755  Q_ENUM( FieldDomainType )
1756 
1757 
1762  enum class TransactionMode : int
1763  {
1764  Disabled = 0,
1765  AutomaticGroups = 1,
1766  BufferedGroups = 2,
1767  };
1768  Q_ENUM( TransactionMode )
1769 
1770 
1775  enum class AltitudeClamping : int
1776  {
1777  Absolute,
1778  Relative,
1779  Terrain,
1780  };
1781  Q_ENUM( AltitudeClamping )
1782 
1783 
1788  enum class AltitudeBinding : int
1789  {
1790  Vertex,
1791  Centroid,
1792  };
1793  Q_ENUM( AltitudeBinding )
1794 
1795 
1801  {
1802  NoConstraint,
1803  Perpendicular,
1804  Parallel
1805  };
1806  Q_ENUM( BetweenLineConstraint )
1807 
1808 
1813  enum class LineExtensionSide : int
1814  {
1815  BeforeVertex,
1816  AfterVertex,
1817  NoVertex,
1818  };
1819  Q_ENUM( LineExtensionSide )
1820 
1821 
1826  enum class ProjectFlag : int
1827  {
1828  EvaluateDefaultValuesOnProviderSide = 1 << 0,
1829  TrustStoredLayerStatistics = 1 << 1,
1830  RememberLayerEditStatusBetweenSessions = 1 << 2,
1831  RememberAttributeTableWindowsBetweenSessions = 1 << 3,
1832  };
1833  Q_ENUM( ProjectFlag )
1834  Q_DECLARE_FLAGS( ProjectFlags, ProjectFlag )
1835  Q_FLAG( ProjectFlags )
1836 
1837 
1842  enum class PlotToolFlag : int
1843  {
1844  ShowContextMenu = 1 << 0,
1845  };
1846  Q_ENUM( PlotToolFlag )
1847  Q_DECLARE_FLAGS( PlotToolFlags, PlotToolFlag )
1848  Q_FLAG( PlotToolFlags )
1849 
1850 
1855  enum class LightSourceType : int
1856  {
1857  Point,
1858  Directional,
1859  };
1860  Q_ENUM( LightSourceType )
1861 
1862 
1867  enum class ProfileSurfaceSymbology : int
1868  {
1869  Line,
1870  FillBelow,
1871  };
1873 
1879  enum class VectorProfileType : int
1880  {
1881  IndividualFeatures,
1882  ContinuousSurface,
1883  };
1885 
1891  enum class ProfileGeneratorFlag : int
1892  {
1893  RespectsMaximumErrorMapUnit = 1 << 0,
1894  RespectsDistanceRange = 1 << 1,
1895  RespectsElevationRange = 1 << 2,
1896  };
1897  Q_ENUM( ProfileGeneratorFlag )
1898  Q_DECLARE_FLAGS( ProfileGeneratorFlags, ProfileGeneratorFlag )
1899  Q_FLAG( ProfileGeneratorFlags )
1900 
1901 
1907  {
1908  Square,
1909  Circle,
1910  };
1911  Q_ENUM( PointCloudSymbol )
1912 
1913 
1919  {
1920  Default,
1921  BottomToTop,
1922  TopToBottom,
1923  };
1924  Q_ENUM( PointCloudDrawOrder )
1925 
1926 
1934  {
1935  AllowIntersections,
1936  AvoidIntersectionsCurrentLayer,
1937  AvoidIntersectionsLayers,
1938  };
1939  Q_ENUM( AvoidIntersectionsMode )
1940 
1941 
1949  {
1950  Qgz,
1951  Qgs,
1952  };
1953  Q_ENUM( ProjectFileFormat )
1954 
1955 
1963  {
1964  DontResolveLayers SIP_MONKEYPATCH_COMPAT_NAME( FlagDontResolveLayers ) = 1 << 0,
1965  DontLoadLayouts SIP_MONKEYPATCH_COMPAT_NAME( FlagDontLoadLayouts ) = 1 << 1,
1966  TrustLayerMetadata SIP_MONKEYPATCH_COMPAT_NAME( FlagTrustLayerMetadata ) = 1 << 2,
1967  DontStoreOriginalStyles SIP_MONKEYPATCH_COMPAT_NAME( FlagDontStoreOriginalStyles ) = 1 << 3,
1968  DontLoad3DViews SIP_MONKEYPATCH_COMPAT_NAME( FlagDontLoad3DViews ) = 1 << 4,
1969  DontLoadProjectStyles = 1 << 5,
1970  };
1971  Q_ENUM( ProjectReadFlag )
1972 
1973 
1980  Q_DECLARE_FLAGS( ProjectReadFlags, ProjectReadFlag ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsProject, ReadFlags )
1981  Q_FLAG( ProjectReadFlags )
1982 
1987  static const double DEFAULT_SEARCH_RADIUS_MM;
1988 
1990  static const float DEFAULT_MAPTOPIXEL_THRESHOLD;
1991 
1998  static const QColor DEFAULT_HIGHLIGHT_COLOR;
1999 
2004  static const double DEFAULT_HIGHLIGHT_BUFFER_MM;
2005 
2010  static const double DEFAULT_HIGHLIGHT_MIN_WIDTH_MM;
2011 
2018  static const double SCALE_PRECISION;
2019 
2025  static const double DEFAULT_Z_COORDINATE;
2026 
2032  static const double DEFAULT_M_COORDINATE;
2033 
2039  static const double UI_SCALE_FACTOR;
2040 
2045  static const double DEFAULT_SNAP_TOLERANCE;
2046 
2051  static const QgsTolerance::UnitType DEFAULT_SNAP_UNITS;
2052 
2058  static QString defaultProjectScales();
2059 
2065  static int geosVersionInt();
2066 
2072  static int geosVersionMajor();
2073 
2079  static int geosVersionMinor();
2080 
2086  static int geosVersionPatch();
2087 
2093  static QString geosVersion();
2094 };
2095 
2097 
2098 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolRenderHints )
2099 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolFlags )
2100 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolPreviewFlags )
2101 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolLayerFlags )
2102 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BrowserItemCapabilities )
2103 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SublayerQueryFlags )
2104 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SublayerFlags )
2105 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SqlLayerDefinitionCapabilities )
2106 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BabelFormatCapabilities )
2107 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BabelCommandFlags )
2108 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::GeometryValidityFlags )
2109 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::FileOperationFlags )
2110 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::AnnotationItemFlags )
2111 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::AnnotationItemGuiFlags )
2112 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MapSettingsFlags )
2113 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::RenderContextFlags )
2114 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::VectorLayerTypeFlags )
2115 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MarkerLinePlacements )
2116 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::TextRendererFlags )
2117 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::HistoryProviderBackends )
2118 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MapLayerProperties )
2119 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::DataProviderFlags )
2120 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SnappingTypes )
2121 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::PlotToolFlags )
2122 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::ProfileGeneratorFlags )
2123 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::ProjectReadFlags )
2124 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::CoordinateTransformationFlags )
2125 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::RasterTemporalCapabilityFlags )
2126 
2127 
2128 // hack to workaround warnings when casting void pointers
2129 // retrieved from QLibrary::resolve to function pointers.
2130 // It's assumed that this works on all systems supporting
2131 // QLibrary
2132 #define cast_to_fptr(f) f
2133 
2134 
2143 // based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
2144 template<class Object> class QgsSignalBlocker SIP_SKIP SIP_SKIP // clazy:exclude=rule-of-three
2145 {
2146  public:
2147 
2152  explicit QgsSignalBlocker( Object * object )
2153  : mObject( object )
2154  , mPreviousState( object->blockSignals( true ) )
2155  {}
2156 
2158  {
2159  mObject->blockSignals( mPreviousState );
2160  }
2161 
2163  Object *operator->() { return mObject; }
2164 
2165  private:
2166 
2167  Object *mObject = nullptr;
2168  bool mPreviousState;
2169 
2170 };
2171 
2185 // based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
2186 template<class Object> inline QgsSignalBlocker<Object> whileBlocking( Object *object ) SIP_SKIP SIP_SKIP
2187 {
2188  return QgsSignalBlocker<Object>( object );
2189 }
2190 
2192 CORE_EXPORT uint qHash( const QVariant &variant );
2193 
2199 inline QString qgsDoubleToString( double a, int precision = 17 )
2200 {
2201  QString str;
2202  if ( precision )
2203  {
2204  if ( precision < 0 )
2205  {
2206  const double roundFactor = std::pow( 10, -precision );
2207  str = QString::number( static_cast< long long >( std::round( a / roundFactor ) * roundFactor ) );
2208  }
2209  else
2210  {
2211  str = QString::number( a, 'f', precision );
2212  if ( str.contains( QLatin1Char( '.' ) ) )
2213  {
2214  // remove ending 0s
2215  int idx = str.length() - 1;
2216  while ( str.at( idx ) == '0' && idx > 1 )
2217  {
2218  idx--;
2219  }
2220  if ( idx < str.length() - 1 )
2221  str.truncate( str.at( idx ) == '.' ? idx : idx + 1 );
2222  }
2223  }
2224  }
2225  else
2226  {
2227  str = QString::number( a, 'f', precision );
2228  }
2229  // avoid printing -0
2230  // see https://bugreports.qt.io/browse/QTBUG-71439
2231  if ( str == QLatin1String( "-0" ) )
2232  {
2233  return QLatin1String( "0" );
2234  }
2235  return str;
2236 }
2237 
2244 inline bool qgsNanCompatibleEquals( double a, double b )
2245 {
2246  const bool aIsNan = std::isnan( a );
2247  const bool bIsNan = std::isnan( b );
2248  if ( aIsNan || bIsNan )
2249  return aIsNan && bIsNan;
2250 
2251  return a == b;
2252 }
2253 
2260 inline bool qgsDoubleNear( double a, double b, double epsilon = 4 * std::numeric_limits<double>::epsilon() )
2261 {
2262  const bool aIsNan = std::isnan( a );
2263  const bool bIsNan = std::isnan( b );
2264  if ( aIsNan || bIsNan )
2265  return aIsNan && bIsNan;
2266 
2267  const double diff = a - b;
2268  return diff > -epsilon && diff <= epsilon;
2269 }
2270 
2277 inline bool qgsFloatNear( float a, float b, float epsilon = 4 * FLT_EPSILON )
2278 {
2279  const bool aIsNan = std::isnan( a );
2280  const bool bIsNan = std::isnan( b );
2281  if ( aIsNan || bIsNan )
2282  return aIsNan && bIsNan;
2283 
2284  const float diff = a - b;
2285  return diff > -epsilon && diff <= epsilon;
2286 }
2287 
2289 inline bool qgsDoubleNearSig( double a, double b, int significantDigits = 10 )
2290 {
2291  const bool aIsNan = std::isnan( a );
2292  const bool bIsNan = std::isnan( b );
2293  if ( aIsNan || bIsNan )
2294  return aIsNan && bIsNan;
2295 
2296  // The most simple would be to print numbers as %.xe and compare as strings
2297  // but that is probably too costly
2298  // Then the fastest would be to set some bits directly, but little/big endian
2299  // has to be considered (maybe TODO)
2300  // Is there a better way?
2301  int aexp, bexp;
2302  const double ar = std::frexp( a, &aexp );
2303  const double br = std::frexp( b, &bexp );
2304 
2305  return aexp == bexp &&
2306  std::round( ar * std::pow( 10.0, significantDigits ) ) == std::round( br * std::pow( 10.0, significantDigits ) );
2307 }
2308 
2314 inline double qgsRound( double number, int places )
2315 {
2316  const double m = ( number < 0.0 ) ? -1.0 : 1.0;
2317  const double scaleFactor = std::pow( 10.0, places );
2318  return ( std::round( number * m * scaleFactor ) / scaleFactor ) * m;
2319 }
2320 
2321 
2322 #ifndef SIP_RUN
2323 
2325 
2335 namespace qgis
2336 {
2337 
2350  template<typename To, typename From> inline To down_cast( From *f )
2351  {
2352  static_assert(
2353  ( std::is_base_of<From,
2354  typename std::remove_pointer<To>::type>::value ),
2355  "target type not derived from source type" );
2356  Q_ASSERT( f == nullptr || dynamic_cast<To>( f ) != nullptr );
2357  return static_cast<To>( f );
2358  }
2359 
2360  template<class T>
2361  QSet<T> listToSet( const QList<T> &list )
2362  {
2363 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
2364  return list.toSet();
2365 #else
2366  return QSet<T>( list.begin(), list.end() );
2367 #endif
2368  }
2369 
2370  template<class T>
2371  QList<T> setToList( const QSet<T> &set )
2372  {
2373 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
2374  return set.toList();
2375 #else
2376  return QList<T>( set.begin(), set.end() );
2377 #endif
2378  }
2379 }
2380 
2381 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
2382 namespace std
2383 {
2384  template<> struct hash<QString>
2385  {
2386  std::size_t operator()( const QString &s ) const noexcept
2387  {
2388  return ( size_t ) qHash( s );
2389  }
2390  };
2391 }
2392 #endif
2393 
2395 #endif
2396 
2401 template<class T> const QList<T> qgsEnumList() SIP_SKIP
2402 {
2403  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2404  Q_ASSERT( metaEnum.isValid() );
2405  QList<T> enumList;
2406  for ( int idx = 0; idx < metaEnum.keyCount(); ++idx )
2407  {
2408  enumList.append( static_cast<T>( metaEnum.value( idx ) ) );
2409  }
2410  return enumList;
2411 }
2412 
2418 template<class T> const QMap<T, QString> qgsEnumMap() SIP_SKIP
2419 {
2420  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2421  Q_ASSERT( metaEnum.isValid() );
2422  QMap<T, QString> enumMap;
2423  for ( int idx = 0; idx < metaEnum.keyCount(); ++idx )
2424  {
2425  enumMap.insert( static_cast<T>( metaEnum.value( idx ) ), QString( metaEnum.key( idx ) ) );
2426  }
2427  return enumMap;
2428 }
2429 
2435 template<class T> QString qgsEnumValueToKey( const T &value, bool *returnOk = nullptr ) SIP_SKIP
2436 {
2437  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2438  Q_ASSERT( metaEnum.isValid() );
2439  const char *key = metaEnum.valueToKey( static_cast<int>( value ) );
2440  if ( returnOk )
2441  {
2442  *returnOk = key ? true : false;
2443  }
2444  return QString::fromUtf8( key );
2445 }
2446 
2454 template<class T> T qgsEnumKeyToValue( const QString &key, const T &defaultValue, bool tryValueAsKey = true, bool *returnOk = nullptr ) SIP_SKIP
2455 {
2456  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2457  Q_ASSERT( metaEnum.isValid() );
2458  bool ok = false;
2459  T v = static_cast<T>( metaEnum.keyToValue( key.toUtf8().data(), &ok ) );
2460  if ( returnOk )
2461  {
2462  *returnOk = ok;
2463  }
2464  if ( ok )
2465  {
2466  return v;
2467  }
2468  else
2469  {
2470  // if conversion has failed, try with conversion from int value
2471  if ( tryValueAsKey )
2472  {
2473  bool canConvert = false;
2474  const int intValue = key.toInt( &canConvert );
2475  if ( canConvert && metaEnum.valueToKey( intValue ) )
2476  {
2477  if ( returnOk )
2478  {
2479  *returnOk = true;
2480  }
2481  return static_cast<T>( intValue );
2482  }
2483  }
2484  }
2485  return defaultValue;
2486 }
2487 
2493 template<class T> QString qgsFlagValueToKeys( const T &value, bool *returnOk = nullptr ) SIP_SKIP
2494 {
2495  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2496  Q_ASSERT( metaEnum.isValid() );
2497  int intValue = static_cast<int>( value );
2498  const QByteArray ba = metaEnum.valueToKeys( intValue );
2499  // check that the int value does correspond to a flag
2500  // see https://stackoverflow.com/a/68495949/1548052
2501  const int intValueCheck = metaEnum.keysToValue( ba );
2502  bool ok = intValue == intValueCheck;
2503  if ( returnOk )
2504  *returnOk = ok;
2505  return ok ? QString::fromUtf8( ba ) : QString();
2506 }
2507 
2515 template<class T> T qgsFlagKeysToValue( const QString &keys, const T &defaultValue, bool tryValueAsKey = true, bool *returnOk = nullptr ) SIP_SKIP
2516 {
2517  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2518  Q_ASSERT( metaEnum.isValid() );
2519  bool ok = false;
2520  T v = static_cast<T>( metaEnum.keysToValue( keys.toUtf8().constData(), &ok ) );
2521  if ( returnOk )
2522  {
2523  *returnOk = ok;
2524  }
2525  if ( ok )
2526  {
2527  return v;
2528  }
2529  else
2530  {
2531  // if conversion has failed, try with conversion from int value
2532  if ( tryValueAsKey )
2533  {
2534  bool canConvert = false;
2535  const int intValue = keys.toInt( &canConvert );
2536  if ( canConvert )
2537  {
2538  const QByteArray keys = metaEnum.valueToKeys( intValue );
2539  const int intValueCheck = metaEnum.keysToValue( keys );
2540  if ( intValue == intValueCheck )
2541  {
2542  if ( returnOk )
2543  {
2544  *returnOk = true;
2545  }
2546  return T( intValue );
2547  }
2548  }
2549  }
2550  }
2551  return defaultValue;
2552 }
2553 
2554 
2564 CORE_EXPORT double qgsPermissiveToDouble( QString string, bool &ok );
2565 
2575 CORE_EXPORT int qgsPermissiveToInt( QString string, bool &ok );
2576 
2586 CORE_EXPORT qlonglong qgsPermissiveToLongLong( QString string, bool &ok );
2587 
2597 CORE_EXPORT bool qgsVariantLessThan( const QVariant &lhs, const QVariant &rhs );
2598 
2607 CORE_EXPORT bool qgsVariantEqual( const QVariant &lhs, const QVariant &rhs );
2608 
2615 CORE_EXPORT bool qgsVariantGreaterThan( const QVariant &lhs, const QVariant &rhs );
2616 
2617 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
2618 
2625 inline bool operator> ( const QVariant &v1, const QVariant &v2 )
2626 {
2627  return qgsVariantGreaterThan( v1, v2 );
2628 }
2629 
2639 inline bool operator< ( const QVariant &v1, const QVariant &v2 )
2640 {
2641  return qgsVariantLessThan( v1, v2 );
2642 }
2643 #endif
2644 
2645 
2646 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
2647 
2651 template<> CORE_EXPORT bool qMapLessThanKey<QVariantList>( const QVariantList &key1, const QVariantList &key2 ) SIP_SKIP;
2652 #endif
2653 
2654 CORE_EXPORT QString qgsVsiPrefix( const QString &path );
2655 
2661 void CORE_EXPORT *qgsMalloc( size_t size ) SIP_SKIP;
2662 
2667 void CORE_EXPORT qgsFree( void *ptr ) SIP_SKIP;
2668 
2669 #ifndef SIP_RUN
2670 
2671 #ifdef _MSC_VER
2672 #define CONSTLATIN1STRING inline const QLatin1String
2673 #else
2674 #define CONSTLATIN1STRING constexpr QLatin1String
2675 #endif
2676 
2678 class ScopedIntIncrementor
2679 {
2680  public:
2681 
2682  ScopedIntIncrementor( int *variable )
2683  : mVariable( variable )
2684  {
2685  ( *mVariable )++;
2686  }
2687 
2688  ScopedIntIncrementor( const ScopedIntIncrementor &other ) = delete;
2689  ScopedIntIncrementor &operator=( const ScopedIntIncrementor &other ) = delete;
2690 
2691  void release()
2692  {
2693  if ( mVariable )
2694  ( *mVariable )--;
2695 
2696  mVariable = nullptr;
2697  }
2698 
2699  ~ScopedIntIncrementor()
2700  {
2701  release();
2702  }
2703 
2704  private:
2705  int *mVariable = nullptr;
2706 };
2708 
2714 {
2715  return QLatin1String(
2716  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]] )"""
2717  );
2718 }
2719 
2722 {
2723  return QLatin1String( "+proj=longlat +datum=WGS84 +no_defs" );
2724 }
2725 
2728 {
2729  return QLatin1String( "EPSG:4326" );
2730 }
2731 
2734 {
2735  return QLatin1String( "NONE" );
2736 }
2737 
2739 
2741 const int PREVIEW_JOB_DELAY_MS = 250;
2742 
2744 const int MAXIMUM_LAYER_PREVIEW_TIME_MS = 250;
2745 
2747 
2748 #endif
2749 
2751 const long GEOSRID = 4326;
2752 
2754 const long GEOCRS_ID = 3452;
2755 
2757 const long GEO_EPSG_CRS_ID = 4326;
2758 
2763 const int USER_CRS_START_ID = 100000;
2764 
2765 //
2766 // Constants for point symbols
2767 //
2768 
2770 const double DEFAULT_POINT_SIZE = 2.0;
2771 const double DEFAULT_LINE_WIDTH = 0.26;
2772 
2774 const double DEFAULT_SEGMENT_EPSILON = 1e-8;
2775 
2776 typedef QMap<QString, QString> QgsStringMap SIP_SKIP;
2777 
2786 typedef unsigned long long qgssize;
2787 
2788 #ifndef SIP_RUN
2789 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
2790 
2791 #define Q_NOWARN_DEPRECATED_PUSH \
2792  _Pragma("GCC diagnostic push") \
2793  _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
2794 #define Q_NOWARN_DEPRECATED_POP \
2795  _Pragma("GCC diagnostic pop");
2796 #define Q_NOWARN_UNREACHABLE_PUSH
2797 #define Q_NOWARN_UNREACHABLE_POP
2798 
2799 #elif defined(_MSC_VER)
2800 
2801 #define Q_NOWARN_DEPRECATED_PUSH \
2802  __pragma(warning(push)) \
2803  __pragma(warning(disable:4996))
2804 #define Q_NOWARN_DEPRECATED_POP \
2805  __pragma(warning(pop))
2806 #define Q_NOWARN_UNREACHABLE_PUSH \
2807  __pragma(warning(push)) \
2808  __pragma(warning(disable:4702))
2809 #define Q_NOWARN_UNREACHABLE_POP \
2810  __pragma(warning(pop))
2811 
2812 #else
2813 
2814 #define Q_NOWARN_DEPRECATED_PUSH
2815 #define Q_NOWARN_DEPRECATED_POP
2816 #define Q_NOWARN_UNREACHABLE_PUSH
2817 #define Q_NOWARN_UNREACHABLE_POP
2818 
2819 #endif
2820 #endif
2821 
2822 #ifndef QGISEXTERN
2823 #ifdef Q_OS_WIN
2824 # define QGISEXTERN extern "C" __declspec( dllexport )
2825 #else
2826 # if defined(__GNUC__) || defined(__clang__)
2827 # define QGISEXTERN extern "C" __attribute__ ((visibility ("default")))
2828 # else
2829 # define QGISEXTERN extern "C"
2830 # endif
2831 #endif
2832 #endif
2833 #endif
2834 
2835 #if __cplusplus >= 201500
2836 #define FALLTHROUGH [[fallthrough]];
2837 #elif defined(__clang__)
2838 #define FALLTHROUGH [[clang::fallthrough]];
2839 #elif defined(__GNUC__) && __GNUC__ >= 7
2840 #define FALLTHROUGH [[gnu::fallthrough]];
2841 #else
2842 #define FALLTHROUGH
2843 #endif
2844 
2845 // see https://infektor.net/posts/2017-01-19-using-cpp17-attributes-today.html#using-the-nodiscard-attribute
2846 #if __cplusplus >= 201703L
2847 #define NODISCARD [[nodiscard]]
2848 #elif defined(__clang__)
2849 #define NODISCARD [[nodiscard]]
2850 #elif defined(_MSC_VER)
2851 #define NODISCARD // no support
2852 #elif defined(__has_cpp_attribute)
2853 #if __has_cpp_attribute(nodiscard)
2854 #define NODISCARD [[nodiscard]]
2855 #elif __has_cpp_attribute(gnu::warn_unused_result)
2856 #define NODISCARD [[gnu::warn_unused_result]]
2857 #else
2858 #define NODISCARD Q_REQUIRED_RESULT
2859 #endif
2860 #else
2861 #define NODISCARD Q_REQUIRED_RESULT
2862 #endif
2863 
2864 #if __cplusplus >= 201703L
2865 #define MAYBE_UNUSED [[maybe_unused]]
2866 #elif defined(__clang__)
2867 #define MAYBE_UNUSED [[maybe_unused]]
2868 #elif defined(_MSC_VER)
2869 #define MAYBE_UNUSED // no support
2870 #elif defined(__has_cpp_attribute)
2871 #if __has_cpp_attribute(gnu::unused)
2872 #define MAYBE_UNUSED [[gnu::unused]]
2873 #else
2874 #define MAYBE_UNUSED
2875 #endif
2876 #else
2877 #define MAYBE_UNUSED
2878 #endif
2879 
2880 #ifndef FINAL
2881 #define FINAL final
2882 #endif
2883 
2884 #ifndef SIP_RUN
2885 #ifdef _MSC_VER
2886 #define BUILTIN_UNREACHABLE \
2887  __assume(false);
2888 #elif defined(__GNUC__) && !defined(__clang__)
2889 // Workaround a GCC bug where a -Wreturn-type warning is emitted in constructs
2890 // like:
2891 // switch( mVariableThatCanOnlyBeXorY )
2892 // {
2893 // case X:
2894 // return "foo";
2895 // case Y:
2896 // return "foo";
2897 // }
2898 // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
2899 #define BUILTIN_UNREACHABLE \
2900  __builtin_unreachable();
2901 #else
2902 #define BUILTIN_UNREACHABLE
2903 #endif
2904 #endif // SIP_RUN
2905 
2906 #ifdef SIP_RUN
2907 
2912 QString CORE_EXPORT geoWkt();
2913 
2915 QString CORE_EXPORT geoProj4();
2916 
2918 QString CORE_EXPORT geoEpsgCrsAuthId();
2919 
2921 QString CORE_EXPORT geoNone();
2922 
2923 #endif
The Qgis class provides global constants for use throughout the application.
Definition: qgis.h:72
SettingsOption
Settings options.
Definition: qgis.h:248
ProfileGeneratorFlag
Flags that control the way the QgsAbstractProfileGenerator operate.
Definition: qgis.h:1892
GpsQualityIndicator
GPS signal quality indicator.
Definition: qgis.h:834
ProjectReadFlag
Flags which control project read behavior.
Definition: qgis.h:1963
PointCloudSymbol
Rendering symbols for point cloud points.
Definition: qgis.h:1907
GeometryValidityFlag
Geometry validity check flags.
Definition: qgis.h:930
MapLayerProperty
File operation flags.
Definition: qgis.h:1021
BufferSide
Side of line to buffer.
Definition: qgis.h:955
RasterResamplingStage
Stage at which raster resampling occurs.
Definition: qgis.h:721
AltitudeClamping
Altitude clamping.
Definition: qgis.h:1776
VectorTemporalMode
Vector layer temporal feature modes.
Definition: qgis.h:1167
SublayerFlag
Sublayer query flags.
Definition: qgis.h:690
DashPatternSizeAdjustment
Dash pattern size adjustment options.
Definition: qgis.h:1565
AnnotationItemNodeType
Annotation item GUI flags.
Definition: qgis.h:1143
static const char * QGIS_DEV_VERSION
The development version.
Definition: qgis.h:98
AngularDirection
Angular directions.
Definition: qgis.h:1654
DriveType
Drive types.
Definition: qgis.h:506
ContentStatus
Status for fetched or stored content.
Definition: qgis.h:819
SnappingType
SnappingTypeFlag defines on what object the snapping is performed.
Definition: qgis.h:273
MarkerLinePlacement
Defines how/where the symbols should be placed on a line.
Definition: qgis.h:1430
GeometryOperationResult
Success or failure of a geometry operation.
Definition: qgis.h:902
BrowserItemState
Browser item states.
Definition: qgis.h:368
MarkerClipMode
Marker clipping modes.
Definition: qgis.h:1523
AnnotationItemFlag
Flags for annotation items.
Definition: qgis.h:1115
RenderSubcomponentProperty
Rendering subcomponent properties.
Definition: qgis.h:1362
SymbolRenderHint
Flags controlling behavior of symbols during rendering.
Definition: qgis.h:293
CaptureTechnique
Capture technique.
Definition: qgis.h:153
BrowserItemCapability
Browser item capabilities.
Definition: qgis.h:381
LineClipMode
Line clipping modes.
Definition: qgis.h:1537
BrowserDirectoryMonitoring
Browser directory item monitoring switches.
Definition: qgis.h:426
LabelOffsetType
Behavior modifier for label offset and distance, only applies in some label placement modes.
Definition: qgis.h:608
GradientColorSource
Gradient color sources.
Definition: qgis.h:1452
LabelPlacement
Placement modes which determine how label candidates are generated for a feature.
Definition: qgis.h:561
VectorExportResult
Vector layer export result codes.
Definition: qgis.h:450
RasterTemporalCapabilityFlag
Flags for raster layer temporal capabilities.
Definition: qgis.h:1236
SymbolLayerFlag
Flags controlling behavior of symbol layers.
Definition: qgis.h:335
GradientSpread
Gradient spread options, which control how gradients are rendered outside of their start and end poin...
Definition: qgis.h:1496
ScaleMethod
Scale methods.
Definition: qgis.h:220
FilePathType
File path types.
Definition: qgis.h:752
PointCountMethod
Methods which define the number of points randomly filling a polygon.
Definition: qgis.h:1511
VertexType
Types of vertex.
Definition: qgis.h:1375
DataProviderFlag
Map layer properties.
Definition: qgis.h:1036
GeometryValidationEngine
Available engines for validating geometries.
Definition: qgis.h:943
TransactionMode
Transaction mode.
Definition: qgis.h:1763
Q_ENUM(ScaleToTileZoomLevelMethod)
ViewSyncModeFlag
Synchronization of 2D map canvas and 3D view.
Definition: qgis.h:1679
FileOperationFlag
File operation flags.
Definition: qgis.h:1006
Q_ENUM(VectorProfileType)
FieldDomainMergePolicy
Merge policy for field domains.
Definition: qgis.h:1737
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition: qgis.h:115
SqlKeywordCategory
SQL layer definition capabilities.
Definition: qgis.h:488
GraduatedMethod
Methods for modifying symbols by range in a graduated symbol renderer.
Definition: qgis.h:1580
MeshEditingErrorType
Type of error that can occur during mesh frame editing.
Definition: qgis.h:735
FieldDomainSplitPolicy
Split policy for field domains.
Definition: qgis.h:1721
AnnotationItemEditOperationResult
Results from an edit operation on an annotation item.
Definition: qgis.h:1154
ActionStart
Enum to determine when an operation would begin.
Definition: qgis.h:522
AvoidIntersectionsMode
Flags which control how intersections of pre-existing feature are handled when digitizing new feature...
Definition: qgis.h:1934
MarkerShape
Marker shapes.
Definition: qgis.h:1389
Capitalization
String capitalization options.
Definition: qgis.h:1611
TemporalIntervalMatchMethod
Method to use when resolving a temporal range to a data provider layer or band.
Definition: qgis.h:1221
LabelQuadrantPosition
Label quadrant positions.
Definition: qgis.h:622
ScaleToTileZoomLevelMethod
Available methods for converting map scales to tile zoom levels.
Definition: qgis.h:1642
SublayerQueryFlag
Flags which control how data providers will scan for sublayers in a dataset.
Definition: qgis.h:673
PythonMacroMode
Vector layer type flags.
Definition: qgis.h:180
UnplacedLabelVisibility
Unplaced label visibility.
Definition: qgis.h:534
CrsDefinitionFormat
CRS definition formats.
Definition: qgis.h:1706
SpatialFilterType
Feature request spatial filter types.
Definition: qgis.h:993
ProjectFlag
Flags which control the behavior of QgsProjects.
Definition: qgis.h:1827
BrowserItemType
Symbol layer flags.
Definition: qgis.h:349
SettingsType
Types of settings entries.
Definition: qgis.h:231
RasterTemporalMode
Raster layer temporal modes.
Definition: qgis.h:1208
JoinStyle
Join styles for buffers.
Definition: qgis.h:980
PointCloudDrawOrder
Pointcloud rendering order for 2d views.
Definition: qgis.h:1919
DpiMode
DpiMode enum.
Definition: qgis.h:1591
BrowserLayerType
Browser item layer types.
Definition: qgis.h:403
AltitudeBinding
Altitude binding.
Definition: qgis.h:1789
LabelMultiLineAlignment
Text alignment for multi-line labels.
Definition: qgis.h:658
VectorDataProviderTemporalMode
Vector data provider temporal handling modes.
Definition: qgis.h:1195
TextRenderFormat
Options for rendering text.
Definition: qgis.h:1350
DataType
Raster data types.
Definition: qgis.h:129
Q_ENUM(ProfileSurfaceSymbology)
Q_DECLARE_FLAGS(RenderContextFlags, RenderContextFlag) SIP_MONKEYPATCH_FLAGS_UNNEST(QgsRenderContext
Render context flags.
PlotToolFlag
Flags that control the way the QgsPlotTools operate.
Definition: qgis.h:1843
CoordinateOrder
Order of coordinates.
Definition: qgis.h:1102
EndCapStyle
End cap styles for buffers.
Definition: qgis.h:967
BabelCommandFlag
Babel GPS format capabilities.
Definition: qgis.h:873
FieldDomainType
Types of field domain.
Definition: qgis.h:1750
RenderContextFlag
Flags which affect rendering operations.
Definition: qgis.h:1316
RasterPipeInterfaceRole
Sublayer flags.
Definition: qgis.h:704
SymbolPreviewFlag
Symbol flags.
Definition: qgis.h:321
AnnotationItemGuiFlag
Annotation item flags.
Definition: qgis.h:1129
DashPatternLineEndingRule
Dash pattern line ending rules.
Definition: qgis.h:1550
VertexMarkerType
Editing vertex markers, used for showing vertices during a edit operation.
Definition: qgis.h:807
HistoryProviderBackend
History provider backends.
Definition: qgis.h:1692
SublayerPromptMode
Specifies how to handle layer sources with multiple sublayers.
Definition: qgis.h:764
GradientType
Gradient types.
Definition: qgis.h:1466
VectorProfileType
Types of elevation profiles to generate for vector sources.
Definition: qgis.h:1880
GpsFeatureType
Babel command flags.
Definition: qgis.h:887
VectorLayerTypeFlag
Vector layer type flags.
Definition: qgis.h:167
VectorTemporalLimitMode
Mode for the handling of the limits of the filtering timeframe for vector features.
Definition: qgis.h:1183
SqlLayerDefinitionCapability
SqlLayerDefinitionCapability enum lists the arguments supported by the provider when creating SQL que...
Definition: qgis.h:471
VectorEditResult
Specifies the result of a vector layer edit operation.
Definition: qgis.h:792
Q_DECLARE_FLAGS(GeometryValidityFlags, GeometryValidityFlag) SIP_MONKEYPATCH_FLAGS_UNNEST(QgsGeometry
Geometry validity flags.
ProjectFileFormat
Flags which control project read behavior.
Definition: qgis.h:1949
SnappingMode
SnappingMode defines on which layer the snapping is performed.
Definition: qgis.h:261
SymbolType
Symbol types.
Definition: qgis.h:206
ProfileSurfaceSymbology
Surface symbology type for elevation profile plots.
Definition: qgis.h:1868
RendererUsage
Usage of the renderer.
Definition: qgis.h:1666
BabelFormatCapability
Babel GPS format capabilities.
Definition: qgis.h:854
BetweenLineConstraint
Between line constraints which can be enabled.
Definition: qgis.h:1801
SymbolFlag
Flags controlling behavior of symbols.
Definition: qgis.h:307
LineExtensionSide
Designates whether the line extension constraint is currently soft locked with the previous or next v...
Definition: qgis.h:1814
HttpMethod
Different methods of HTTP requests.
Definition: qgis.h:438
SymbolCoordinateReference
Symbol coordinate reference modes.
Definition: qgis.h:1481
TextRendererFlag
Flags which control the behavior of rendering text.
Definition: qgis.h:1629
CrsAxisDirection
Data provider flags.
Definition: qgis.h:1052
LabelOverlapHandling
Label overlap handling.
Definition: qgis.h:546
CoordinateTransformationFlag
Flags which adjust the coordinate transformations behave.
Definition: qgis.h:1267
TransformDirection
Flags for raster layer temporal capabilities.
Definition: qgis.h:1255
LightSourceType
Light source types for 3D scenes.
Definition: qgis.h:1856
LabelPredefinedPointPosition
Positions for labels when using the Qgis::LabelPlacement::OrderedPositionsAroundPoint placement mode.
Definition: qgis.h:583
UpsideDownLabelHandling
Handling techniques for upside down labels.
Definition: qgis.h:643
Q_DECLARE_FLAGS(MapSettingsFlags, MapSettingsFlag) SIP_MONKEYPATCH_FLAGS_UNNEST(QgsMapSettings
Map settings flags.
MapSettingsFlag
Coordinate transformation flags.
Definition: qgis.h:1287
SelectBehavior
Specifies how a selection should be applied.
Definition: qgis.h:778
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.
Contains settings for how a map layer will be labeled.
Abstract base class for 2d point cloud renderers.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition: qgsproject.h:104
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.
Represent settings entry and provides methods for reading and writing settings values.
RAII signal blocking class.
Definition: qgis.h:2145
~QgsSignalBlocker()
Definition: qgis.h:2157
QgsSignalBlocker(Object *object)
Constructor for QgsSignalBlocker.
Definition: qgis.h:2152
Object * operator->()
Returns pointer to blocked QObject.
Definition: qgis.h:2163
Abstract base class for simple marker symbol layers.
This is a container for configuration of the snapping of the project.
Utility functions for working with strings.
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:93
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:195
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.
As part of the API refactoring and improvements which landed in QGIS
#define str(x)
Definition: qgis.cpp:37
CONSTLATIN1STRING geoNone()
Constant that holds the string representation for "No ellips/No CRS".
Definition: qgis.h:2733
const double DEFAULT_LINE_WIDTH
Definition: qgis.h:2771
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:2625
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
T qgsEnumKeyToValue(const QString &key, const T &defaultValue, bool tryValueAsKey=true, bool *returnOk=nullptr)
Returns the value corresponding to the given key of an enum.
Definition: qgis.h:2454
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:2199
QString qgsEnumValueToKey(const T &value, bool *returnOk=nullptr)
Returns the value for the given key of an enum.
Definition: qgis.h:2435
QString qgsFlagValueToKeys(const T &value, bool *returnOk=nullptr)
Returns the value for the given keys of a flag.
Definition: qgis.h:2493
const QMap< T, QString > qgsEnumMap()
Returns a map of all enum entries.
Definition: qgis.h:2418
const long GEO_EPSG_CRS_ID
Magic number for a geographic coord sys in EpsgCrsId ID format.
Definition: qgis.h:2757
T qgsFlagKeysToValue(const QString &keys, const T &defaultValue, bool tryValueAsKey=true, bool *returnOk=nullptr)
Returns the value corresponding to the given keys of a flag.
Definition: qgis.h:2515
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:2786
bool qgsFloatNear(float a, float b, float epsilon=4 *FLT_EPSILON)
Compare two floats (but allow some difference)
Definition: qgis.h:2277
const QList< T > qgsEnumList()
Returns a list all enum entries.
Definition: qgis.h:2401
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:2314
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
Definition: qgis.h:2260
CONSTLATIN1STRING geoProj4()
PROJ4 string that represents a geographic coord sys.
Definition: qgis.h:2721
bool qgsNanCompatibleEquals(double a, double b)
Compare two doubles, treating nan values as equal.
Definition: qgis.h:2244
const double DEFAULT_SEGMENT_EPSILON
Default snapping tolerance for segments.
Definition: qgis.h:2774
QMap< QString, QString > QgsStringMap
Definition: qgis.h:2776
#define CONSTLATIN1STRING
Definition: qgis.h:2674
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition: qgis.h:2186
CONSTLATIN1STRING geoWkt()
Wkt string that represents a geographic coord sys.
Definition: qgis.h:2713
bool qgsDoubleNearSig(double a, double b, int significantDigits=10)
Compare two doubles using specified number of significant digits.
Definition: qgis.h:2289
const int USER_CRS_START_ID
Magick number that determines whether a projection crsid is a system (srs.db) or user (~/....
Definition: qgis.h:2763
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:2751
#define QHASH_FOR_CLASS_ENUM(T)
Definition: qgis.h:61
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:2639
CONSTLATIN1STRING geoEpsgCrsAuthId()
Geographic coord sys from EPSG authority.
Definition: qgis.h:2727
const long GEOCRS_ID
Magic number for a geographic coord sys in QGIS srs.db tbl_srs.srs_id.
Definition: qgis.h:2754
const double DEFAULT_POINT_SIZE
Magic number that determines the default point size for point symbols.
Definition: qgis.h:2770
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition: qgis_sip.h:266
#define SIP_MONKEYPATCH_FLAGS_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition: qgis_sip.h:267
#define SIP_MONKEYPATCH_SCOPEENUM
Definition: qgis_sip.h:265
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)
Definition: qgis_sip.h:268
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