QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
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  {
51  MeshLayer,
55 };
56 
57 
62 class CORE_EXPORT Qgis
63 {
64  Q_GADGET
65  public:
66 
72  static QString version();
73 
79  static int versionInt();
80 
86  static QString releaseName();
87 
89  static const char *QGIS_DEV_VERSION;
90 
96  static QString devVersion();
97 
98  // Enumerations
99  //
100 
106  {
107  Info = 0,
108  Warning = 1,
109  Critical = 2,
110  Success = 3,
111  NoLevel = 4,
112  };
113  Q_ENUM( MessageLevel )
114 
115 
120  {
121  UnknownDataType = 0,
122  Byte = 1,
123  UInt16 = 2,
124  Int16 = 3,
125  UInt32 = 4,
126  Int32 = 5,
127  Float32 = 6,
128  Float64 = 7,
129  CInt16 = 8,
130  CInt32 = 9,
131  CFloat32 = 10,
132  CFloat64 = 11,
133  ARGB32 = 12,
134  ARGB32_Premultiplied = 13
135  };
136  Q_ENUM( DataType )
137 
138 
143  {
144  Never = 0,
145  Ask = 1,
146  SessionOnly = 2,
147  Always = 3,
148  NotForThisSession,
149  };
150  Q_ENUM( PythonMacroMode )
151 
152 
158  {
159  Uncounted = -2,
160  UnknownCount = -1,
161  };
162  Q_ENUM( FeatureCountState )
163 
164 
169  {
170  Marker,
171  Line,
172  Fill,
173  Hybrid
174  };
175  Q_ENUM( SymbolType )
176 
177 
183  {
184  ScaleArea,
185  ScaleDiameter
186  };
187  Q_ENUM( ScaleMethod )
188 
189 
195  {
196  DynamicRotation = 2,
197  };
198  Q_ENUM( SymbolRenderHint )
200  Q_DECLARE_FLAGS( SymbolRenderHints, SymbolRenderHint ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsSymbol, RenderHints )
201 
202 
208  enum class SymbolFlag : int
209  {
210  RendererShouldUseSymbolLevels = 1 << 0,
211  };
212  Q_ENUM( SymbolFlag )
214  Q_DECLARE_FLAGS( SymbolFlags, SymbolFlag )
215 
216 
222  {
223  FlagIncludeCrosshairsForMarkerSymbols = 1 << 0,
224  };
225  Q_ENUM( SymbolPreviewFlag )
227  Q_DECLARE_FLAGS( SymbolPreviewFlags, SymbolPreviewFlag ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsSymbol, SymbolPreviewFlags )
228 
234  enum class SymbolLayerFlag : int
235  {
236  DisableFeatureClipping = 1 << 0,
237  };
238  Q_ENUM( SymbolLayerFlag )
240  Q_DECLARE_FLAGS( SymbolLayerFlags, SymbolLayerFlag )
241 
242 
248  {
249  Collection,
250  Directory,
251  Layer,
252  Error,
253  Favorites,
254  Project,
255  Custom,
256  Fields,
257  Field,
258  };
259  Q_ENUM( BrowserItemType )
260 
261 
267  {
268  NotPopulated,
269  Populating,
270  Populated,
271  };
272  Q_ENUM( BrowserItemState )
273 
274 
280  {
281  NoCapabilities = 0,
282  SetCrs = 1 << 0,
283  Fertile = 1 << 1,
284  Fast = 1 << 2,
285  Collapse = 1 << 3,
286  Rename = 1 << 4,
287  Delete = 1 << 5,
288  ItemRepresentsFile = 1 << 6,
289  };
290  Q_ENUM( BrowserItemCapability )
292  Q_DECLARE_FLAGS( BrowserItemCapabilities, BrowserItemCapability ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsDataItem, Capabilities )
293 
300  {
301  NoType,
302  Vector,
303  Raster,
304  Point,
305  Line,
306  Polygon,
307  TableLayer,
308  Database,
309  Table,
310  Plugin,
311  Mesh,
312  VectorTile,
313  PointCloud
314  };
315  Q_ENUM( BrowserLayerType )
316 
317 
322  enum class BrowserDirectoryMonitoring : int
323  {
324  Default,
325  NeverMonitor,
326  AlwaysMonitor,
327  };
328  Q_ENUM( BrowserDirectoryMonitoring )
329 
330 
334  enum class HttpMethod : int
335  {
336  Get = 0,
337  Post = 1
338  };
339  Q_ENUM( HttpMethod )
340 
341 
347  {
348  Success SIP_MONKEYPATCH_COMPAT_NAME( NoError ) = 0,
349  ErrorCreatingDataSource SIP_MONKEYPATCH_COMPAT_NAME( ErrCreateDataSource ),
350  ErrorCreatingLayer SIP_MONKEYPATCH_COMPAT_NAME( ErrCreateLayer ),
351  ErrorAttributeTypeUnsupported SIP_MONKEYPATCH_COMPAT_NAME( ErrAttributeTypeUnsupported ),
352  ErrorAttributeCreationFailed SIP_MONKEYPATCH_COMPAT_NAME( ErrAttributeCreationFailed ),
353  ErrorProjectingFeatures SIP_MONKEYPATCH_COMPAT_NAME( ErrProjection ),
354  ErrorFeatureWriteFailed SIP_MONKEYPATCH_COMPAT_NAME( ErrFeatureWriteFailed ),
355  ErrorInvalidLayer SIP_MONKEYPATCH_COMPAT_NAME( ErrInvalidLayer ),
356  ErrorInvalidProvider SIP_MONKEYPATCH_COMPAT_NAME( ErrInvalidProvider ),
357  ErrorProviderUnsupportedFeature SIP_MONKEYPATCH_COMPAT_NAME( ErrProviderUnsupportedFeature ),
358  ErrorConnectionFailed SIP_MONKEYPATCH_COMPAT_NAME( ErrConnectionFailed ),
359  UserCanceled SIP_MONKEYPATCH_COMPAT_NAME( ErrUserCanceled ),
360  };
361  Q_ENUM( VectorExportResult )
362 
363 
368  {
369  SubsetStringFilter = 1 << 1,
370  GeometryColumn = 1 << 2,
371  PrimaryKeys = 1 << 3,
372  UnstableFeatureIds = 1 << 4
373  };
374  Q_ENUM( SqlLayerDefinitionCapability )
376  Q_DECLARE_FLAGS( SqlLayerDefinitionCapabilities, SqlLayerDefinitionCapability )
377 
378 
383  enum class SqlKeywordCategory : int
384  {
385  Keyword,
386  Constant,
387  Function,
388  Geospatial,
389  Operator,
390  Math,
391  Aggregate,
392  String,
393  Identifier
394  };
395  Q_ENUM( SqlKeywordCategory )
396 
397 
401  enum class DriveType : int
402  {
403  Unknown,
404  Invalid,
405  Removable,
406  Fixed,
407  Remote,
408  CdRom,
409  RamDisk,
410  };
411  Q_ENUM( DriveType )
412 
413 
418  {
419  Deferred SIP_MONKEYPATCH_COMPAT_NAME( DownloadLater ),
420  Immediate SIP_MONKEYPATCH_COMPAT_NAME( DownloadImmediately ),
421  };
422  Q_ENUM( ActionStart )
423 
424 
429  enum class UnplacedLabelVisibility : int
430  {
431  FollowEngineSetting,
432  NeverShow,
433  };
434  Q_ENUM( UnplacedLabelVisibility )
435 
436 
441  enum class SublayerQueryFlag : int
442  {
443  FastScan = 1 << 0,
444  ResolveGeometryType = 1 << 1,
445  CountFeatures = 1 << 2,
446  IncludeSystemTables = 1 << 3,
447  };
449  Q_DECLARE_FLAGS( SublayerQueryFlags, SublayerQueryFlag )
450  Q_ENUM( SublayerQueryFlag )
451 
452 
457  enum class SublayerFlag : int
458  {
459  SystemTable = 1 << 0,
460  };
462  Q_DECLARE_FLAGS( SublayerFlags, SublayerFlag )
463  Q_ENUM( SublayerFlag )
464 
465 
471  {
472  Unknown SIP_MONKEYPATCH_COMPAT_NAME( UnknownRole ) = 0,
473  Provider SIP_MONKEYPATCH_COMPAT_NAME( ProviderRole ) = 1,
474  Renderer SIP_MONKEYPATCH_COMPAT_NAME( RendererRole ) = 2,
475  Brightness SIP_MONKEYPATCH_COMPAT_NAME( BrightnessRole ) = 3,
476  Resampler SIP_MONKEYPATCH_COMPAT_NAME( ResamplerRole ) = 4,
477  Projector SIP_MONKEYPATCH_COMPAT_NAME( ProjectorRole ) = 5,
478  Nuller SIP_MONKEYPATCH_COMPAT_NAME( NullerRole ) = 6,
479  HueSaturation SIP_MONKEYPATCH_COMPAT_NAME( HueSaturationRole ) = 7,
480  };
481  Q_ENUM( RasterPipeInterfaceRole )
482 
483 
488  {
490  ResampleFilter,
492  Provider
493  };
494  Q_ENUM( RasterResamplingStage )
495 
496 
501  enum class MeshEditingErrorType : int
502  {
503  NoError,
504  InvalidFace,
505  TooManyVerticesInFace,
506  FlatFace,
507  UniqueSharedVertex,
508  InvalidVertex,
509  ManifoldFace,
510  };
511  Q_ENUM( MeshEditingErrorType )
512 
513 
518  enum class FilePathType : int
519  {
520  Absolute,
521  Relative,
522  };
523  Q_ENUM( FilePathType )
524 
525 
530  enum class SublayerPromptMode : int
531  {
532  AlwaysAsk,
533  AskExcludingRasterBands,
534  NeverAskSkip,
535  NeverAskLoadAll,
536  };
537  Q_ENUM( SublayerPromptMode )
538 
539 
545  {
546  SetSelection,
547  AddToSelection,
548  IntersectSelection,
549  RemoveFromSelection,
550  };
551  Q_ENUM( SelectBehavior )
552 
553 
559  {
560  Success = 0,
561  EmptyGeometry = 1,
562  EditFailed = 2,
563  FetchFeatureFailed = 3,
564  InvalidLayer = 4,
565  };
566  Q_ENUM( VectorEditResult )
567 
568 
574  {
575  SemiTransparentCircle,
576  Cross,
577  NoMarker,
578  };
579  Q_ENUM( VertexMarkerType )
580 
581 
585  enum class ContentStatus : int
586  {
587  NotStarted,
588  Running,
589  Finished,
590  Failed,
591  Canceled,
592  };
593  Q_ENUM( ContentStatus )
594 
595 
600  enum class BabelFormatCapability : int
601  {
602  Import = 1 << 0,
603  Export = 1 << 1,
604  Waypoints = 1 << 2,
605  Routes = 1 << 3,
606  Tracks = 1 << 4,
607  };
609  Q_DECLARE_FLAGS( BabelFormatCapabilities, BabelFormatCapability )
610  Q_ENUM( BabelFormatCapability )
611 
612 
618  enum class BabelCommandFlag : int
619  {
620  QuoteFilePaths = 1 << 0,
621  };
623  Q_DECLARE_FLAGS( BabelCommandFlags, BabelCommandFlag )
624  Q_ENUM( BabelCommandFlag )
625 
626 
631  enum class GpsFeatureType : int
632  {
633  Waypoint,
634  Route,
635  Track,
636  };
637  Q_ENUM( GpsFeatureType )
638 
639 
647  {
648  Success = 0,
649  NothingHappened = 1000,
650  InvalidBaseGeometry,
651  InvalidInputGeometryType,
652  SelectionIsEmpty,
653  SelectionIsGreaterThanOne,
654  GeometryEngineError,
655  LayerNotEditable,
656  /* Add part issues */
657  AddPartSelectedGeometryNotFound,
658  AddPartNotMultiGeometry,
659  /* Add ring issues*/
660  AddRingNotClosed,
661  AddRingNotValid,
662  AddRingCrossesExistingRings,
663  AddRingNotInExistingFeature,
664  /* Split features */
665  SplitCannotSplitPoint,
666  };
667  Q_ENUM( GeometryOperationResult )
668 
669 
675  {
676  AllowSelfTouchingHoles SIP_MONKEYPATCH_COMPAT_NAME( FlagAllowSelfTouchingHoles ) = 1 << 0,
677  };
680  Q_ENUM( GeometryValidityFlag )
681 
682 
687  {
688  QgisInternal SIP_MONKEYPATCH_COMPAT_NAME( ValidatorQgisInternal ),
689  Geos SIP_MONKEYPATCH_COMPAT_NAME( ValidatorGeos ),
690  };
691  Q_ENUM( GeometryValidationEngine )
692 
693 
699  {
700  Left SIP_MONKEYPATCH_COMPAT_NAME( SideLeft ) = 0,
701  Right SIP_MONKEYPATCH_COMPAT_NAME( SideRight ),
702  };
703  Q_ENUM( BufferSide )
704 
705 
711  {
712  Round SIP_MONKEYPATCH_COMPAT_NAME( CapRound ) = 1,
713  Flat SIP_MONKEYPATCH_COMPAT_NAME( CapFlat ),
714  Square SIP_MONKEYPATCH_COMPAT_NAME( CapSquare ),
715  };
716  Q_ENUM( EndCapStyle )
717 
718 
724  {
725  Round SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleRound ) = 1,
726  Miter SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleMiter ),
727  Bevel SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleBevel ),
728  };
729  Q_ENUM( JoinStyle )
730 
731 
736  enum class SpatialFilterType : int
737  {
738  NoFilter,
739  BoundingBox,
740  DistanceWithin,
741  };
742  Q_ENUM( SpatialFilterType )
743 
744 
749  enum class FileOperationFlag : int
750  {
751  IncludeMetadataFile = 1 << 0,
752  IncludeStyleFile = 1 << 1,
753  };
755  Q_DECLARE_FLAGS( FileOperationFlags, FileOperationFlag )
756  Q_ENUM( FileOperationFlag )
757 
758 
763  enum class MapLayerProperty : int
764  {
765  UsersCannotToggleEditing = 1 << 0,
766  };
768  Q_DECLARE_FLAGS( MapLayerProperties, MapLayerProperty )
769  Q_ENUM( MapLayerProperty )
770 
771 
776  enum class AnnotationItemFlag : int
777  {
778  ScaleDependentBoundingBox = 1 << 0,
779  };
781  Q_DECLARE_FLAGS( AnnotationItemFlags, AnnotationItemFlag )
782  Q_ENUM( AnnotationItemFlag )
783 
784 
789  enum class AnnotationItemGuiFlag : int
790  {
791  FlagNoCreationTools = 1 << 0,
792  };
794  Q_DECLARE_FLAGS( AnnotationItemGuiFlags, AnnotationItemGuiFlag )
795  Q_ENUM( AnnotationItemGuiFlag )
796 
797 
802  enum class AnnotationItemNodeType : int
803  {
804  VertexHandle,
805  };
806  Q_ENUM( AnnotationItemNodeType )
807 
808 
814  {
815  Success,
816  Invalid,
817  ItemCleared,
818  };
819  Q_ENUM( AnnotationItemEditOperationResult )
820 
821 
827  {
828  FixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ModeFixedTemporalRange ) = 0,
829  FeatureDateTimeInstantFromField SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeInstantFromField ),
830  FeatureDateTimeStartAndEndFromFields SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndEndFromFields ),
831  FeatureDateTimeStartAndDurationFromFields SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndDurationFromFields ),
832  FeatureDateTimeStartAndEndFromExpressions SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndEndFromExpressions ),
833  RedrawLayerOnly SIP_MONKEYPATCH_COMPAT_NAME( ModeRedrawLayerOnly ),
834  };
835  Q_ENUM( VectorTemporalMode )
836 
837 
842  enum class VectorTemporalLimitMode : int
843  {
844  IncludeBeginExcludeEnd = 0,
845  IncludeBeginIncludeEnd,
846  };
847  Q_ENUM( VectorTemporalLimitMode )
848 
849 
855  {
856  HasFixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ProviderHasFixedTemporalRange ) = 0,
857  StoresFeatureDateTimeInstantInField SIP_MONKEYPATCH_COMPAT_NAME( ProviderStoresFeatureDateTimeInstantInField ),
858  StoresFeatureDateTimeStartAndEndInSeparateFields SIP_MONKEYPATCH_COMPAT_NAME( ProviderStoresFeatureDateTimeStartAndEndInSeparateFields ),
859  };
860  Q_ENUM( VectorDataProviderTemporalMode )
861 
862 
868  {
869  FixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ModeFixedTemporalRange ) = 0,
870  TemporalRangeFromDataProvider SIP_MONKEYPATCH_COMPAT_NAME( ModeTemporalRangeFromDataProvider ) = 1,
871  RedrawLayerOnly SIP_MONKEYPATCH_COMPAT_NAME( ModeRedrawLayerOnly ) = 2,
872  };
873  Q_ENUM( RasterTemporalMode )
874 
875 
881  {
882  MatchUsingWholeRange,
883  MatchExactUsingStartOfRange,
884  MatchExactUsingEndOfRange,
885  FindClosestMatchToStartOfRange,
886  FindClosestMatchToEndOfRange
887  };
888  Q_ENUM( TemporalIntervalMatchMethod )
889 
890 
896  {
897  Forward SIP_MONKEYPATCH_COMPAT_NAME( ForwardTransform ),
898  Reverse SIP_MONKEYPATCH_COMPAT_NAME( ReverseTransform )
899  };
900  Q_ENUM( TransformDirection )
901 
902 
908  {
909  Antialiasing = 0x01,
910  DrawEditingInfo = 0x02,
911  ForceVectorOutput = 0x04,
912  UseAdvancedEffects = 0x08,
913  DrawLabeling = 0x10,
914  UseRenderingOptimization = 0x20,
915  DrawSelection = 0x40,
916  DrawSymbolBounds = 0x80,
917  RenderMapTile = 0x100,
918  RenderPartialOutput = 0x200,
919  RenderPreviewJob = 0x400,
920  RenderBlocking = 0x800,
921  LosslessImageRendering = 0x1000,
922  Render3DMap = 0x2000,
923  };
926  Q_ENUM( MapSettingsFlag )
927 
928 
934  {
935  DrawEditingInfo = 0x01,
936  ForceVectorOutput = 0x02,
937  UseAdvancedEffects = 0x04,
938  UseRenderingOptimization = 0x08,
939  DrawSelection = 0x10,
940  DrawSymbolBounds = 0x20,
941  RenderMapTile = 0x40,
942  Antialiasing = 0x80,
943  RenderPartialOutput = 0x100,
944  RenderPreviewJob = 0x200,
945  RenderBlocking = 0x400,
946  RenderSymbolPreview = 0x800,
947  LosslessImageRendering = 0x1000,
948  ApplyScalingWorkaroundForTextRendering = 0x2000,
949  Render3DMap = 0x4000,
950  ApplyClipAfterReprojection = 0x8000,
951  RenderingSubSymbol = 0x10000,
952  };
955  Q_ENUM( RenderContextFlag )
956 
957  // refs for below dox: https://github.com/qgis/QGIS/pull/1286#issuecomment-39806854
958  // https://github.com/qgis/QGIS/pull/8573#issuecomment-445585826
959 
960 
965  {
966  AlwaysOutlines SIP_MONKEYPATCH_COMPAT_NAME( TextFormatAlwaysOutlines ),
967  AlwaysText SIP_MONKEYPATCH_COMPAT_NAME( TextFormatAlwaysText ),
968  };
969  Q_ENUM( TextRenderFormat )
970 
971 
976  enum class RenderSubcomponentProperty : int
977  {
978  Generic,
979  ShadowOffset,
980  BlurSize,
981  GlowSpread,
982  };
983  Q_ENUM( RenderSubcomponentProperty )
984 
985 
990  {
991  Segment SIP_MONKEYPATCH_COMPAT_NAME( SegmentVertex ) = 1,
992  Curve SIP_MONKEYPATCH_COMPAT_NAME( CurveVertex ) = 2,
993  };
994  Q_ENUM( VertexType )
995 
996 
1000  static const double DEFAULT_SEARCH_RADIUS_MM;
1001 
1003  static const float DEFAULT_MAPTOPIXEL_THRESHOLD;
1004 
1011  static const QColor DEFAULT_HIGHLIGHT_COLOR;
1012 
1017  static const double DEFAULT_HIGHLIGHT_BUFFER_MM;
1018 
1023  static const double DEFAULT_HIGHLIGHT_MIN_WIDTH_MM;
1024 
1031  static const double SCALE_PRECISION;
1032 
1038  static const double DEFAULT_Z_COORDINATE;
1039 
1045  static const double DEFAULT_M_COORDINATE;
1046 
1052  static const double UI_SCALE_FACTOR;
1053 
1058  static const double DEFAULT_SNAP_TOLERANCE;
1059 
1064  static const QgsTolerance::UnitType DEFAULT_SNAP_UNITS;
1065 
1071  static QString defaultProjectScales();
1072 
1078  static int geosVersionInt();
1079 
1085  static int geosVersionMajor();
1086 
1092  static int geosVersionMinor();
1093 
1099  static int geosVersionPatch();
1100 
1106  static QString geosVersion();
1107 };
1108 
1109 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolRenderHints )
1110 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolFlags )
1111 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolPreviewFlags )
1112 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolLayerFlags )
1113 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BrowserItemCapabilities )
1114 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SublayerQueryFlags )
1115 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SublayerFlags )
1116 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SqlLayerDefinitionCapabilities )
1117 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BabelFormatCapabilities )
1118 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BabelCommandFlags )
1119 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::GeometryValidityFlags )
1120 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::FileOperationFlags )
1121 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::AnnotationItemFlags )
1122 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::AnnotationItemGuiFlags )
1123 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MapSettingsFlags )
1124 Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::RenderContextFlags )
1125 
1126 
1127 // hack to workaround warnings when casting void pointers
1128 // retrieved from QLibrary::resolve to function pointers.
1129 // It's assumed that this works on all systems supporting
1130 // QLibrary
1131 #define cast_to_fptr(f) f
1132 
1133 
1142 // based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
1143 template<class Object> class QgsSignalBlocker SIP_SKIP SIP_SKIP // clazy:exclude=rule-of-three
1144 {
1145  public:
1146 
1151  explicit QgsSignalBlocker( Object * object )
1152  : mObject( object )
1153  , mPreviousState( object->blockSignals( true ) )
1154  {}
1155 
1157  {
1158  mObject->blockSignals( mPreviousState );
1159  }
1160 
1162  Object *operator->() { return mObject; }
1163 
1164  private:
1165 
1166  Object *mObject = nullptr;
1167  bool mPreviousState;
1168 
1169 };
1170 
1184 // based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
1185 template<class Object> inline QgsSignalBlocker<Object> whileBlocking( Object *object ) SIP_SKIP SIP_SKIP
1186 {
1187  return QgsSignalBlocker<Object>( object );
1188 }
1189 
1191 CORE_EXPORT uint qHash( const QVariant &variant );
1192 
1198 inline QString qgsDoubleToString( double a, int precision = 17 )
1199 {
1200  QString str = QString::number( a, 'f', precision );
1201  if ( precision )
1202  {
1203  if ( str.contains( QLatin1Char( '.' ) ) )
1204  {
1205  // remove ending 0s
1206  int idx = str.length() - 1;
1207  while ( str.at( idx ) == '0' && idx > 1 )
1208  {
1209  idx--;
1210  }
1211  if ( idx < str.length() - 1 )
1212  str.truncate( str.at( idx ) == '.' ? idx : idx + 1 );
1213  }
1214  }
1215  // avoid printing -0
1216  // see https://bugreports.qt.io/browse/QTBUG-71439
1217  if ( str == QLatin1String( "-0" ) )
1218  {
1219  return QLatin1String( "0" );
1220  }
1221  return str;
1222 }
1223 
1230 inline bool qgsNanCompatibleEquals( double a, double b )
1231 {
1232  const bool aIsNan = std::isnan( a );
1233  const bool bIsNan = std::isnan( b );
1234  if ( aIsNan || bIsNan )
1235  return aIsNan && bIsNan;
1236 
1237  return a == b;
1238 }
1239 
1246 inline bool qgsDoubleNear( double a, double b, double epsilon = 4 * std::numeric_limits<double>::epsilon() )
1247 {
1248  const bool aIsNan = std::isnan( a );
1249  const bool bIsNan = std::isnan( b );
1250  if ( aIsNan || bIsNan )
1251  return aIsNan && bIsNan;
1252 
1253  const double diff = a - b;
1254  return diff > -epsilon && diff <= epsilon;
1255 }
1256 
1263 inline bool qgsFloatNear( float a, float b, float epsilon = 4 * FLT_EPSILON )
1264 {
1265  const bool aIsNan = std::isnan( a );
1266  const bool bIsNan = std::isnan( b );
1267  if ( aIsNan || bIsNan )
1268  return aIsNan && bIsNan;
1269 
1270  const float diff = a - b;
1271  return diff > -epsilon && diff <= epsilon;
1272 }
1273 
1275 inline bool qgsDoubleNearSig( double a, double b, int significantDigits = 10 )
1276 {
1277  const bool aIsNan = std::isnan( a );
1278  const bool bIsNan = std::isnan( b );
1279  if ( aIsNan || bIsNan )
1280  return aIsNan && bIsNan;
1281 
1282  // The most simple would be to print numbers as %.xe and compare as strings
1283  // but that is probably too costly
1284  // Then the fastest would be to set some bits directly, but little/big endian
1285  // has to be considered (maybe TODO)
1286  // Is there a better way?
1287  int aexp, bexp;
1288  const double ar = std::frexp( a, &aexp );
1289  const double br = std::frexp( b, &bexp );
1290 
1291  return aexp == bexp &&
1292  std::round( ar * std::pow( 10.0, significantDigits ) ) == std::round( br * std::pow( 10.0, significantDigits ) );
1293 }
1294 
1300 inline double qgsRound( double number, int places )
1301 {
1302  const double m = ( number < 0.0 ) ? -1.0 : 1.0;
1303  const double scaleFactor = std::pow( 10.0, places );
1304  return ( std::round( number * m * scaleFactor ) / scaleFactor ) * m;
1305 }
1306 
1307 
1308 #ifndef SIP_RUN
1309 
1311 
1321 namespace qgis
1322 {
1323 
1336  template<typename To, typename From> inline To down_cast( From *f )
1337  {
1338  static_assert(
1339  ( std::is_base_of<From,
1340  typename std::remove_pointer<To>::type>::value ),
1341  "target type not derived from source type" );
1342  Q_ASSERT( f == nullptr || dynamic_cast<To>( f ) != nullptr );
1343  return static_cast<To>( f );
1344  }
1345 
1346  template<class T>
1347  QSet<T> listToSet( const QList<T> &list )
1348  {
1349 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
1350  return list.toSet();
1351 #else
1352  return QSet<T>( list.begin(), list.end() );
1353 #endif
1354  }
1355 
1356  template<class T>
1357  QList<T> setToList( const QSet<T> &set )
1358  {
1359 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
1360  return set.toList();
1361 #else
1362  return QList<T>( set.begin(), set.end() );
1363 #endif
1364  }
1365 }
1366 
1367 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
1368 namespace std
1369 {
1370  template<> struct hash<QString>
1371  {
1372  std::size_t operator()( const QString &s ) const noexcept
1373  {
1374  return ( size_t ) qHash( s );
1375  }
1376  };
1377 }
1378 #endif
1379 
1381 #endif
1382 
1388 template<class T> const QMap<T, QString> qgsEnumMap() SIP_SKIP
1389 {
1390  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
1391  Q_ASSERT( metaEnum.isValid() );
1392  QMap<T, QString> enumMap;
1393  for ( int idx = 0; idx < metaEnum.keyCount(); ++idx )
1394  {
1395  const char *enumKey = metaEnum.key( idx );
1396  enumMap.insert( static_cast<T>( metaEnum.keyToValue( enumKey ) ), QString( enumKey ) );
1397  }
1398  return enumMap;
1399 }
1400 
1405 template<class T> QString qgsEnumValueToKey( const T &value ) SIP_SKIP
1406 {
1407  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
1408  Q_ASSERT( metaEnum.isValid() );
1409  return QString::fromUtf8( metaEnum.valueToKey( static_cast<int>( value ) ) );
1410 }
1411 
1418 template<class T> T qgsEnumKeyToValue( const QString &key, const T &defaultValue, bool tryValueAsKey = true ) SIP_SKIP
1419 {
1420  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
1421  Q_ASSERT( metaEnum.isValid() );
1422  bool ok = false;
1423  T v = static_cast<T>( metaEnum.keyToValue( key.toUtf8().data(), &ok ) );
1424  if ( ok )
1425  {
1426  return v;
1427  }
1428  else
1429  {
1430  // if conversion has failed, try with conversion from int value
1431  if ( tryValueAsKey )
1432  {
1433  bool canConvert = false;
1434  const int intValue = key.toInt( &canConvert );
1435  if ( canConvert && metaEnum.valueToKey( intValue ) )
1436  {
1437  return static_cast<T>( intValue );
1438  }
1439  }
1440  }
1441  return defaultValue;
1442 }
1443 
1448 template<class T> QString qgsFlagValueToKeys( const T &value ) SIP_SKIP
1449 {
1450  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
1451  Q_ASSERT( metaEnum.isValid() );
1452  return QString::fromUtf8( metaEnum.valueToKeys( static_cast<int>( value ) ) );
1453 }
1454 
1460 template<class T> T qgsFlagKeysToValue( const QString &keys, const T &defaultValue ) SIP_SKIP
1461 {
1462  const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
1463  Q_ASSERT( metaEnum.isValid() );
1464  bool ok = false;
1465  T v = static_cast<T>( metaEnum.keysToValue( keys.toUtf8().constData(), &ok ) );
1466  if ( ok )
1467  return v;
1468  else
1469  return defaultValue;
1470 }
1471 
1472 
1482 CORE_EXPORT double qgsPermissiveToDouble( QString string, bool &ok );
1483 
1493 CORE_EXPORT int qgsPermissiveToInt( QString string, bool &ok );
1494 
1504 CORE_EXPORT qlonglong qgsPermissiveToLongLong( QString string, bool &ok );
1505 
1515 CORE_EXPORT bool qgsVariantLessThan( const QVariant &lhs, const QVariant &rhs );
1516 
1525 CORE_EXPORT bool qgsVariantEqual( const QVariant &lhs, const QVariant &rhs );
1526 
1533 CORE_EXPORT bool qgsVariantGreaterThan( const QVariant &lhs, const QVariant &rhs );
1534 
1535 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1536 
1543 inline bool operator> ( const QVariant &v1, const QVariant &v2 )
1544 {
1545  return qgsVariantGreaterThan( v1, v2 );
1546 }
1547 
1557 inline bool operator< ( const QVariant &v1, const QVariant &v2 )
1558 {
1559  return qgsVariantLessThan( v1, v2 );
1560 }
1561 #endif
1562 
1563 
1564 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
1565 
1569 template<> CORE_EXPORT bool qMapLessThanKey<QVariantList>( const QVariantList &key1, const QVariantList &key2 ) SIP_SKIP;
1570 #endif
1571 
1572 CORE_EXPORT QString qgsVsiPrefix( const QString &path );
1573 
1579 void CORE_EXPORT *qgsMalloc( size_t size ) SIP_SKIP;
1580 
1588 void CORE_EXPORT *qgsCalloc( size_t nmemb, size_t size ) SIP_SKIP;
1589 
1594 void CORE_EXPORT qgsFree( void *ptr ) SIP_SKIP;
1595 
1596 #ifndef SIP_RUN
1597 
1598 #ifdef _MSC_VER
1599 #define CONSTLATIN1STRING inline const QLatin1String
1600 #else
1601 #define CONSTLATIN1STRING constexpr QLatin1String
1602 #endif
1603 
1605 class ScopedIntIncrementor
1606 {
1607  public:
1608 
1609  ScopedIntIncrementor( int *variable )
1610  : mVariable( variable )
1611  {
1612  ( *mVariable )++;
1613  }
1614 
1615  ScopedIntIncrementor( const ScopedIntIncrementor &other ) = delete;
1616  ScopedIntIncrementor &operator=( const ScopedIntIncrementor &other ) = delete;
1617 
1618  void release()
1619  {
1620  if ( mVariable )
1621  ( *mVariable )--;
1622 
1623  mVariable = nullptr;
1624  }
1625 
1626  ~ScopedIntIncrementor()
1627  {
1628  release();
1629  }
1630 
1631  private:
1632  int *mVariable = nullptr;
1633 };
1635 
1641 {
1642  return QLatin1String(
1643  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]] )"""
1644  );
1645 }
1646 
1649 {
1650  return QLatin1String( "+proj=longlat +datum=WGS84 +no_defs" );
1651 }
1652 
1655 {
1656  return QLatin1String( "EPSG:4326" );
1657 }
1658 
1661 {
1662  return QLatin1String( "NONE" );
1663 }
1664 
1666 
1668 const int PREVIEW_JOB_DELAY_MS = 250;
1669 
1671 const int MAXIMUM_LAYER_PREVIEW_TIME_MS = 250;
1672 
1674 
1675 #endif
1676 
1678 const long GEOSRID = 4326;
1679 
1681 const long GEOCRS_ID = 3452;
1682 
1684 const long GEO_EPSG_CRS_ID = 4326;
1685 
1690 const int USER_CRS_START_ID = 100000;
1691 
1692 //
1693 // Constants for point symbols
1694 //
1695 
1697 const double DEFAULT_POINT_SIZE = 2.0;
1698 const double DEFAULT_LINE_WIDTH = 0.26;
1699 
1701 const double DEFAULT_SEGMENT_EPSILON = 1e-8;
1702 
1703 typedef QMap<QString, QString> QgsStringMap SIP_SKIP;
1704 
1713 typedef unsigned long long qgssize;
1714 
1715 #ifndef SIP_RUN
1716 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
1717 
1718 #define Q_NOWARN_DEPRECATED_PUSH \
1719  _Pragma("GCC diagnostic push") \
1720  _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
1721 #define Q_NOWARN_DEPRECATED_POP \
1722  _Pragma("GCC diagnostic pop");
1723 #define Q_NOWARN_UNREACHABLE_PUSH
1724 #define Q_NOWARN_UNREACHABLE_POP
1725 
1726 #elif defined(_MSC_VER)
1727 
1728 #define Q_NOWARN_DEPRECATED_PUSH \
1729  __pragma(warning(push)) \
1730  __pragma(warning(disable:4996))
1731 #define Q_NOWARN_DEPRECATED_POP \
1732  __pragma(warning(pop))
1733 #define Q_NOWARN_UNREACHABLE_PUSH \
1734  __pragma(warning(push)) \
1735  __pragma(warning(disable:4702))
1736 #define Q_NOWARN_UNREACHABLE_POP \
1737  __pragma(warning(pop))
1738 
1739 #else
1740 
1741 #define Q_NOWARN_DEPRECATED_PUSH
1742 #define Q_NOWARN_DEPRECATED_POP
1743 #define Q_NOWARN_UNREACHABLE_PUSH
1744 #define Q_NOWARN_UNREACHABLE_POP
1745 
1746 #endif
1747 #endif
1748 
1749 #ifndef QGISEXTERN
1750 #ifdef Q_OS_WIN
1751 # define QGISEXTERN extern "C" __declspec( dllexport )
1752 #else
1753 # if defined(__GNUC__) || defined(__clang__)
1754 # define QGISEXTERN extern "C" __attribute__ ((visibility ("default")))
1755 # else
1756 # define QGISEXTERN extern "C"
1757 # endif
1758 #endif
1759 #endif
1760 #endif
1761 
1762 #if __cplusplus >= 201500
1763 #define FALLTHROUGH [[fallthrough]];
1764 #elif defined(__clang__)
1765 #define FALLTHROUGH [[clang::fallthrough]];
1766 #elif defined(__GNUC__) && __GNUC__ >= 7
1767 #define FALLTHROUGH [[gnu::fallthrough]];
1768 #else
1769 #define FALLTHROUGH
1770 #endif
1771 
1772 // see https://infektor.net/posts/2017-01-19-using-cpp17-attributes-today.html#using-the-nodiscard-attribute
1773 #if __cplusplus >= 201703L
1774 #define NODISCARD [[nodiscard]]
1775 #elif defined(__clang__)
1776 #define NODISCARD [[nodiscard]]
1777 #elif defined(_MSC_VER)
1778 #define NODISCARD // no support
1779 #elif defined(__has_cpp_attribute)
1780 #if __has_cpp_attribute(nodiscard)
1781 #define NODISCARD [[nodiscard]]
1782 #elif __has_cpp_attribute(gnu::warn_unused_result)
1783 #define NODISCARD [[gnu::warn_unused_result]]
1784 #else
1785 #define NODISCARD Q_REQUIRED_RESULT
1786 #endif
1787 #else
1788 #define NODISCARD Q_REQUIRED_RESULT
1789 #endif
1790 
1791 #if __cplusplus >= 201703L
1792 #define MAYBE_UNUSED [[maybe_unused]]
1793 #elif defined(__clang__)
1794 #define MAYBE_UNUSED [[maybe_unused]]
1795 #elif defined(_MSC_VER)
1796 #define MAYBE_UNUSED // no support
1797 #elif defined(__has_cpp_attribute)
1798 #if __has_cpp_attribute(gnu::unused)
1799 #define MAYBE_UNUSED [[gnu::unused]]
1800 #else
1801 #define MAYBE_UNUSED
1802 #endif
1803 #else
1804 #define MAYBE_UNUSED
1805 #endif
1806 
1807 #ifndef FINAL
1808 #define FINAL final
1809 #endif
1810 
1811 #ifndef SIP_RUN
1812 #ifdef _MSC_VER
1813 #define BUILTIN_UNREACHABLE \
1814  __assume(false);
1815 #elif defined(__GNUC__) && !defined(__clang__)
1816 // Workaround a GCC bug where a -Wreturn-type warning is emitted in constructs
1817 // like:
1818 // switch( mVariableThatCanOnlyBeXorY )
1819 // {
1820 // case X:
1821 // return "foo";
1822 // case Y:
1823 // return "foo";
1824 // }
1825 // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
1826 #define BUILTIN_UNREACHABLE \
1827  __builtin_unreachable();
1828 #else
1829 #define BUILTIN_UNREACHABLE
1830 #endif
1831 #endif // SIP_RUN
1832 
1833 #ifdef SIP_RUN
1834 
1839 QString CORE_EXPORT geoWkt();
1840 
1842 QString CORE_EXPORT geoProj4();
1843 
1845 QString CORE_EXPORT geoEpsgCrsAuthId();
1846 
1848 QString CORE_EXPORT geoNone();
1849 
1850 #endif
The Qgis class provides global constants for use throughout the application.
Definition: qgis.h:63
GeometryValidityFlag
Geometry validity check flags.
Definition: qgis.h:675
MapLayerProperty
File operation flags.
Definition: qgis.h:764
BufferSide
Side of line to buffer.
Definition: qgis.h:699
RasterResamplingStage
Stage at which raster resampling occurs.
Definition: qgis.h:488
VectorTemporalMode
Vector layer temporal feature modes.
Definition: qgis.h:827
SublayerFlag
Sublayer query flags.
Definition: qgis.h:458
AnnotationItemNodeType
Annotation item GUI flags.
Definition: qgis.h:803
static const char * QGIS_DEV_VERSION
The development version.
Definition: qgis.h:89
DriveType
Drive types.
Definition: qgis.h:402
ContentStatus
Status for fetched or stored content.
Definition: qgis.h:586
GeometryOperationResult
Success or failure of a geometry operation.
Definition: qgis.h:647
BrowserItemState
Browser item states.
Definition: qgis.h:267
AnnotationItemFlag
Map layer properties.
Definition: qgis.h:777
RenderSubcomponentProperty
Rendering subcomponent properties.
Definition: qgis.h:977
SymbolRenderHint
Flags controlling behavior of symbols during rendering.
Definition: qgis.h:195
BrowserItemCapability
Browser item capabilities.
Definition: qgis.h:280
BrowserDirectoryMonitoring
Browser directory item monitoring switches.
Definition: qgis.h:323
VectorExportResult
Vector layer export result codes.
Definition: qgis.h:347
SymbolLayerFlag
Flags controlling behavior of symbol layers.
Definition: qgis.h:235
ScaleMethod
Scale methods.
Definition: qgis.h:183
FilePathType
File path types.
Definition: qgis.h:519
VertexType
Types of vertex.
Definition: qgis.h:990
GeometryValidationEngine
Available engines for validating geometries.
Definition: qgis.h:687
FileOperationFlag
File operation flags.
Definition: qgis.h:750
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition: qgis.h:106
SqlKeywordCategory
SQL layer definition capabilities.
Definition: qgis.h:384
MeshEditingErrorType
Type of error that can occur during mesh frame editing.
Definition: qgis.h:502
AnnotationItemEditOperationResult
Results from an edit operation on an annotation item.
Definition: qgis.h:814
ActionStart
Enum to determine when an operation would begin.
Definition: qgis.h:418
TemporalIntervalMatchMethod
Method to use when resolving a temporal range to a data provider layer or band.
Definition: qgis.h:881
SublayerQueryFlag
Flags which control how data providers will scan for sublayers in a dataset.
Definition: qgis.h:442
PythonMacroMode
Authorisation to run Python Macros.
Definition: qgis.h:143
UnplacedLabelVisibility
Unplaced label visibility.
Definition: qgis.h:430
SpatialFilterType
Feature request spatial filter types.
Definition: qgis.h:737
BrowserItemType
Symbol layer flags.
Definition: qgis.h:248
RasterTemporalMode
Raster layer temporal modes.
Definition: qgis.h:868
JoinStyle
Join styles for buffers.
Definition: qgis.h:724
BrowserLayerType
Browser item layer types.
Definition: qgis.h:300
VectorDataProviderTemporalMode
Vector data provider temporal handling modes.
Definition: qgis.h:855
TextRenderFormat
Options for rendering text.
Definition: qgis.h:965
DataType
Raster data types.
Definition: qgis.h:120
Q_DECLARE_FLAGS(RenderContextFlags, RenderContextFlag) SIP_MONKEYPATCH_FLAGS_UNNEST(QgsRenderContext
Render context flags.
EndCapStyle
End cap styles for buffers.
Definition: qgis.h:711
BabelCommandFlag
Babel GPS format capabilities.
Definition: qgis.h:619
RenderContextFlag
Flags which affect rendering operations.
Definition: qgis.h:934
RasterPipeInterfaceRole
Sublayer flags.
Definition: qgis.h:471
SymbolPreviewFlag
Symbol flags.
Definition: qgis.h:222
AnnotationItemGuiFlag
Annotation item flags.
Definition: qgis.h:790
VertexMarkerType
Editing vertex markers, used for showing vertices during a edit operation.
Definition: qgis.h:574
SublayerPromptMode
Specifies how to handle layer sources with multiple sublayers.
Definition: qgis.h:531
GpsFeatureType
Babel command flags.
Definition: qgis.h:632
VectorTemporalLimitMode
Mode for the handling of the limits of the filtering timeframe for vector features.
Definition: qgis.h:843
SqlLayerDefinitionCapability
SqlLayerDefinitionCapability enum lists the arguments supported by the provider when creating SQL que...
Definition: qgis.h:368
VectorEditResult
Specifies the result of a vector layer edit operation.
Definition: qgis.h:559
Q_DECLARE_FLAGS(GeometryValidityFlags, GeometryValidityFlag) SIP_MONKEYPATCH_FLAGS_UNNEST(QgsGeometry
Geometry validity flags.
SymbolType
Symbol types.
Definition: qgis.h:169
BabelFormatCapability
Babel GPS format capabilities.
Definition: qgis.h:601
SymbolFlag
Flags controlling behavior of symbols.
Definition: qgis.h:209
HttpMethod
Different methods of HTTP requests.
Definition: qgis.h:335
TransformDirection
Indicates the direction (forward or inverse) of a transform.
Definition: qgis.h:896
Q_DECLARE_FLAGS(MapSettingsFlags, MapSettingsFlag) SIP_MONKEYPATCH_FLAGS_UNNEST(QgsMapSettings
Map settings flags.
MapSettingsFlag
Flags which adjust the way maps are rendered.
Definition: qgis.h:908
SelectBehavior
Specifies how a selection should be applied.
Definition: qgis.h:545
Class for doing transforms between two map coordinate systems.
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.
Implementation of data provider temporal properties for QgsRasterDataProviders.
Implementation of map layer temporal properties for raster layers.
Contains a pipeline of raster interfaces for sequential raster processing.
Definition: qgsrasterpipe.h:50
Contains information about the context of a rendering operation.
RAII signal blocking class.
Definition: qgis.h:1144
~QgsSignalBlocker()
Definition: qgis.h:1156
QgsSignalBlocker(Object *object)
Constructor for QgsSignalBlocker.
Definition: qgis.h:1151
Object * operator->()
Returns pointer to blocked QObject.
Definition: qgis.h:1162
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:38
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:158
QgsMapLayerType
Types of layers that can be added to a map.
Definition: qgis.h:47
@ PointCloudLayer
Added in 3.18.
@ MeshLayer
Added in 3.2.
@ VectorTileLayer
Added in 3.14.
@ AnnotationLayer
Contains freeform, georeferenced annotations. Added in QGIS 3.16.
int significantDigits(const Qgis::DataType rasterDataType)
Returns the maximum number of significant digits a for the given rasterDataType.
#define str(x)
Definition: qgis.cpp:37
CONSTLATIN1STRING geoNone()
Constant that holds the string representation for "No ellips/No CRS".
Definition: qgis.h:1660
const double DEFAULT_LINE_WIDTH
Definition: qgis.h:1698
CORE_EXPORT uint qHash(const QVariant &variant)
Hash for QVariant.
Definition: qgis.cpp:225
bool operator>(const QVariant &v1, const QVariant &v2)
Compares two QVariant values and returns whether the first is greater than the second.
Definition: qgis.h:1543
void CORE_EXPORT * qgsCalloc(size_t nmemb, size_t size)
Allocates memory for an array of nmemb elements of size bytes each and returns a pointer to the alloc...
Definition: qgis.cpp:107
CORE_EXPORT QString qgsVsiPrefix(const QString &path)
Definition: qgis.cpp:200
CORE_EXPORT bool qgsVariantEqual(const QVariant &lhs, const QVariant &rhs)
Compares two QVariant values and returns whether they are equal, two NULL values are always treated a...
Definition: qgis.cpp:274
void CORE_EXPORT * qgsMalloc(size_t size)
Allocates size bytes and returns a pointer to the allocated memory.
Definition: qgis.cpp:92
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
Definition: qgis.h:1198
QString qgsEnumValueToKey(const T &value)
Returns the value for the given key of an enum.
Definition: qgis.h:1405
const QMap< T, QString > qgsEnumMap()
Returns a map of all enum entries.
Definition: qgis.h:1388
const long GEO_EPSG_CRS_ID
Magic number for a geographic coord sys in EpsgCrsId ID format.
Definition: qgis.h:1684
CORE_EXPORT bool qgsVariantGreaterThan(const QVariant &lhs, const QVariant &rhs)
Compares two QVariant values and returns whether the first is greater than the second.
Definition: qgis.cpp:195
unsigned long long qgssize
Qgssize is used instead of size_t, because size_t is stdlib type, unknown by SIP, and it would be har...
Definition: qgis.h:1713
bool qgsFloatNear(float a, float b, float epsilon=4 *FLT_EPSILON)
Compare two floats (but allow some difference)
Definition: qgis.h:1263
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:1300
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
Definition: qgis.h:1246
CONSTLATIN1STRING geoProj4()
PROJ4 string that represents a geographic coord sys.
Definition: qgis.h:1648
T qgsFlagKeysToValue(const QString &keys, const T &defaultValue)
Returns the value corresponding to the given keys of a flag.
Definition: qgis.h:1460
bool qgsNanCompatibleEquals(double a, double b)
Compare two doubles, treating nan values as equal.
Definition: qgis.h:1230
const double DEFAULT_SEGMENT_EPSILON
Default snapping tolerance for segments.
Definition: qgis.h:1701
QMap< QString, QString > QgsStringMap
Definition: qgis.h:1703
#define CONSTLATIN1STRING
Definition: qgis.h:1601
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition: qgis.h:1185
CONSTLATIN1STRING geoWkt()
Wkt string that represents a geographic coord sys.
Definition: qgis.h:1640
bool qgsDoubleNearSig(double a, double b, int significantDigits=10)
Compare two doubles using specified number of significant digits.
Definition: qgis.h:1275
const int USER_CRS_START_ID
Magick number that determines whether a projection crsid is a system (srs.db) or user (~/....
Definition: qgis.h:1690
QString qgsFlagValueToKeys(const T &value)
Returns the value for the given keys of a flag.
Definition: qgis.h:1448
void CORE_EXPORT qgsFree(void *ptr)
Frees the memory space pointed to by ptr.
Definition: qgis.cpp:122
CORE_EXPORT qlonglong qgsPermissiveToLongLong(QString string, bool &ok)
Converts a string to an qlonglong in a permissive way, e.g., allowing for incorrect numbers of digits...
Definition: qgis.cpp:85
CORE_EXPORT int qgsPermissiveToInt(QString string, bool &ok)
Converts a string to an integer in a permissive way, e.g., allowing for incorrect numbers of digits b...
Definition: qgis.cpp:78
CORE_EXPORT bool qgsVariantLessThan(const QVariant &lhs, const QVariant &rhs)
Compares two QVariant values and returns whether the first is less than the second.
Definition: qgis.cpp:127
const long GEOSRID
Magic number for a geographic coord sys in POSTGIS SRID.
Definition: qgis.h:1678
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:1557
CONSTLATIN1STRING geoEpsgCrsAuthId()
Geographic coord sys from EPSG authority.
Definition: qgis.h:1654
const long GEOCRS_ID
Magic number for a geographic coord sys in QGIS srs.db tbl_srs.srs_id.
Definition: qgis.h:1681
T qgsEnumKeyToValue(const QString &key, const T &defaultValue, bool tryValueAsKey=true)
Returns the value corresponding to the given key of an enum.
Definition: qgis.h:1418
const double DEFAULT_POINT_SIZE
Magic number that determines the default point size for point symbols.
Definition: qgis.h:1697
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition: qgis_sip.h:257
#define SIP_MONKEYPATCH_FLAGS_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition: qgis_sip.h:258
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)
Definition: qgis_sip.h:259
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
int precision
Utility class for identifying a unique vertex within a geometry.
Definition: qgsvertexid.h:31