QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 
287 
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 
301 
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 
329 
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 
397 
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  };
934  Q_DECLARE_FLAGS( GeometryValidityFlags, GeometryValidityFlag ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsGeometry, ValidityFlags )
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  Forward SIP_MONKEYPATCH_COMPAT_NAME( ForwardTransform ),
1238  Reverse SIP_MONKEYPATCH_COMPAT_NAME( ReverseTransform )
1239  };
1240  Q_ENUM( TransformDirection )
1241 
1242 
1248  {
1249  BallparkTransformsAreAppropriate = 1 << 0,
1250  IgnoreImpossibleTransformations = 1 << 1,
1251  };
1252  Q_ENUM( CoordinateTransformationFlag )
1253 
1254 
1259  Q_DECLARE_FLAGS( CoordinateTransformationFlags, CoordinateTransformationFlag )
1260  Q_ENUM( CoordinateTransformationFlags )
1261 
1262 
1268  {
1269  Antialiasing = 0x01,
1270  DrawEditingInfo = 0x02,
1271  ForceVectorOutput = 0x04,
1272  UseAdvancedEffects = 0x08,
1273  DrawLabeling = 0x10,
1274  UseRenderingOptimization = 0x20,
1275  DrawSelection = 0x40,
1276  DrawSymbolBounds = 0x80,
1277  RenderMapTile = 0x100,
1278  RenderPartialOutput = 0x200,
1279  RenderPreviewJob = 0x400,
1280  RenderBlocking = 0x800,
1281  LosslessImageRendering = 0x1000,
1282  Render3DMap = 0x2000,
1283  HighQualityImageTransforms = 0x4000,
1284  SkipSymbolRendering = 0x8000,
1285  ForceRasterMasks = 0x10000,
1286  };
1288  Q_DECLARE_FLAGS( MapSettingsFlags, MapSettingsFlag ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsMapSettings, Flags )
1289  Q_ENUM( MapSettingsFlag )
1290  Q_FLAG( MapSettingsFlags )
1291 
1292 
1298  {
1299  DrawEditingInfo = 0x01,
1300  ForceVectorOutput = 0x02,
1301  UseAdvancedEffects = 0x04,
1302  UseRenderingOptimization = 0x08,
1303  DrawSelection = 0x10,
1304  DrawSymbolBounds = 0x20,
1305  RenderMapTile = 0x40,
1306  Antialiasing = 0x80,
1307  RenderPartialOutput = 0x100,
1308  RenderPreviewJob = 0x200,
1309  RenderBlocking = 0x400,
1310  RenderSymbolPreview = 0x800,
1311  LosslessImageRendering = 0x1000,
1312  ApplyScalingWorkaroundForTextRendering = 0x2000,
1313  Render3DMap = 0x4000,
1314  ApplyClipAfterReprojection = 0x8000,
1315  RenderingSubSymbol = 0x10000,
1316  HighQualityImageTransforms = 0x20000,
1317  SkipSymbolRendering = 0x40000,
1318  };
1320  Q_DECLARE_FLAGS( RenderContextFlags, RenderContextFlag ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsRenderContext, Flags )
1321  Q_ENUM( RenderContextFlag )
1322  Q_FLAG( RenderContextFlags )
1323 
1324  // refs for below dox: https://github.com/qgis/QGIS/pull/1286#issuecomment-39806854
1325  // https://github.com/qgis/QGIS/pull/8573#issuecomment-445585826
1326 
1327 
1332  {
1333  AlwaysOutlines SIP_MONKEYPATCH_COMPAT_NAME( TextFormatAlwaysOutlines ),
1334  AlwaysText SIP_MONKEYPATCH_COMPAT_NAME( TextFormatAlwaysText ),
1335  };
1336  Q_ENUM( TextRenderFormat )
1337 
1338 
1344  {
1345  Generic,
1346  ShadowOffset,
1347  BlurSize,
1348  GlowSpread,
1349  };
1350  Q_ENUM( RenderSubcomponentProperty )
1351 
1352 
1357  {
1358  Segment SIP_MONKEYPATCH_COMPAT_NAME( SegmentVertex ) = 1,
1359  Curve SIP_MONKEYPATCH_COMPAT_NAME( CurveVertex ) = 2,
1360  };
1361  Q_ENUM( VertexType )
1362 
1363 
1371  {
1372  Square,
1373  Diamond,
1374  Pentagon,
1375  Hexagon,
1376  Triangle,
1377  EquilateralTriangle,
1378  Star,
1379  Arrow,
1380  Circle,
1381  Cross,
1382  CrossFill,
1383  Cross2,
1384  Line,
1385  ArrowHead,
1386  ArrowHeadFilled,
1387  SemiCircle,
1388  ThirdCircle,
1389  QuarterCircle,
1390  QuarterSquare,
1391  HalfSquare,
1392  DiagonalHalfSquare,
1393  RightHalfTriangle,
1394  LeftHalfTriangle,
1395  Octagon,
1396  SquareWithCorners,
1397  AsteriskFill,
1398  HalfArc,
1399  ThirdArc,
1400  QuarterArc,
1401  };
1402  Q_ENUM( MarkerShape )
1403 
1404 
1412  {
1413  Interval = 1 << 0,
1414  Vertex = 1 << 1,
1415  LastVertex = 1 << 2,
1416  FirstVertex = 1 << 3,
1417  CentralPoint = 1 << 4,
1418  CurvePoint = 1 << 5,
1419  SegmentCenter = 1 << 6,
1420  InnerVertices = 1 << 7,
1421  };
1422  Q_ENUM( MarkerLinePlacement )
1423  Q_DECLARE_FLAGS( MarkerLinePlacements, MarkerLinePlacement )
1424  Q_FLAG( MarkerLinePlacements )
1425 
1426 
1434  {
1435  SimpleTwoColor,
1436  ColorRamp,
1437  };
1438  Q_ENUM( GradientColorSource )
1439 
1440 
1448  {
1449  Linear,
1450  Radial,
1451  Conical,
1452  };
1453  Q_ENUM( GradientType )
1454 
1455 
1463  {
1464  Feature,
1465  Viewport,
1466  };
1467  Q_ENUM( SymbolCoordinateReference )
1468 
1469 
1478  {
1479  Pad,
1480  Reflect,
1481  Repeat,
1482  };
1483  Q_ENUM( GradientSpread )
1484 
1485 
1493  {
1494  Absolute SIP_MONKEYPATCH_COMPAT_NAME( AbsoluteCount ),
1495  DensityBased SIP_MONKEYPATCH_COMPAT_NAME( DensityBasedCount ),
1496  };
1497  Q_ENUM( PointCountMethod )
1498 
1499 
1504  enum class MarkerClipMode : int
1505  {
1506  NoClipping,
1507  Shape,
1508  CentroidWithin,
1509  CompletelyWithin,
1510  };
1511  Q_ENUM( MarkerClipMode )
1512 
1513 
1518  enum class LineClipMode : int
1519  {
1520  ClipPainterOnly,
1521  ClipToIntersection,
1522  NoClipping,
1523  };
1524  Q_ENUM( LineClipMode )
1525 
1526 
1531  enum class DashPatternLineEndingRule : int
1532  {
1533  NoRule,
1534  FullDash,
1535  HalfDash,
1536  FullGap,
1537  HalfGap,
1538  };
1539  Q_ENUM( DashPatternLineEndingRule )
1540 
1541 
1546  enum class DashPatternSizeAdjustment : int
1547  {
1548  ScaleBothDashAndGap,
1549  ScaleDashOnly,
1550  ScaleGapOnly,
1551  };
1552  Q_ENUM( DashPatternSizeAdjustment )
1553 
1554 
1562  {
1563  Color SIP_MONKEYPATCH_COMPAT_NAME( GraduatedColor ),
1564  Size SIP_MONKEYPATCH_COMPAT_NAME( GraduatedSize ),
1565  };
1566  Q_ENUM( GraduatedMethod )
1567 
1568 
1572  enum class DpiMode
1573  {
1574  All = 7,
1575  Off = 0,
1576  QGIS = 1,
1577  UMN = 2,
1578  GeoServer = 4,
1579  };
1580  Q_ENUM( DpiMode )
1581 
1582 
1583  // NOTE -- the hardcoded numbers here must match QFont::Capitalization!
1584 
1585 
1593  {
1594  MixedCase = 0,
1595  AllUppercase = 1,
1596  AllLowercase = 2,
1597  ForceFirstLetterToCapital = 4,
1598  SmallCaps = 5,
1599  TitleCase = 1004,
1600  UpperCamelCase = 1005,
1601  AllSmallCaps = 1006,
1602  };
1603  Q_ENUM( Capitalization )
1604 
1605 
1610  enum class TextRendererFlag : int
1611  {
1612  WrapLines = 1 << 0,
1613  };
1614  Q_ENUM( TextRendererFlag )
1615  Q_DECLARE_FLAGS( TextRendererFlags, TextRendererFlag )
1616  Q_FLAG( TextRendererFlags )
1617 
1618 
1624  {
1625  MapBox,
1626  Esri,
1627  };
1628  Q_ENUM( ScaleToTileZoomLevelMethod );
1629 
1636  {
1637  Clockwise,
1638  CounterClockwise,
1639  };
1640  Q_ENUM( AngularDirection )
1641 
1642 
1647  enum class RendererUsage : int
1648  {
1649  View,
1650  Export,
1651  Unknown,
1652  };
1653  Q_ENUM( RendererUsage )
1654 
1655 
1660  enum class ViewSyncModeFlag : int
1661  {
1662  Sync3DTo2D = 1 << 0,
1663  Sync2DTo3D = 1 << 1,
1664  };
1665  Q_ENUM( ViewSyncModeFlag )
1666  Q_DECLARE_FLAGS( ViewSyncModeFlags, ViewSyncModeFlag )
1667 
1668 
1673  enum class HistoryProviderBackend : int
1674  {
1675  LocalProfile = 1 << 0,
1676 // Project = 1 << 1, //!< QGIS Project (not yet implemented)
1677  };
1678  Q_ENUM( HistoryProviderBackend )
1679  Q_DECLARE_FLAGS( HistoryProviderBackends, HistoryProviderBackend )
1680  Q_FLAG( HistoryProviderBackends )
1681 
1682 
1688  {
1689  Wkt SIP_MONKEYPATCH_COMPAT_NAME( FormatWkt ),
1690  Proj SIP_MONKEYPATCH_COMPAT_NAME( FormatProj ),
1691  };
1692  Q_ENUM( CrsDefinitionFormat )
1693 
1694 
1702  enum class FieldDomainSplitPolicy : int
1703  {
1704  DefaultValue,
1705  Duplicate,
1706  GeometryRatio,
1707  };
1708  Q_ENUM( FieldDomainSplitPolicy )
1709 
1710 
1718  enum class FieldDomainMergePolicy : int
1719  {
1720  DefaultValue,
1721  Sum,
1722  GeometryWeighted,
1723  };
1724  Q_ENUM( FieldDomainMergePolicy )
1725 
1726 
1731  enum class FieldDomainType : int
1732  {
1733  Coded,
1734  Range,
1735  Glob,
1736  };
1737  Q_ENUM( FieldDomainType )
1738 
1739 
1744  enum class TransactionMode : int
1745  {
1746  Disabled = 0,
1747  AutomaticGroups = 1,
1748  BufferedGroups = 2,
1749  };
1750  Q_ENUM( TransactionMode )
1751 
1752 
1757  enum class AltitudeClamping : int
1758  {
1759  Absolute,
1760  Relative,
1761  Terrain,
1762  };
1763  Q_ENUM( AltitudeClamping )
1764 
1765 
1770  enum class AltitudeBinding : int
1771  {
1772  Vertex,
1773  Centroid,
1774  };
1775  Q_ENUM( AltitudeBinding )
1776 
1777 
1783  {
1784  NoConstraint,
1785  Perpendicular,
1786  Parallel
1787  };
1788  Q_ENUM( BetweenLineConstraint )
1789 
1790 
1795  enum class LineExtensionSide : int
1796  {
1797  BeforeVertex,
1798  AfterVertex,
1799  NoVertex,
1800  };
1801  Q_ENUM( LineExtensionSide )
1802 
1803 
1808  enum class ProjectFlag : int
1809  {
1810  EvaluateDefaultValuesOnProviderSide = 1 << 0,
1811  TrustStoredLayerStatistics = 1 << 1,
1812  RememberLayerEditStatusBetweenSessions = 1 << 2,
1813  RememberAttributeTableWindowsBetweenSessions = 1 << 3,
1814  };
1815  Q_ENUM( ProjectFlag )
1816  Q_DECLARE_FLAGS( ProjectFlags, ProjectFlag )
1817  Q_FLAG( ProjectFlags )
1818 
1819 
1824  enum class PlotToolFlag : int
1825  {
1826  ShowContextMenu = 1 << 0,
1827  };
1828  Q_ENUM( PlotToolFlag )
1829  Q_DECLARE_FLAGS( PlotToolFlags, PlotToolFlag )
1830  Q_FLAG( PlotToolFlags )
1831 
1832 
1837  enum class LightSourceType : int
1838  {
1839  Point,
1840  Directional,
1841  };
1842  Q_ENUM( LightSourceType )
1843 
1844 
1849  enum class ProfileSurfaceSymbology : int
1850  {
1851  Line,
1852  FillBelow,
1853  };
1854  Q_ENUM( ProfileSurfaceSymbology );
1855 
1861  enum class VectorProfileType : int
1862  {
1863  IndividualFeatures,
1864  ContinuousSurface,
1865  };
1866  Q_ENUM( VectorProfileType );
1867 
1873  enum class ProfileGeneratorFlag : int
1874  {
1875  RespectsMaximumErrorMapUnit = 1 << 0,
1876  RespectsDistanceRange = 1 << 1,
1877  RespectsElevationRange = 1 << 2,
1878  };
1879  Q_ENUM( ProfileGeneratorFlag )
1880  Q_DECLARE_FLAGS( ProfileGeneratorFlags, ProfileGeneratorFlag )
1881  Q_FLAG( ProfileGeneratorFlags )
1882 
1883 
1889  {
1890  Square,
1891  Circle,
1892  };
1893  Q_ENUM( PointCloudSymbol )
1894 
1895 
1901  {
1902  Default,
1903  BottomToTop,
1904  TopToBottom,
1905  };
1906  Q_ENUM( PointCloudDrawOrder )
1907 
1908 
1916  {
1917  AllowIntersections,
1918  AvoidIntersectionsCurrentLayer,
1919  AvoidIntersectionsLayers,
1920  };
1921  Q_ENUM( AvoidIntersectionsMode )
1922 
1923 
1931  {
1932  Qgz,
1933  Qgs,
1934  };
1935  Q_ENUM( ProjectFileFormat )
1936 
1937 
1945  {
1946  DontResolveLayers SIP_MONKEYPATCH_COMPAT_NAME( FlagDontResolveLayers ) = 1 << 0,
1947  DontLoadLayouts SIP_MONKEYPATCH_COMPAT_NAME( FlagDontLoadLayouts ) = 1 << 1,
1948  TrustLayerMetadata SIP_MONKEYPATCH_COMPAT_NAME( FlagTrustLayerMetadata ) = 1 << 2,
1949  DontStoreOriginalStyles SIP_MONKEYPATCH_COMPAT_NAME( FlagDontStoreOriginalStyles ) = 1 << 3,
1950  DontLoad3DViews SIP_MONKEYPATCH_COMPAT_NAME( FlagDontLoad3DViews ) = 1 << 4,
1951  DontLoadProjectStyles = 1 << 5,
1952  };
1953  Q_ENUM( ProjectReadFlag )
1954 
1955 
1962  Q_DECLARE_FLAGS( ProjectReadFlags, ProjectReadFlag ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsProject, ReadFlags )
1963  Q_FLAG( ProjectReadFlags )
1964 
1965 
1973  enum class ProjectCapability : int
1974  {
1975  ProjectStyles = 1 << 0,
1976  };
1977  Q_ENUM( ProjectCapability )
1978 
1979 
1984  Q_DECLARE_FLAGS( ProjectCapabilities, ProjectCapability )
1985  Q_FLAG( ProjectCapabilities )
1986 
1987 
1991  static const double DEFAULT_SEARCH_RADIUS_MM;
1992 
1994  static const float DEFAULT_MAPTOPIXEL_THRESHOLD;
1995 
2002  static const QColor DEFAULT_HIGHLIGHT_COLOR;
2003 
2008  static const double DEFAULT_HIGHLIGHT_BUFFER_MM;
2009 
2014  static const double DEFAULT_HIGHLIGHT_MIN_WIDTH_MM;
2015 
2022  static const double SCALE_PRECISION;
2023 
2029  static const double DEFAULT_Z_COORDINATE;
2030 
2036  static const double DEFAULT_M_COORDINATE;
2037 
2043  static const double UI_SCALE_FACTOR;
2044 
2049  static const double DEFAULT_SNAP_TOLERANCE;
2050 
2055  static const QgsTolerance::UnitType DEFAULT_SNAP_UNITS;
2056 
2062  static QString defaultProjectScales();
2063 
2069  static int geosVersionInt();
2070 
2076  static int geosVersionMajor();
2077 
2083  static int geosVersionMinor();
2084 
2090  static int geosVersionPatch();
2091 
2097  static QString geosVersion();
2098 };
2099 
2101 
2102 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolRenderHints )
2103 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolFlags )
2104 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolPreviewFlags )
2105 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolLayerFlags )
2106 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BrowserItemCapabilities )
2107 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SublayerQueryFlags )
2108 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SublayerFlags )
2109 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SqlLayerDefinitionCapabilities )
2110 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BabelFormatCapabilities )
2111 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BabelCommandFlags )
2112 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::GeometryValidityFlags )
2113 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::FileOperationFlags )
2114 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::AnnotationItemFlags )
2115 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::AnnotationItemGuiFlags )
2116 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MapSettingsFlags )
2117 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::RenderContextFlags )
2118 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::VectorLayerTypeFlags )
2119 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MarkerLinePlacements )
2120 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::TextRendererFlags )
2121 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::HistoryProviderBackends )
2122 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MapLayerProperties )
2123 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::DataProviderFlags )
2124 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SnappingTypes )
2125 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::PlotToolFlags )
2126 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::ProfileGeneratorFlags )
2127 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::ProjectReadFlags )
2128 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::ProjectCapabilities )
2129 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::CoordinateTransformationFlags )
2130 
2131 
2132 
2133 // hack to workaround warnings when casting void pointers
2134 // retrieved from QLibrary::resolve to function pointers.
2135 // It's assumed that this works on all systems supporting
2136 // QLibrary
2137 #define cast_to_fptr(f) f
2138 
2139 
2148 // based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
2149 template<class Object> class QgsSignalBlocker SIP_SKIP SIP_SKIP // clazy:exclude=rule-of-three
2150 {
2151  public:
2152 
2157  explicit QgsSignalBlocker( Object * object )
2158  : mObject( object )
2159  , mPreviousState( object->blockSignals( true ) )
2160  {}
2161 
2163  {
2164  mObject->blockSignals( mPreviousState );
2165  }
2166 
2168  Object *operator->() { return mObject; }
2169 
2170  private:
2171 
2172  Object *mObject = nullptr;
2173  bool mPreviousState;
2174 
2175 };
2176 
2190 // based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
2191 template<class Object> inline QgsSignalBlocker<Object> whileBlocking( Object *object ) SIP_SKIP SIP_SKIP
2192 {
2193  return QgsSignalBlocker<Object>( object );
2194 }
2195 
2197 CORE_EXPORT uint qHash( const QVariant &variant );
2198 
2204 inline QString qgsDoubleToString( double a, int precision = 17 )
2205 {
2206  QString str;
2207  if ( precision )
2208  {
2209  if ( precision < 0 )
2210  {
2211  const double roundFactor = std::pow( 10, -precision );
2212  str = QString::number( static_cast< long long >( std::round( a / roundFactor ) * roundFactor ) );
2213  }
2214  else
2215  {
2216  str = QString::number( a, 'f', precision );
2217  if ( str.contains( QLatin1Char( '.' ) ) )
2218  {
2219  // remove ending 0s
2220  int idx = str.length() - 1;
2221  while ( str.at( idx ) == '0' && idx > 1 )
2222  {
2223  idx--;
2224  }
2225  if ( idx < str.length() - 1 )
2226  str.truncate( str.at( idx ) == '.' ? idx : idx + 1 );
2227  }
2228  }
2229  }
2230  else
2231  {
2232  str = QString::number( a, 'f', precision );
2233  }
2234  // avoid printing -0
2235  // see https://bugreports.qt.io/browse/QTBUG-71439
2236  if ( str == QLatin1String( "-0" ) )
2237  {
2238  return QLatin1String( "0" );
2239  }
2240  return str;
2241 }
2242 
2249 inline bool qgsNanCompatibleEquals( double a, double b )
2250 {
2251  const bool aIsNan = std::isnan( a );
2252  const bool bIsNan = std::isnan( b );
2253  if ( aIsNan || bIsNan )
2254  return aIsNan && bIsNan;
2255 
2256  return a == b;
2257 }
2258 
2265 inline bool qgsDoubleNear( double a, double b, double epsilon = 4 * std::numeric_limits<double>::epsilon() )
2266 {
2267  const bool aIsNan = std::isnan( a );
2268  const bool bIsNan = std::isnan( b );
2269  if ( aIsNan || bIsNan )
2270  return aIsNan && bIsNan;
2271 
2272  const double diff = a - b;
2273  return diff > -epsilon && diff <= epsilon;
2274 }
2275 
2282 inline bool qgsFloatNear( float a, float b, float epsilon = 4 * FLT_EPSILON )
2283 {
2284  const bool aIsNan = std::isnan( a );
2285  const bool bIsNan = std::isnan( b );
2286  if ( aIsNan || bIsNan )
2287  return aIsNan && bIsNan;
2288 
2289  const float diff = a - b;
2290  return diff > -epsilon && diff <= epsilon;
2291 }
2292 
2294 inline bool qgsDoubleNearSig( double a, double b, int significantDigits = 10 )
2295 {
2296  const bool aIsNan = std::isnan( a );
2297  const bool bIsNan = std::isnan( b );
2298  if ( aIsNan || bIsNan )
2299  return aIsNan && bIsNan;
2300 
2301  // The most simple would be to print numbers as %.xe and compare as strings
2302  // but that is probably too costly
2303  // Then the fastest would be to set some bits directly, but little/big endian
2304  // has to be considered (maybe TODO)
2305  // Is there a better way?
2306  int aexp, bexp;
2307  const double ar = std::frexp( a, &aexp );
2308  const double br = std::frexp( b, &bexp );
2309 
2310  return aexp == bexp &&
2311  std::round( ar * std::pow( 10.0, significantDigits ) ) == std::round( br * std::pow( 10.0, significantDigits ) );
2312 }
2313 
2319 inline double qgsRound( double number, int places )
2320 {
2321  const double m = ( number < 0.0 ) ? -1.0 : 1.0;
2322  const double scaleFactor = std::pow( 10.0, places );
2323  return ( std::round( number * m * scaleFactor ) / scaleFactor ) * m;
2324 }
2325 
2326 
2327 #ifndef SIP_RUN
2328 
2330 
2340 namespace qgis
2341 {
2342 
2355  template<typename To, typename From> inline To down_cast( From *f )
2356  {
2357  static_assert(
2358  ( std::is_base_of<From,
2359  typename std::remove_pointer<To>::type>::value ),
2360  "target type not derived from source type" );
2361  Q_ASSERT( f == nullptr || dynamic_cast<To>( f ) != nullptr );
2362  return static_cast<To>( f );
2363  }
2364 
2365  template<class T>
2366  QSet<T> listToSet( const QList<T> &list )
2367  {
2368 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
2369  return list.toSet();
2370 #else
2371  return QSet<T>( list.begin(), list.end() );
2372 #endif
2373  }
2374 
2375  template<class T>
2376  QList<T> setToList( const QSet<T> &set )
2377  {
2378 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
2379  return set.toList();
2380 #else
2381  return QList<T>( set.begin(), set.end() );
2382 #endif
2383  }
2384 }
2385 
2386 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
2387 namespace std
2388 {
2389  template<> struct hash<QString>
2390  {
2391  std::size_t operator()( const QString &s ) const noexcept
2392  {
2393  return ( size_t ) qHash( s );
2394  }
2395  };
2396 }
2397 #endif
2398 
2400 #endif
2401 
2406 template<class T> const QList<T> qgsEnumList() SIP_SKIP
2407 {
2408  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2409  Q_ASSERT( metaEnum.isValid() );
2410  QList<T> enumList;
2411  for ( int idx = 0; idx < metaEnum.keyCount(); ++idx )
2412  {
2413  enumList.append( static_cast<T>( metaEnum.value( idx ) ) );
2414  }
2415  return enumList;
2416 }
2417 
2423 template<class T> const QMap<T, QString> qgsEnumMap() SIP_SKIP
2424 {
2425  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2426  Q_ASSERT( metaEnum.isValid() );
2427  QMap<T, QString> enumMap;
2428  for ( int idx = 0; idx < metaEnum.keyCount(); ++idx )
2429  {
2430  enumMap.insert( static_cast<T>( metaEnum.value( idx ) ), QString( metaEnum.key( idx ) ) );
2431  }
2432  return enumMap;
2433 }
2434 
2440 template<class T> QString qgsEnumValueToKey( const T &value, bool *returnOk = nullptr ) SIP_SKIP
2441 {
2442  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2443  Q_ASSERT( metaEnum.isValid() );
2444  const char *key = metaEnum.valueToKey( static_cast<int>( value ) );
2445  if ( returnOk )
2446  {
2447  *returnOk = key ? true : false;
2448  }
2449  return QString::fromUtf8( key );
2450 }
2451 
2459 template<class T> T qgsEnumKeyToValue( const QString &key, const T &defaultValue, bool tryValueAsKey = true, bool *returnOk = nullptr ) SIP_SKIP
2460 {
2461  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2462  Q_ASSERT( metaEnum.isValid() );
2463  bool ok = false;
2464  T v = static_cast<T>( metaEnum.keyToValue( key.toUtf8().data(), &ok ) );
2465  if ( returnOk )
2466  {
2467  *returnOk = ok;
2468  }
2469  if ( ok )
2470  {
2471  return v;
2472  }
2473  else
2474  {
2475  // if conversion has failed, try with conversion from int value
2476  if ( tryValueAsKey )
2477  {
2478  bool canConvert = false;
2479  const int intValue = key.toInt( &canConvert );
2480  if ( canConvert && metaEnum.valueToKey( intValue ) )
2481  {
2482  if ( returnOk )
2483  {
2484  *returnOk = true;
2485  }
2486  return static_cast<T>( intValue );
2487  }
2488  }
2489  }
2490  return defaultValue;
2491 }
2492 
2498 template<class T> QString qgsFlagValueToKeys( const T &value, bool *returnOk = nullptr ) SIP_SKIP
2499 {
2500  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2501  Q_ASSERT( metaEnum.isValid() );
2502  int intValue = static_cast<int>( value );
2503  const QByteArray ba = metaEnum.valueToKeys( intValue );
2504  // check that the int value does correspond to a flag
2505  // see https://stackoverflow.com/a/68495949/1548052
2506  const int intValueCheck = metaEnum.keysToValue( ba );
2507  bool ok = intValue == intValueCheck;
2508  if ( returnOk )
2509  *returnOk = ok;
2510  return ok ? QString::fromUtf8( ba ) : QString();
2511 }
2512 
2520 template<class T> T qgsFlagKeysToValue( const QString &keys, const T &defaultValue, bool tryValueAsKey = true, bool *returnOk = nullptr ) SIP_SKIP
2521 {
2522  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2523  Q_ASSERT( metaEnum.isValid() );
2524  bool ok = false;
2525  T v = static_cast<T>( metaEnum.keysToValue( keys.toUtf8().constData(), &ok ) );
2526  if ( returnOk )
2527  {
2528  *returnOk = ok;
2529  }
2530  if ( ok )
2531  {
2532  return v;
2533  }
2534  else
2535  {
2536  // if conversion has failed, try with conversion from int value
2537  if ( tryValueAsKey )
2538  {
2539  bool canConvert = false;
2540  const int intValue = keys.toInt( &canConvert );
2541  if ( canConvert )
2542  {
2543  const QByteArray keys = metaEnum.valueToKeys( intValue );
2544  const int intValueCheck = metaEnum.keysToValue( keys );
2545  if ( intValue == intValueCheck )
2546  {
2547  if ( returnOk )
2548  {
2549  *returnOk = true;
2550  }
2551  return T( intValue );
2552  }
2553  }
2554  }
2555  }
2556  return defaultValue;
2557 }
2558 
2559 
2569 CORE_EXPORT double qgsPermissiveToDouble( QString string, bool &ok );
2570 
2580 CORE_EXPORT int qgsPermissiveToInt( QString string, bool &ok );
2581 
2591 CORE_EXPORT qlonglong qgsPermissiveToLongLong( QString string, bool &ok );
2592 
2602 CORE_EXPORT bool qgsVariantLessThan( const QVariant &lhs, const QVariant &rhs );
2603 
2612 CORE_EXPORT bool qgsVariantEqual( const QVariant &lhs, const QVariant &rhs );
2613 
2620 CORE_EXPORT bool qgsVariantGreaterThan( const QVariant &lhs, const QVariant &rhs );
2621 
2622 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
2623 
2630 inline bool operator> ( const QVariant &v1, const QVariant &v2 )
2631 {
2632  return qgsVariantGreaterThan( v1, v2 );
2633 }
2634 
2644 inline bool operator< ( const QVariant &v1, const QVariant &v2 )
2645 {
2646  return qgsVariantLessThan( v1, v2 );
2647 }
2648 #endif
2649 
2650 
2651 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
2652 
2656 template<> CORE_EXPORT bool qMapLessThanKey<QVariantList>( const QVariantList &key1, const QVariantList &key2 ) SIP_SKIP;
2657 #endif
2658 
2659 CORE_EXPORT QString qgsVsiPrefix( const QString &path );
2660 
2666 void CORE_EXPORT *qgsMalloc( size_t size ) SIP_SKIP;
2667 
2672 void CORE_EXPORT qgsFree( void *ptr ) SIP_SKIP;
2673 
2674 #ifndef SIP_RUN
2675 
2676 #ifdef _MSC_VER
2677 #define CONSTLATIN1STRING inline const QLatin1String
2678 #else
2679 #define CONSTLATIN1STRING constexpr QLatin1String
2680 #endif
2681 
2683 class ScopedIntIncrementor
2684 {
2685  public:
2686 
2687  ScopedIntIncrementor( int *variable )
2688  : mVariable( variable )
2689  {
2690  ( *mVariable )++;
2691  }
2692 
2693  ScopedIntIncrementor( const ScopedIntIncrementor &other ) = delete;
2694  ScopedIntIncrementor &operator=( const ScopedIntIncrementor &other ) = delete;
2695 
2696  void release()
2697  {
2698  if ( mVariable )
2699  ( *mVariable )--;
2700 
2701  mVariable = nullptr;
2702  }
2703 
2704  ~ScopedIntIncrementor()
2705  {
2706  release();
2707  }
2708 
2709  private:
2710  int *mVariable = nullptr;
2711 };
2713 
2719 {
2720  return QLatin1String(
2721  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]] )"""
2722  );
2723 }
2724 
2727 {
2728  return QLatin1String( "+proj=longlat +datum=WGS84 +no_defs" );
2729 }
2730 
2733 {
2734  return QLatin1String( "EPSG:4326" );
2735 }
2736 
2739 {
2740  return QLatin1String( "NONE" );
2741 }
2742 
2744 
2746 const int PREVIEW_JOB_DELAY_MS = 250;
2747 
2749 const int MAXIMUM_LAYER_PREVIEW_TIME_MS = 250;
2750 
2752 
2753 #endif
2754 
2756 const long GEOSRID = 4326;
2757 
2759 const long GEOCRS_ID = 3452;
2760 
2762 const long GEO_EPSG_CRS_ID = 4326;
2763 
2768 const int USER_CRS_START_ID = 100000;
2769 
2770 //
2771 // Constants for point symbols
2772 //
2773 
2775 const double DEFAULT_POINT_SIZE = 2.0;
2776 const double DEFAULT_LINE_WIDTH = 0.26;
2777 
2779 const double DEFAULT_SEGMENT_EPSILON = 1e-8;
2780 
2781 typedef QMap<QString, QString> QgsStringMap SIP_SKIP;
2782 
2791 typedef unsigned long long qgssize;
2792 
2793 #ifndef SIP_RUN
2794 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
2795 
2796 #define Q_NOWARN_DEPRECATED_PUSH \
2797  _Pragma("GCC diagnostic push") \
2798  _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
2799 #define Q_NOWARN_DEPRECATED_POP \
2800  _Pragma("GCC diagnostic pop");
2801 #define Q_NOWARN_UNREACHABLE_PUSH
2802 #define Q_NOWARN_UNREACHABLE_POP
2803 
2804 #elif defined(_MSC_VER)
2805 
2806 #define Q_NOWARN_DEPRECATED_PUSH \
2807  __pragma(warning(push)) \
2808  __pragma(warning(disable:4996))
2809 #define Q_NOWARN_DEPRECATED_POP \
2810  __pragma(warning(pop))
2811 #define Q_NOWARN_UNREACHABLE_PUSH \
2812  __pragma(warning(push)) \
2813  __pragma(warning(disable:4702))
2814 #define Q_NOWARN_UNREACHABLE_POP \
2815  __pragma(warning(pop))
2816 
2817 #else
2818 
2819 #define Q_NOWARN_DEPRECATED_PUSH
2820 #define Q_NOWARN_DEPRECATED_POP
2821 #define Q_NOWARN_UNREACHABLE_PUSH
2822 #define Q_NOWARN_UNREACHABLE_POP
2823 
2824 #endif
2825 #endif
2826 
2827 #ifndef QGISEXTERN
2828 #ifdef Q_OS_WIN
2829 # define QGISEXTERN extern "C" __declspec( dllexport )
2830 #else
2831 # if defined(__GNUC__) || defined(__clang__)
2832 # define QGISEXTERN extern "C" __attribute__ ((visibility ("default")))
2833 # else
2834 # define QGISEXTERN extern "C"
2835 # endif
2836 #endif
2837 #endif
2838 #endif
2839 
2840 #if __cplusplus >= 201500
2841 #define FALLTHROUGH [[fallthrough]];
2842 #elif defined(__clang__)
2843 #define FALLTHROUGH [[clang::fallthrough]];
2844 #elif defined(__GNUC__) && __GNUC__ >= 7
2845 #define FALLTHROUGH [[gnu::fallthrough]];
2846 #else
2847 #define FALLTHROUGH
2848 #endif
2849 
2850 // see https://infektor.net/posts/2017-01-19-using-cpp17-attributes-today.html#using-the-nodiscard-attribute
2851 #if __cplusplus >= 201703L
2852 #define NODISCARD [[nodiscard]]
2853 #elif defined(__clang__)
2854 #define NODISCARD [[nodiscard]]
2855 #elif defined(_MSC_VER)
2856 #define NODISCARD // no support
2857 #elif defined(__has_cpp_attribute)
2858 #if __has_cpp_attribute(nodiscard)
2859 #define NODISCARD [[nodiscard]]
2860 #elif __has_cpp_attribute(gnu::warn_unused_result)
2861 #define NODISCARD [[gnu::warn_unused_result]]
2862 #else
2863 #define NODISCARD Q_REQUIRED_RESULT
2864 #endif
2865 #else
2866 #define NODISCARD Q_REQUIRED_RESULT
2867 #endif
2868 
2869 #if __cplusplus >= 201703L
2870 #define MAYBE_UNUSED [[maybe_unused]]
2871 #elif defined(__clang__)
2872 #define MAYBE_UNUSED [[maybe_unused]]
2873 #elif defined(_MSC_VER)
2874 #define MAYBE_UNUSED // no support
2875 #elif defined(__has_cpp_attribute)
2876 #if __has_cpp_attribute(gnu::unused)
2877 #define MAYBE_UNUSED [[gnu::unused]]
2878 #else
2879 #define MAYBE_UNUSED
2880 #endif
2881 #else
2882 #define MAYBE_UNUSED
2883 #endif
2884 
2885 #ifndef FINAL
2886 #define FINAL final
2887 #endif
2888 
2889 #ifndef SIP_RUN
2890 #ifdef _MSC_VER
2891 #define BUILTIN_UNREACHABLE \
2892  __assume(false);
2893 #elif defined(__GNUC__) && !defined(__clang__)
2894 // Workaround a GCC bug where a -Wreturn-type warning is emitted in constructs
2895 // like:
2896 // switch( mVariableThatCanOnlyBeXorY )
2897 // {
2898 // case X:
2899 // return "foo";
2900 // case Y:
2901 // return "foo";
2902 // }
2903 // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
2904 #define BUILTIN_UNREACHABLE \
2905  __builtin_unreachable();
2906 #else
2907 #define BUILTIN_UNREACHABLE
2908 #endif
2909 #endif // SIP_RUN
2910 
2911 #ifdef SIP_RUN
2912 
2917 QString CORE_EXPORT geoWkt();
2918 
2920 QString CORE_EXPORT geoProj4();
2921 
2923 QString CORE_EXPORT geoEpsgCrsAuthId();
2924 
2926 QString CORE_EXPORT geoNone();
2927 
2928 #endif
QgsCurve
Abstract base class for curved geometry type.
Definition: qgscurve.h:35
SIP_MONKEYPATCH_COMPAT_NAME
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)
Definition: qgis_sip.h:268
Qgis::HttpMethod
HttpMethod
Different methods of HTTP requests.
Definition: qgis.h:437
Qgis::HistoryProviderBackend
HistoryProviderBackend
History provider backends.
Definition: qgis.h:1673
Qgis::ProjectFileFormat
ProjectFileFormat
Flags which control project read behavior.
Definition: qgis.h:1930
geoWkt
CONSTLATIN1STRING geoWkt()
Wkt string that represents a geographic coord sys.
Definition: qgis.h:2718
operator>
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:2630
Qgis::ContentStatus
ContentStatus
Status for fetched or stored content.
Definition: qgis.h:818
qgsEnumValueToKey
QString qgsEnumValueToKey(const T &value, bool *returnOk=nullptr)
Returns the value for the given key of an enum.
Definition: qgis.h:2440
Qgis::GradientType
GradientType
Gradient types.
Definition: qgis.h:1447
Qgis::CrsDefinitionFormat
CrsDefinitionFormat
CRS definition formats.
Definition: qgis.h:1687
Qgis::TextRenderFormat
TextRenderFormat
Options for rendering text.
Definition: qgis.h:1331
Qgis::GpsQualityIndicator
GpsQualityIndicator
GPS signal quality indicator.
Definition: qgis.h:833
USER_CRS_START_ID
const int USER_CRS_START_ID
Magick number that determines whether a projection crsid is a system (srs.db) or user (~/....
Definition: qgis.h:2768
QgsMapLayerType::MeshLayer
@ MeshLayer
Mesh layer. Added in QGIS 3.2.
Qgis::SublayerFlag
SublayerFlag
Sublayer query flags.
Definition: qgis.h:689
Qgis::LineClipMode
LineClipMode
Line clipping modes.
Definition: qgis.h:1518
Qgis::FeatureCountState
FeatureCountState
Enumeration of feature count states.
Definition: qgis.h:194
GEOCRS_ID
const long GEOCRS_ID
Magic number for a geographic coord sys in QGIS srs.db tbl_srs.srs_id.
Definition: qgis.h:2759
QgsMapLayerType::VectorLayer
@ VectorLayer
Vector layer.
Qgis::SqlKeywordCategory
SqlKeywordCategory
SQL layer definition capabilities.
Definition: qgis.h:487
qHash
CORE_EXPORT uint qHash(const QVariant &variant)
Hash for QVariant.
Definition: qgis.cpp:217
QgsSignalBlocker::QgsSignalBlocker
QgsSignalBlocker(Object *object)
Constructor for QgsSignalBlocker.
Definition: qgis.h:2157
Qgis::PythonMacroMode
PythonMacroMode
Vector layer type flags.
Definition: qgis.h:179
Qgis::VectorExportResult
VectorExportResult
Vector layer export result codes.
Definition: qgis.h:449
QgsPalLayerSettings
Contains settings for how a map layer will be labeled.
Definition: qgspallabeling.h:86
QgsGradientFillSymbolLayer
Definition: qgsfillsymbollayer.h:211
qgsNanCompatibleEquals
bool qgsNanCompatibleEquals(double a, double b)
Compare two doubles, treating nan values as equal.
Definition: qgis.h:2249
qgsDoubleNearSig
bool qgsDoubleNearSig(double a, double b, int significantDigits=10)
Compare two doubles using specified number of significant digits.
Definition: qgis.h:2294
Qgis::MeshEditingErrorType
MeshEditingErrorType
Type of error that can occur during mesh frame editing.
Definition: qgis.h:734
Qgis::UpsideDownLabelHandling
UpsideDownLabelHandling
Handling techniques for upside down labels.
Definition: qgis.h:642
Qgis::BrowserItemState
BrowserItemState
Browser item states.
Definition: qgis.h:367
CONSTLATIN1STRING
#define CONSTLATIN1STRING
Definition: qgis.h:2679
Qgis::MapSettingsFlag
MapSettingsFlag
Coordinate transformation flags.
Definition: qgis.h:1267
qgstolerance.h
Qgis::ProfileSurfaceSymbology
ProfileSurfaceSymbology
Surface symbology type for elevation profile plots.
Definition: qgis.h:1849
Qgis::EndCapStyle
EndCapStyle
End cap styles for buffers.
Definition: qgis.h:966
SIP_MONKEYPATCH_FLAGS_UNNEST
#define SIP_MONKEYPATCH_FLAGS_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition: qgis_sip.h:267
QgsMapLayerType::AnnotationLayer
@ AnnotationLayer
Contains freeform, georeferenced annotations. Added in QGIS 3.16.
Qgis::GeometryValidityFlag
GeometryValidityFlag
Geometry validity check flags.
Definition: qgis.h:929
QgsMapLayerType
QgsMapLayerType
Types of layers that can be added to a map.
Definition: qgis.h:46
Qgis::MarkerClipMode
MarkerClipMode
Marker clipping modes.
Definition: qgis.h:1504
qgsVariantGreaterThan
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
qgsFlagKeysToValue
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:2520
Qgis::DataType
DataType
Raster data types.
Definition: qgis.h:128
QgsRasterPipe
Contains a pipeline of raster interfaces for sequential raster processing.
Definition: qgsrasterpipe.h:49
Qgis::AnnotationItemGuiFlag
AnnotationItemGuiFlag
Annotation item flags.
Definition: qgis.h:1128
Qgis::TextRendererFlag
TextRendererFlag
Flags which control the behavior of rendering text.
Definition: qgis.h:1610
Qgis::RasterResamplingStage
RasterResamplingStage
Stage at which raster resampling occurs.
Definition: qgis.h:720
Qgis::DataProviderFlag
DataProviderFlag
Map layer properties.
Definition: qgis.h:1035
qgis.h
QGIS
As part of the API refactoring and improvements which landed in QGIS
Definition: porting_processing.dox:1
QgsRenderContext
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:59
geoEpsgCrsAuthId
CONSTLATIN1STRING geoEpsgCrsAuthId()
Geographic coord sys from EPSG authority.
Definition: qgis.h:2732
Qgis::ProfileGeneratorFlag
ProfileGeneratorFlag
Flags that control the way the QgsAbstractProfileGenerator operate.
Definition: qgis.h:1873
Qgis::ActionStart
ActionStart
Enum to determine when an operation would begin.
Definition: qgis.h:521
Qgis::RasterTemporalMode
RasterTemporalMode
Raster layer temporal modes.
Definition: qgis.h:1207
Qgis::VectorTemporalMode
VectorTemporalMode
Vector layer temporal feature modes.
Definition: qgis.h:1166
Qgis::RenderSubcomponentProperty
RenderSubcomponentProperty
Rendering subcomponent properties.
Definition: qgis.h:1343
Qgis::FieldDomainType
FieldDomainType
Types of field domain.
Definition: qgis.h:1731
GEO_EPSG_CRS_ID
const long GEO_EPSG_CRS_ID
Magic number for a geographic coord sys in EpsgCrsId ID format.
Definition: qgis.h:2762
DEFAULT_POINT_SIZE
const double DEFAULT_POINT_SIZE
Magic number that determines the default point size for point symbols.
Definition: qgis.h:2775
QgsSymbol
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:92
Qgis::AnnotationItemNodeType
AnnotationItemNodeType
Annotation item GUI flags.
Definition: qgis.h:1142
Qgis::SublayerPromptMode
SublayerPromptMode
Specifies how to handle layer sources with multiple sublayers.
Definition: qgis.h:763
QgsSignalBlocker
RAII signal blocking class. Used for temporarily blocking signals from a QObject for the lifetime of ...
Definition: qgis.h:2149
DEFAULT_SEGMENT_EPSILON
const double DEFAULT_SEGMENT_EPSILON
Default snapping tolerance for segments.
Definition: qgis.h:2779
geoProj4
CONSTLATIN1STRING geoProj4()
PROJ4 string that represents a geographic coord sys.
Definition: qgis.h:2726
Qgis::BrowserLayerType
BrowserLayerType
Browser item layer types.
Definition: qgis.h:402
Qgis::SettingsType
SettingsType
Types of settings entries.
Definition: qgis.h:230
QHASH_FOR_CLASS_ENUM
#define QHASH_FOR_CLASS_ENUM(T)
Definition: qgis.h:61
qgsFree
void CORE_EXPORT qgsFree(void *ptr)
Frees the memory space pointed to by ptr.
Definition: qgis.cpp:114
Qgis::SublayerQueryFlag
SublayerQueryFlag
Flags which control how data providers will scan for sublayers in a dataset.
Definition: qgis.h:672
Qgis::GeometryValidationEngine
GeometryValidationEngine
Available engines for validating geometries.
Definition: qgis.h:942
Qgis::ScaleToTileZoomLevelMethod
ScaleToTileZoomLevelMethod
Available methods for converting map scales to tile zoom levels.
Definition: qgis.h:1623
Qgis::LightSourceType
LightSourceType
Light source types for 3D scenes.
Definition: qgis.h:1837
qgsDoubleToString
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
Definition: qgis.h:2204
QgsRasterLayerTemporalProperties
Implementation of map layer temporal properties for raster layers.
Definition: qgsrasterlayertemporalproperties.h:35
QgsProject
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition: qgsproject.h:103
qgsPermissiveToLongLong
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
Qgis::ScaleMethod
ScaleMethod
Scale methods.
Definition: qgis.h:219
Qgis::GradientColorSource
GradientColorSource
Gradient color sources.
Definition: qgis.h:1433
Qgis::LabelOffsetType
LabelOffsetType
Behavior modifier for label offset and distance, only applies in some label placement modes.
Definition: qgis.h:607
Qgis::LineExtensionSide
LineExtensionSide
Designates whether the line extension constraint is currently soft locked with the previous or next v...
Definition: qgis.h:1795
Qgis::LabelQuadrantPosition
LabelQuadrantPosition
Label quadrant positions.
Definition: qgis.h:621
qgsEnumList
const QList< T > qgsEnumList()
Returns a list all enum entries.
Definition: qgis.h:2406
Qgis::AnnotationItemEditOperationResult
AnnotationItemEditOperationResult
Results from an edit operation on an annotation item.
Definition: qgis.h:1153
Qgis::MapLayerProperty
MapLayerProperty
File operation flags.
Definition: qgis.h:1020
SIP_MONKEYPATCH_SCOPEENUM_UNNEST
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition: qgis_sip.h:266
QgsSimpleMarkerSymbolLayerBase
Abstract base class for simple marker symbol layers. Handles creation of the symbol shapes but leaves...
Definition: qgsmarkersymbollayer.h:46
qgsFlagValueToKeys
QString qgsFlagValueToKeys(const T &value, bool *returnOk=nullptr)
Returns the value for the given keys of a flag.
Definition: qgis.h:2498
Qgis::LabelMultiLineAlignment
LabelMultiLineAlignment
Text alignment for multi-line labels.
Definition: qgis.h:657
precision
int precision
Definition: qgswfsgetfeature.cpp:103
Qgis::LabelPredefinedPointPosition
LabelPredefinedPointPosition
Positions for labels when using the Qgis::LabelPlacement::OrderedPositionsAroundPoint placement mode.
Definition: qgis.h:582
Qgis::AltitudeBinding
AltitudeBinding
Altitude binding.
Definition: qgis.h:1770
Qgis::FieldDomainSplitPolicy
FieldDomainSplitPolicy
Split policy for field domains.
Definition: qgis.h:1702
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
qgsVsiPrefix
CORE_EXPORT QString qgsVsiPrefix(const QString &path)
Definition: qgis.cpp:192
Qgis::CoordinateTransformationFlag
CoordinateTransformationFlag
Flags which adjust the coordinate transformations behave.
Definition: qgis.h:1247
Qgis::BrowserItemCapability
BrowserItemCapability
Browser item capabilities.
Definition: qgis.h:380
qgsFloatNear
bool qgsFloatNear(float a, float b, float epsilon=4 *FLT_EPSILON)
Compare two floats (but allow some difference)
Definition: qgis.h:2282
QgsSignalBlocker::~QgsSignalBlocker
~QgsSignalBlocker()
Definition: qgis.h:2162
Qgis::SymbolType
SymbolType
Symbol types.
Definition: qgis.h:205
qgsVariantEqual
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
qgsEnumMap
const QMap< T, QString > qgsEnumMap()
Returns a map of all enum entries.
Definition: qgis.h:2423
whileBlocking
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition: qgis.h:2191
geoNone
CONSTLATIN1STRING geoNone()
Constant that holds the string representation for "No ellips/No CRS".
Definition: qgis.h:2738
GEOSRID
const long GEOSRID
Magic number for a geographic coord sys in POSTGIS SRID.
Definition: qgis.h:2756
Qgis::VertexMarkerType
VertexMarkerType
Editing vertex markers, used for showing vertices during a edit operation.
Definition: qgis.h:806
QgsMapLayerType::GroupLayer
@ GroupLayer
Composite group layer. Added in QGIS 3.24.
Qgis::DashPatternSizeAdjustment
DashPatternSizeAdjustment
Dash pattern size adjustment options.
Definition: qgis.h:1546
qgsDoubleNear
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
Definition: qgis.h:2265
Qgis::BufferSide
BufferSide
Side of line to buffer.
Definition: qgis.h:954
qgsRound
double qgsRound(double number, int places)
Returns a double number, rounded (as close as possible) to the specified number of places.
Definition: qgis.h:2319
Qgis::TemporalIntervalMatchMethod
TemporalIntervalMatchMethod
Method to use when resolving a temporal range to a data provider layer or band.
Definition: qgis.h:1220
Qgis::ProjectReadFlag
ProjectReadFlag
Flags which control project read behavior.
Definition: qgis.h:1944
DEFAULT_LINE_WIDTH
const double DEFAULT_LINE_WIDTH
Definition: qgis.h:2776
QgsMapLayerType::RasterLayer
@ RasterLayer
Raster layer.
QgsGraduatedSymbolRenderer
Definition: qgsgraduatedsymbolrenderer.h:35
qgis_sip.h
Qgis::DpiMode
DpiMode
DpiMode enum.
Definition: qgis.h:1572
Qgis::GeometryOperationResult
GeometryOperationResult
Success or failure of a geometry operation.
Definition: qgis.h:901
Qgis::SymbolPreviewFlag
SymbolPreviewFlag
Symbol flags.
Definition: qgis.h:320
Qgis::SymbolLayerFlag
SymbolLayerFlag
Flags controlling behavior of symbol layers.
Definition: qgis.h:334
Qgis::PointCloudSymbol
PointCloudSymbol
Rendering symbols for point cloud points.
Definition: qgis.h:1888
Q_DECLARE_OPERATORS_FOR_FLAGS
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.
Qgis::FilePathType
FilePathType
File path types.
Definition: qgis.h:751
Qgis::VectorProfileType
VectorProfileType
Types of elevation profiles to generate for vector sources.
Definition: qgis.h:1861
QgsVectorLayerTemporalProperties
Implementation of map layer temporal properties for vector layers.
Definition: qgsvectorlayertemporalproperties.h:70
Qgis::VectorLayerTypeFlag
VectorLayerTypeFlag
Vector layer type flags.
Definition: qgis.h:166
Qgis::Capitalization
Capitalization
String capitalization options.
Definition: qgis.h:1592
Qgis::PointCloudDrawOrder
PointCloudDrawOrder
Pointcloud rendering order for 2d views.
Definition: qgis.h:1900
Qgis::DriveType
DriveType
Drive types.
Definition: qgis.h:505
QgsSnappingConfig
This is a container for configuration of the snapping of the project.
Definition: qgssnappingconfig.h:37
QgsSignalBlocker::operator->
Object * operator->()
Returns pointer to blocked QObject.
Definition: qgis.h:2168
Qgis::FieldDomainMergePolicy
FieldDomainMergePolicy
Merge policy for field domains.
Definition: qgis.h:1718
Qgis::JoinStyle
JoinStyle
Join styles for buffers.
Definition: qgis.h:979
Qgis::BabelCommandFlag
BabelCommandFlag
Babel GPS format capabilities.
Definition: qgis.h:872
Qgis::RenderContextFlag
RenderContextFlag
Flags which affect rendering operations.
Definition: qgis.h:1297
QgsTemplatedLineSymbolLayerBase
Base class for templated line symbols, e.g. line symbols which draw markers or hash lines at interval...
Definition: qgslinesymbollayer.h:552
qgsVariantLessThan
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
Qgis::RasterPipeInterfaceRole
RasterPipeInterfaceRole
Sublayer flags.
Definition: qgis.h:703
QgsCoordinateReferenceSystem
This class represents a coordinate reference system (CRS).
Definition: qgscoordinatereferencesystem.h:211
Qgis::SymbolRenderHint
SymbolRenderHint
Flags controlling behavior of symbols during rendering.
Definition: qgis.h:292
Qgis::QGIS_DEV_VERSION
static const char * QGIS_DEV_VERSION
The development version.
Definition: qgis.h:98
Qgis::BrowserDirectoryMonitoring
BrowserDirectoryMonitoring
Browser directory item monitoring switches.
Definition: qgis.h:425
Qgis::SqlLayerDefinitionCapability
SqlLayerDefinitionCapability
SqlLayerDefinitionCapability enum lists the arguments supported by the provider when creating SQL que...
Definition: qgis.h:470
qgsPermissiveToInt
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
Qgis::DashPatternLineEndingRule
DashPatternLineEndingRule
Dash pattern line ending rules.
Definition: qgis.h:1531
Qgis::SelectBehavior
SelectBehavior
Specifies how a selection should be applied.
Definition: qgis.h:777
operator<
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:2644
Qgis::VertexType
VertexType
Types of vertex.
Definition: qgis.h:1356
Qgis::BetweenLineConstraint
BetweenLineConstraint
Between line constraints which can be enabled.
Definition: qgis.h:1782
Qgis::ProjectFlag
ProjectFlag
Flags which control the behavior of QgsProjects.
Definition: qgis.h:1808
QgsStringMap
QMap< QString, QString > QgsStringMap
Definition: qgis.h:2781
Qgis::GraduatedMethod
GraduatedMethod
Methods for modifying symbols by range in a graduated symbol renderer.
Definition: qgis.h:1561
Direction::Right
@ Right
Qgis::AvoidIntersectionsMode
AvoidIntersectionsMode
Flags which control how intersections of pre-existing feature are handled when digitizing new feature...
Definition: qgis.h:1915
Qgis::MessageLevel
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition: qgis.h:114
QgsGeometry
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:124
QgsTolerance
This is the class is providing tolerance value in map unit values.
Definition: qgstolerance.h:32
str
#define str(x)
Definition: qgis.cpp:37
QgsVectorDataProviderTemporalCapabilities
Implementation of data provider temporal properties for QgsVectorDataProviders.
Definition: qgsvectordataprovidertemporalcapabilities.h:37
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:391
QgsMapLayer
Base class for all map layer types. This is the base class for all map layer types (vector,...
Definition: qgsmaplayer.h:72
qgsPermissiveToDouble
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
Qgis::VectorEditResult
VectorEditResult
Specifies the result of a vector layer edit operation.
Definition: qgis.h:791
Qgis::PointCountMethod
PointCountMethod
Methods which define the number of points randomly filling a polygon.
Definition: qgis.h:1492
QgsVertexId
Utility class for identifying a unique vertex within a geometry.
Definition: qgsvertexid.h:30
QgsRandomMarkerFillSymbolLayer
A fill symbol layer which places markers at random locations within polygons.
Definition: qgsfillsymbollayer.h:2239
qgsEnumKeyToValue
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:2459
QgsPointCloudRenderer
Abstract base class for 2d point cloud renderers.
Definition: qgspointcloudrenderer.h:296
QgsMapLayerType::VectorTileLayer
@ VectorTileLayer
Vector tile layer. Added in QGIS 3.14.
qgsMalloc
void CORE_EXPORT * qgsMalloc(size_t size)
Allocates size bytes and returns a pointer to the allocated memory.
Definition: qgis.cpp:92
Qgis::ProjectCapability
ProjectCapability
Flags which control project capabilities.
Definition: qgis.h:1973
Qgis::BabelFormatCapability
BabelFormatCapability
Babel GPS format capabilities.
Definition: qgis.h:853
Qgis::SettingsOption
SettingsOption
Settings options.
Definition: qgis.h:247
Direction::Down
@ Down
QgsSettingsEntryBase
Represent settings entry and provides methods for reading and writing settings values....
Definition: qgssettingsentry.h:102
QgsLayerItem
Item that represents a layer that can be opened with one of the providers.
Definition: qgslayeritem.h:29
Qgis::ViewSyncModeFlag
ViewSyncModeFlag
Synchronization of 2D map canvas and 3D view.
Definition: qgis.h:1660
Qgis::RendererUsage
RendererUsage
Usage of the renderer.
Definition: qgis.h:1647
QgsVectorLayerExporter
A convenience class for exporting vector layers to a destination data provider.
Definition: qgsvectorlayerexporter.h:49
Qgis::GradientSpread
GradientSpread
Gradient spread options, which control how gradients are rendered outside of their start and end poin...
Definition: qgis.h:1477
Qgis
The Qgis class provides global constants for use throughout the application.
Definition: qgis.h:71
QgsStringUtils
Utility functions for working with strings.
Definition: qgsstringutils.h:183
Qgis::SpatialFilterType
SpatialFilterType
Feature request spatial filter types.
Definition: qgis.h:992
QgsVectorDataProvider
This is the base class for vector data providers.
Definition: qgsvectordataprovider.h:58
QgsSymbolLayerUtils
Definition: qgssymbollayerutils.h:57
Qgis::SymbolCoordinateReference
SymbolCoordinateReference
Symbol coordinate reference modes.
Definition: qgis.h:1462
Qgis::VectorTemporalLimitMode
VectorTemporalLimitMode
Mode for the handling of the limits of the filtering timeframe for vector features.
Definition: qgis.h:1182
Qgis::SnappingMode
SnappingMode
SnappingMode defines on which layer the snapping is performed.
Definition: qgis.h:260
Qgis::GpsFeatureType
GpsFeatureType
Babel command flags.
Definition: qgis.h:886
Qgis::UnplacedLabelVisibility
UnplacedLabelVisibility
Unplaced label visibility.
Definition: qgis.h:533
Qgis::TransformDirection
TransformDirection
Indicates the direction (forward or inverse) of a transform.
Definition: qgis.h:1235
Qgis::CrsAxisDirection
CrsAxisDirection
Data provider flags.
Definition: qgis.h:1051
Qgis::MarkerShape
MarkerShape
Marker shapes.
Definition: qgis.h:1370
Qgis::CaptureTechnique
CaptureTechnique
Capture technique.
Definition: qgis.h:152
Qgis::FileOperationFlag
FileOperationFlag
File operation flags.
Definition: qgis.h:1005
QgsMapSettings
The QgsMapSettings class contains configuration for rendering of the map. The rendering itself is don...
Definition: qgsmapsettings.h:88
Qgis::TransactionMode
TransactionMode
Transaction mode.
Definition: qgis.h:1744
QgsCoordinateTransform
Class for doing transforms between two map coordinate systems.
Definition: qgscoordinatetransform.h:57
QgsDataItem
Base class for all items in the model.
Definition: qgsdataitem.h:45
Qgis::AltitudeClamping
AltitudeClamping
Altitude clamping.
Definition: qgis.h:1757
Qgis::PlotToolFlag
PlotToolFlag
Flags that control the way the QgsPlotTools operate.
Definition: qgis.h:1824
QgsMapLayerType::PointCloudLayer
@ PointCloudLayer
Point cloud layer. Added in QGIS 3.18.
Qgis::VectorDataProviderTemporalMode
VectorDataProviderTemporalMode
Vector data provider temporal handling modes.
Definition: qgis.h:1194
Qgis::SymbolFlag
SymbolFlag
Flags controlling behavior of symbols.
Definition: qgis.h:306
Direction::Up
@ Up
Qgis::CoordinateOrder
CoordinateOrder
Order of coordinates.
Definition: qgis.h:1101
Qgis::AnnotationItemFlag
AnnotationItemFlag
Flags for annotation items.
Definition: qgis.h:1114
Qgis::LabelOverlapHandling
LabelOverlapHandling
Label overlap handling.
Definition: qgis.h:545
QgsGuiUtils::significantDigits
int significantDigits(const Qgis::DataType rasterDataType)
Returns the maximum number of significant digits a for the given rasterDataType.
Definition: qgsguiutils.cpp:311
Qgis::SnappingType
SnappingType
SnappingTypeFlag defines on what object the snapping is performed.
Definition: qgis.h:272
Direction::Left
@ Left
QgsMapLayerType::PluginLayer
@ PluginLayer
Plugin based layer.
QgsRasterDataProviderTemporalCapabilities
Implementation of data provider temporal properties for QgsRasterDataProviders.
Definition: qgsrasterdataprovidertemporalcapabilities.h:38
Qgis::AngularDirection
AngularDirection
Angular directions.
Definition: qgis.h:1635
Qgis::MarkerLinePlacement
MarkerLinePlacement
Defines how/where the symbols should be placed on a line.
Definition: qgis.h:1411
Qgis::LabelPlacement
LabelPlacement
Placement modes which determine how label candidates are generated for a feature.
Definition: qgis.h:560
QgsNetworkContentFetcherRegistry
Registry for temporary fetched files.
Definition: qgsnetworkcontentfetcherregistry.h:139
Qgis::BrowserItemType
BrowserItemType
Symbol layer flags.
Definition: qgis.h:348
qgssize
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:2791
SIP_MONKEYPATCH_SCOPEENUM
#define SIP_MONKEYPATCH_SCOPEENUM
Definition: qgis_sip.h:265