QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
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
37int QgisEvent = QEvent::User + 1;
38% End
39#endif
40
47 {
51 MeshLayer,
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
71class CORE_EXPORT Qgis
72{
73 Q_GADGET
74 public:
75
81 static QString version();
82
88 static int versionInt();
89
95 static QString releaseName();
96
98 static const char *QGIS_DEV_VERSION;
99
105 static QString devVersion();
106
107 // Enumerations
108 //
109
115 {
116 Info = 0,
117 Warning = 1,
118 Critical = 2,
119 Success = 3,
120 NoLevel = 4,
121 };
122 Q_ENUM( MessageLevel )
123
124
129 {
130 UnknownDataType = 0,
131 Byte = 1,
132 UInt16 = 2,
133 Int16 = 3,
134 UInt32 = 4,
135 Int32 = 5,
136 Float32 = 6,
137 Float64 = 7,
138 CInt16 = 8,
139 CInt32 = 9,
140 CFloat32 = 10,
141 CFloat64 = 11,
142 ARGB32 = 12,
143 ARGB32_Premultiplied = 13
144 };
145 Q_ENUM( DataType )
146
147
152 enum class CaptureTechnique : int
153 {
154 StraightSegments,
155 CircularString,
156 Streaming,
157 Shape,
158 };
159 Q_ENUM( CaptureTechnique )
160
161
166 enum class VectorLayerTypeFlag : int
167 {
168 SqlQuery = 1 << 0
169 };
170 Q_ENUM( VectorLayerTypeFlag )
172 Q_DECLARE_FLAGS( VectorLayerTypeFlags, VectorLayerTypeFlag )
173 Q_FLAG( VectorLayerTypeFlags )
174
175
180 {
181 Never = 0,
182 Ask = 1,
183 SessionOnly = 2,
184 Always = 3,
185 NotForThisSession,
186 };
187 Q_ENUM( PythonMacroMode )
188
189
195 {
196 Uncounted = -2,
197 UnknownCount = -1,
198 };
199 Q_ENUM( FeatureCountState )
200
201
206 {
207 Marker,
208 Line,
209 Fill,
210 Hybrid
211 };
212 Q_ENUM( SymbolType )
213
214
220 {
221 ScaleArea,
222 ScaleDiameter
223 };
224 Q_ENUM( ScaleMethod )
225
226
231 {
232 Variant,
233 String,
234 StringList,
235 Bool,
236 Integer,
237 Double,
238 EnumFlag,
239 Color
240 };
241 Q_ENUM( SettingsType )
242
243
247 enum class SettingsOption : int
248 {
249 SaveFormerValue = 1 << 1, //<! Save the former value of the settings
250 SaveEnumFlagAsInt = 1 << 2,
251 };
252 Q_ENUM( SettingsOption )
253 Q_DECLARE_FLAGS( SettingsOptions, SettingsOption )
254 Q_FLAG( SettingsOptions )
255
256
261 {
262 ActiveLayer = 1,
263 AllLayers = 2,
264 AdvancedConfiguration = 3,
265 };
266 Q_ENUM( SnappingMode )
267
268
273 {
274 NoSnap SIP_MONKEYPATCH_COMPAT_NAME( NoSnapFlag ) = 0,
275 Vertex SIP_MONKEYPATCH_COMPAT_NAME( VertexFlag ) = 1 << 0,
276 Segment SIP_MONKEYPATCH_COMPAT_NAME( SegmentFlag ) = 1 << 1,
277 Area SIP_MONKEYPATCH_COMPAT_NAME( AreaFlag ) = 1 << 2,
278 Centroid SIP_MONKEYPATCH_COMPAT_NAME( CentroidFlag ) = 1 << 3,
279 MiddleOfSegment SIP_MONKEYPATCH_COMPAT_NAME( MiddleOfSegmentFlag ) = 1 << 4,
280 LineEndpoint SIP_MONKEYPATCH_COMPAT_NAME( LineEndpointFlag ) = 1 << 5,
281 };
282 Q_ENUM( SnappingType )
284 Q_DECLARE_FLAGS( SnappingTypes, SnappingType ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsSnappingConfig, SnappingTypeFlag )
285 Q_FLAG( SnappingTypes )
286
293 {
294 DynamicRotation = 2,
295 };
296 Q_ENUM( SymbolRenderHint )
298 Q_DECLARE_FLAGS( SymbolRenderHints, SymbolRenderHint ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsSymbol, RenderHints )
299 Q_FLAG( SymbolRenderHints )
300
306 enum class SymbolFlag : int
307 {
308 RendererShouldUseSymbolLevels = 1 << 0,
309 };
310 Q_ENUM( SymbolFlag )
312 Q_DECLARE_FLAGS( SymbolFlags, SymbolFlag )
313 Q_FLAG( SymbolFlags )
314
315
321 {
322 FlagIncludeCrosshairsForMarkerSymbols = 1 << 0,
323 };
324 Q_ENUM( SymbolPreviewFlag )
326 Q_DECLARE_FLAGS( SymbolPreviewFlags, SymbolPreviewFlag ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsSymbol, SymbolPreviewFlags )
327 Q_FLAG( SymbolPreviewFlags )
328
334 enum class SymbolLayerFlag : int
335 {
336 DisableFeatureClipping = 1 << 0,
337 };
338 Q_ENUM( SymbolLayerFlag )
340 Q_DECLARE_FLAGS( SymbolLayerFlags, SymbolLayerFlag )
341 Q_FLAG( SymbolLayerFlags )
342
343
349 {
350 Collection,
351 Directory,
352 Layer,
353 Error,
354 Favorites,
355 Project,
356 Custom,
357 Fields,
358 Field,
359 };
360 Q_ENUM( BrowserItemType )
361
362
368 {
369 NotPopulated,
370 Populating,
371 Populated,
372 };
373 Q_ENUM( BrowserItemState )
374
375
381 {
382 NoCapabilities = 0,
383 SetCrs = 1 << 0,
384 Fertile = 1 << 1,
385 Fast = 1 << 2,
386 Collapse = 1 << 3,
387 Rename = 1 << 4,
388 Delete = 1 << 5,
389 ItemRepresentsFile = 1 << 6,
390 RefreshChildrenWhenItemIsRefreshed = 1 << 7,
391 };
392 Q_ENUM( BrowserItemCapability )
394 Q_DECLARE_FLAGS( BrowserItemCapabilities, BrowserItemCapability ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsDataItem, Capabilities )
395 Q_FLAG( BrowserItemCapabilities )
396
403 {
404 NoType,
405 Vector,
406 Raster,
407 Point,
408 Line,
409 Polygon,
410 TableLayer,
411 Database,
412 Table,
413 Plugin,
414 Mesh,
415 VectorTile,
416 PointCloud
417 };
418 Q_ENUM( BrowserLayerType )
419
420
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 RasterRendererFlag : int
735 {
736 InternalLayerOpacityHandling = 1 << 0,
737 };
738
744 Q_DECLARE_FLAGS( RasterRendererFlags, RasterRendererFlag )
745
746 Q_ENUM( RasterRendererFlag )
747 Q_FLAG( RasterRendererFlags )
748
749
754 enum class MeshEditingErrorType : int
755 {
756 NoError,
757 InvalidFace,
758 TooManyVerticesInFace,
759 FlatFace,
760 UniqueSharedVertex,
761 InvalidVertex,
762 ManifoldFace,
763 };
764 Q_ENUM( MeshEditingErrorType )
765
766
771 enum class FilePathType : int
772 {
773 Absolute,
774 Relative,
775 };
776 Q_ENUM( FilePathType )
777
778
783 enum class SublayerPromptMode : int
784 {
785 AlwaysAsk,
786 AskExcludingRasterBands,
787 NeverAskSkip,
788 NeverAskLoadAll,
789 };
790 Q_ENUM( SublayerPromptMode )
791
792
798 {
799 SetSelection,
800 AddToSelection,
801 IntersectSelection,
802 RemoveFromSelection,
803 };
804 Q_ENUM( SelectBehavior )
805
806
812 {
813 Intersect,
814 Within,
815 };
816 Q_ENUM( SelectGeometryRelationship )
817
818
823 enum class SelectionFlag : int
824 {
825 SingleFeatureSelection = 1 << 0,
826 ToggleSelection = 1 << 1,
827 };
828
834 Q_DECLARE_FLAGS( SelectionFlags, SelectionFlag )
835
836 Q_ENUM( SelectionFlag )
837 Q_FLAG( SelectionFlags )
838
839
845 {
846 Success = 0,
847 EmptyGeometry = 1,
848 EditFailed = 2,
849 FetchFeatureFailed = 3,
850 InvalidLayer = 4,
851 };
852 Q_ENUM( VectorEditResult )
853
854
860 {
861 SemiTransparentCircle,
862 Cross,
863 NoMarker,
864 };
865 Q_ENUM( VertexMarkerType )
866
867
871 enum class ContentStatus : int
872 {
873 NotStarted,
874 Running,
875 Finished,
876 Failed,
877 Canceled,
878 };
879 Q_ENUM( ContentStatus )
880
881
887 {
888 Unknown = -1,
889 Invalid,
890 GPS,
891 DGPS,
892 PPS,
893 RTK,
894 FloatRTK,
895 Estimated,
896 Manual,
897 Simulation,
898 };
899 Q_ENUM( GpsQualityIndicator )
900
901
906 enum class BabelFormatCapability : int
907 {
908 Import = 1 << 0,
909 Export = 1 << 1,
910 Waypoints = 1 << 2,
911 Routes = 1 << 3,
912 Tracks = 1 << 4,
913 };
915 Q_DECLARE_FLAGS( BabelFormatCapabilities, BabelFormatCapability )
916 Q_ENUM( BabelFormatCapability )
917 Q_FLAG( BabelFormatCapabilities )
918
919
925 enum class BabelCommandFlag : int
926 {
927 QuoteFilePaths = 1 << 0,
928 };
930 Q_DECLARE_FLAGS( BabelCommandFlags, BabelCommandFlag )
931 Q_ENUM( BabelCommandFlag )
932 Q_FLAG( BabelCommandFlags )
933
934
939 enum class GpsFeatureType : int
940 {
941 Waypoint,
942 Route,
943 Track,
944 };
945 Q_ENUM( GpsFeatureType )
946
947
955 {
956 Success = 0,
957 NothingHappened = 1000,
958 InvalidBaseGeometry,
959 InvalidInputGeometryType,
960 SelectionIsEmpty,
961 SelectionIsGreaterThanOne,
962 GeometryEngineError,
963 LayerNotEditable,
964 /* Add part issues */
965 AddPartSelectedGeometryNotFound,
966 AddPartNotMultiGeometry,
967 /* Add ring issues*/
968 AddRingNotClosed,
969 AddRingNotValid,
970 AddRingCrossesExistingRings,
971 AddRingNotInExistingFeature,
972 /* Split features */
973 SplitCannotSplitPoint,
974 };
975 Q_ENUM( GeometryOperationResult )
976
977
983 {
984 AllowSelfTouchingHoles SIP_MONKEYPATCH_COMPAT_NAME( FlagAllowSelfTouchingHoles ) = 1 << 0,
985 };
988 Q_ENUM( GeometryValidityFlag )
989 Q_FLAG( GeometryValidityFlags )
990
991
996 {
997 QgisInternal SIP_MONKEYPATCH_COMPAT_NAME( ValidatorQgisInternal ),
998 Geos SIP_MONKEYPATCH_COMPAT_NAME( ValidatorGeos ),
999 };
1000 Q_ENUM( GeometryValidationEngine )
1001
1002
1008 {
1009 Left SIP_MONKEYPATCH_COMPAT_NAME( SideLeft ) = 0,
1010 Right SIP_MONKEYPATCH_COMPAT_NAME( SideRight ),
1011 };
1012 Q_ENUM( BufferSide )
1013
1014
1020 {
1021 Round SIP_MONKEYPATCH_COMPAT_NAME( CapRound ) = 1,
1022 Flat SIP_MONKEYPATCH_COMPAT_NAME( CapFlat ),
1023 Square SIP_MONKEYPATCH_COMPAT_NAME( CapSquare ),
1024 };
1025 Q_ENUM( EndCapStyle )
1026
1027
1033 {
1034 Round SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleRound ) = 1,
1035 Miter SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleMiter ),
1036 Bevel SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleBevel ),
1037 };
1038 Q_ENUM( JoinStyle )
1039
1040
1045 enum class MakeValidMethod : int
1046 {
1047 Linework = 0,
1048 Structure = 1,
1049 };
1050 Q_ENUM( MakeValidMethod )
1051
1052
1057 enum class SpatialFilterType : int
1058 {
1059 NoFilter,
1060 BoundingBox,
1061 DistanceWithin,
1062 };
1063 Q_ENUM( SpatialFilterType )
1064
1065
1070 enum class FileOperationFlag : int
1071 {
1072 IncludeMetadataFile = 1 << 0,
1073 IncludeStyleFile = 1 << 1,
1074 };
1076 Q_DECLARE_FLAGS( FileOperationFlags, FileOperationFlag )
1077 Q_ENUM( FileOperationFlag )
1078 Q_FLAG( FileOperationFlags )
1079
1080
1085 enum class MapLayerProperty : int
1086 {
1087 UsersCannotToggleEditing = 1 << 0,
1088 IsBasemapLayer = 1 << 1,
1089 };
1091 Q_DECLARE_FLAGS( MapLayerProperties, MapLayerProperty )
1092 Q_ENUM( MapLayerProperty )
1093 Q_FLAG( MapLayerProperties )
1094
1095
1100 enum class DataProviderFlag : int
1101 {
1102 IsBasemapSource = 1 << 1,
1103 };
1105 Q_DECLARE_FLAGS( DataProviderFlags, DataProviderFlag )
1106 Q_ENUM( DataProviderFlag )
1107 Q_FLAG( DataProviderFlags )
1108
1109
1116 enum class CrsAxisDirection : int
1117 {
1118 North,
1119 NorthNorthEast,
1120 NorthEast,
1121 EastNorthEast,
1122 East,
1123 EastSouthEast,
1124 SouthEast,
1125 SouthSouthEast,
1126 South,
1127 SouthSouthWest,
1128 SouthWest,
1129 WestSouthWest,
1130 West,
1131 WestNorthWest,
1132 NorthWest,
1133 NorthNorthWest,
1134 GeocentricX,
1135 GeocentricY,
1136 GeocentricZ,
1137 Up,
1138 Down,
1139 Forward,
1140 Aft,
1141 Port,
1142 Starboard,
1143 Clockwise,
1144 CounterClockwise,
1145 ColumnPositive,
1146 ColumnNegative,
1147 RowPositive,
1148 RowNegative,
1149 DisplayRight,
1150 DisplayLeft,
1151 DisplayUp,
1152 DisplayDown,
1153 Future,
1154 Past,
1155 Towards,
1156 AwayFrom,
1157 Unspecified,
1158 };
1159 Q_ENUM( CrsAxisDirection )
1160
1161
1166 enum class CoordinateOrder : int
1167 {
1168 Default,
1169 XY,
1170 YX,
1171 };
1172 Q_ENUM( CoordinateOrder )
1173
1174
1179 enum class AnnotationItemFlag : int
1180 {
1181 ScaleDependentBoundingBox = 1 << 0,
1182 };
1184 Q_DECLARE_FLAGS( AnnotationItemFlags, AnnotationItemFlag )
1185 Q_ENUM( AnnotationItemFlag )
1186 Q_FLAG( AnnotationItemFlags )
1187
1188
1193 enum class AnnotationItemGuiFlag : int
1194 {
1195 FlagNoCreationTools = 1 << 0,
1196 };
1198 Q_DECLARE_FLAGS( AnnotationItemGuiFlags, AnnotationItemGuiFlag )
1199 Q_ENUM( AnnotationItemGuiFlag )
1200 Q_FLAG( AnnotationItemGuiFlags )
1201
1202
1207 enum class AnnotationItemNodeType : int
1208 {
1209 VertexHandle,
1210 };
1211 Q_ENUM( AnnotationItemNodeType )
1212
1213
1219 {
1220 Success,
1221 Invalid,
1222 ItemCleared,
1223 };
1224 Q_ENUM( AnnotationItemEditOperationResult )
1225
1226
1232 {
1233 FixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ModeFixedTemporalRange ) = 0,
1234 FeatureDateTimeInstantFromField SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeInstantFromField ),
1235 FeatureDateTimeStartAndEndFromFields SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndEndFromFields ),
1236 FeatureDateTimeStartAndDurationFromFields SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndDurationFromFields ),
1237 FeatureDateTimeStartAndEndFromExpressions SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndEndFromExpressions ),
1238 RedrawLayerOnly SIP_MONKEYPATCH_COMPAT_NAME( ModeRedrawLayerOnly ),
1239 };
1240 Q_ENUM( VectorTemporalMode )
1241
1242
1248 {
1249 IncludeBeginExcludeEnd = 0,
1250 IncludeBeginIncludeEnd,
1251 };
1252 Q_ENUM( VectorTemporalLimitMode )
1253
1254
1260 {
1261 HasFixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ProviderHasFixedTemporalRange ) = 0,
1262 StoresFeatureDateTimeInstantInField SIP_MONKEYPATCH_COMPAT_NAME( ProviderStoresFeatureDateTimeInstantInField ),
1263 StoresFeatureDateTimeStartAndEndInSeparateFields SIP_MONKEYPATCH_COMPAT_NAME( ProviderStoresFeatureDateTimeStartAndEndInSeparateFields ),
1264 };
1265 Q_ENUM( VectorDataProviderTemporalMode )
1266
1267
1273 {
1274 FixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ModeFixedTemporalRange ) = 0,
1275 TemporalRangeFromDataProvider SIP_MONKEYPATCH_COMPAT_NAME( ModeTemporalRangeFromDataProvider ) = 1,
1276 RedrawLayerOnly SIP_MONKEYPATCH_COMPAT_NAME( ModeRedrawLayerOnly ) = 2,
1277 };
1278 Q_ENUM( RasterTemporalMode )
1279
1280
1286 {
1287 MatchUsingWholeRange,
1288 MatchExactUsingStartOfRange,
1289 MatchExactUsingEndOfRange,
1290 FindClosestMatchToStartOfRange,
1291 FindClosestMatchToEndOfRange
1292 };
1293 Q_ENUM( TemporalIntervalMatchMethod )
1294
1295
1301 {
1302 RequestedTimesMustExactlyMatchAllAvailableTemporalRanges = 1 << 0,
1303 };
1304 Q_ENUM( RasterTemporalCapabilityFlag )
1305
1306
1311 Q_DECLARE_FLAGS( RasterTemporalCapabilityFlags, RasterTemporalCapabilityFlag )
1312 Q_ENUM( RasterTemporalCapabilityFlags )
1313
1314
1320 {
1321 Forward SIP_MONKEYPATCH_COMPAT_NAME( ForwardTransform ),
1322 Reverse SIP_MONKEYPATCH_COMPAT_NAME( ReverseTransform )
1323 };
1324 Q_ENUM( TransformDirection )
1325
1326
1332 {
1333 BallparkTransformsAreAppropriate = 1 << 0,
1334 IgnoreImpossibleTransformations = 1 << 1,
1335 };
1336 Q_ENUM( CoordinateTransformationFlag )
1337
1338
1343 Q_DECLARE_FLAGS( CoordinateTransformationFlags, CoordinateTransformationFlag )
1344 Q_ENUM( CoordinateTransformationFlags )
1345
1346
1352 {
1353 Antialiasing = 0x01,
1354 DrawEditingInfo = 0x02,
1355 ForceVectorOutput = 0x04,
1356 UseAdvancedEffects = 0x08,
1357 DrawLabeling = 0x10,
1358 UseRenderingOptimization = 0x20,
1359 DrawSelection = 0x40,
1360 DrawSymbolBounds = 0x80,
1361 RenderMapTile = 0x100,
1362 RenderPartialOutput = 0x200,
1363 RenderPreviewJob = 0x400,
1364 RenderBlocking = 0x800,
1365 LosslessImageRendering = 0x1000,
1366 Render3DMap = 0x2000,
1367 HighQualityImageTransforms = 0x4000,
1368 SkipSymbolRendering = 0x8000,
1369 ForceRasterMasks = 0x10000,
1370 };
1373 Q_ENUM( MapSettingsFlag )
1374 Q_FLAG( MapSettingsFlags )
1375
1376
1382 {
1383 DrawEditingInfo = 0x01,
1384 ForceVectorOutput = 0x02,
1385 UseAdvancedEffects = 0x04,
1386 UseRenderingOptimization = 0x08,
1387 DrawSelection = 0x10,
1388 DrawSymbolBounds = 0x20,
1389 RenderMapTile = 0x40,
1390 Antialiasing = 0x80,
1391 RenderPartialOutput = 0x100,
1392 RenderPreviewJob = 0x200,
1393 RenderBlocking = 0x400,
1394 RenderSymbolPreview = 0x800,
1395 LosslessImageRendering = 0x1000,
1396 ApplyScalingWorkaroundForTextRendering = 0x2000,
1397 Render3DMap = 0x4000,
1398 ApplyClipAfterReprojection = 0x8000,
1399 RenderingSubSymbol = 0x10000,
1400 HighQualityImageTransforms = 0x20000,
1401 SkipSymbolRendering = 0x40000,
1402 };
1405 Q_ENUM( RenderContextFlag )
1406 Q_FLAG( RenderContextFlags )
1407
1408 // refs for below dox: https://github.com/qgis/QGIS/pull/1286#issuecomment-39806854
1409 // https://github.com/qgis/QGIS/pull/8573#issuecomment-445585826
1410
1411
1416 {
1417 AlwaysOutlines SIP_MONKEYPATCH_COMPAT_NAME( TextFormatAlwaysOutlines ),
1418 AlwaysText SIP_MONKEYPATCH_COMPAT_NAME( TextFormatAlwaysText ),
1419 };
1420 Q_ENUM( TextRenderFormat )
1421
1422
1430 {
1431 Horizontal SIP_MONKEYPATCH_COMPAT_NAME( HorizontalOrientation ),
1432 Vertical SIP_MONKEYPATCH_COMPAT_NAME( VerticalOrientation ),
1433 RotationBased SIP_MONKEYPATCH_COMPAT_NAME( RotationBasedOrientation ),
1434 };
1435 Q_ENUM( TextOrientation )
1436
1437
1445 {
1446 Rectangle SIP_MONKEYPATCH_COMPAT_NAME( Rect ),
1447 Point,
1448 Labeling SIP_MONKEYPATCH_COMPAT_NAME( Label ),
1449 };
1450 Q_ENUM( TextLayoutMode )
1451
1452
1460 {
1461 Text,
1462 Buffer,
1463 Background,
1464 Shadow,
1465 };
1466 Q_ENUM( TextComponent )
1467
1468
1476 {
1477 Left SIP_MONKEYPATCH_COMPAT_NAME( AlignLeft ),
1478 Center SIP_MONKEYPATCH_COMPAT_NAME( AlignCenter ),
1479 Right SIP_MONKEYPATCH_COMPAT_NAME( AlignRight ),
1480 Justify SIP_MONKEYPATCH_COMPAT_NAME( AlignJustify ),
1481 };
1482 Q_ENUM( TextHorizontalAlignment )
1483
1484
1492 {
1493 Top SIP_MONKEYPATCH_COMPAT_NAME( AlignTop ),
1494 VerticalCenter SIP_MONKEYPATCH_COMPAT_NAME( AlignVCenter ),
1495 Bottom SIP_MONKEYPATCH_COMPAT_NAME( AlignBottom ),
1496 };
1497 Q_ENUM( TextVerticalAlignment )
1498
1499
1505 {
1506 Generic,
1507 ShadowOffset,
1508 BlurSize,
1509 GlowSpread,
1510 };
1511 Q_ENUM( RenderSubcomponentProperty )
1512
1513
1518 {
1519 Segment SIP_MONKEYPATCH_COMPAT_NAME( SegmentVertex ) = 1,
1520 Curve SIP_MONKEYPATCH_COMPAT_NAME( CurveVertex ) = 2,
1521 };
1522 Q_ENUM( VertexType )
1523
1524
1532 {
1533 Square,
1534 Diamond,
1535 Pentagon,
1536 Hexagon,
1537 Triangle,
1538 EquilateralTriangle,
1539 Star,
1540 Arrow,
1541 Circle,
1542 Cross,
1543 CrossFill,
1544 Cross2,
1545 Line,
1546 ArrowHead,
1547 ArrowHeadFilled,
1548 SemiCircle,
1549 ThirdCircle,
1550 QuarterCircle,
1551 QuarterSquare,
1552 HalfSquare,
1553 DiagonalHalfSquare,
1554 RightHalfTriangle,
1555 LeftHalfTriangle,
1556 Octagon,
1557 SquareWithCorners,
1558 AsteriskFill,
1559 HalfArc,
1560 ThirdArc,
1561 QuarterArc,
1562 ParallelogramRight,
1563 ParallelogramLeft,
1564 Trapezoid,
1565 Shield,
1566 DiamondStar,
1567 Heart,
1568 Decagon,
1569 RoundedSquare,
1570 };
1571 Q_ENUM( MarkerShape )
1572
1573
1581 {
1582 Interval = 1 << 0,
1583 Vertex = 1 << 1,
1584 LastVertex = 1 << 2,
1585 FirstVertex = 1 << 3,
1586 CentralPoint = 1 << 4,
1587 CurvePoint = 1 << 5,
1588 SegmentCenter = 1 << 6,
1589 InnerVertices = 1 << 7,
1590 };
1591 Q_ENUM( MarkerLinePlacement )
1592 Q_DECLARE_FLAGS( MarkerLinePlacements, MarkerLinePlacement )
1593 Q_FLAG( MarkerLinePlacements )
1594
1595
1603 {
1604 SimpleTwoColor,
1605 ColorRamp,
1606 };
1607 Q_ENUM( GradientColorSource )
1608
1609
1617 {
1618 Linear,
1619 Radial,
1620 Conical,
1621 };
1622 Q_ENUM( GradientType )
1623
1624
1632 {
1633 Feature,
1634 Viewport,
1635 };
1636 Q_ENUM( SymbolCoordinateReference )
1637
1638
1647 {
1648 Pad,
1649 Reflect,
1650 Repeat,
1651 };
1652 Q_ENUM( GradientSpread )
1653
1654
1662 {
1663 Absolute SIP_MONKEYPATCH_COMPAT_NAME( AbsoluteCount ),
1664 DensityBased SIP_MONKEYPATCH_COMPAT_NAME( DensityBasedCount ),
1665 };
1666 Q_ENUM( PointCountMethod )
1667
1668
1673 enum class MarkerClipMode : int
1674 {
1675 NoClipping,
1676 Shape,
1677 CentroidWithin,
1678 CompletelyWithin,
1679 };
1680 Q_ENUM( MarkerClipMode )
1681
1682
1687 enum class LineClipMode : int
1688 {
1689 ClipPainterOnly,
1690 ClipToIntersection,
1691 NoClipping,
1692 };
1693 Q_ENUM( LineClipMode )
1694
1695
1701 {
1702 NoRule,
1703 FullDash,
1704 HalfDash,
1705 FullGap,
1706 HalfGap,
1707 };
1708 Q_ENUM( DashPatternLineEndingRule )
1709
1710
1716 {
1717 ScaleBothDashAndGap,
1718 ScaleDashOnly,
1719 ScaleGapOnly,
1720 };
1721 Q_ENUM( DashPatternSizeAdjustment )
1722
1723
1731 {
1732 Color SIP_MONKEYPATCH_COMPAT_NAME( GraduatedColor ),
1733 Size SIP_MONKEYPATCH_COMPAT_NAME( GraduatedSize ),
1734 };
1735 Q_ENUM( GraduatedMethod )
1736
1737
1741 enum class DpiMode
1742 {
1743 All = 7,
1744 Off = 0,
1745 QGIS = 1,
1746 UMN = 2,
1747 GeoServer = 4,
1748 };
1749 Q_ENUM( DpiMode )
1750
1751
1752 // NOTE -- the hardcoded numbers here must match QFont::Capitalization!
1753
1754
1762 {
1763 MixedCase = 0,
1764 AllUppercase = 1,
1765 AllLowercase = 2,
1766 ForceFirstLetterToCapital = 4,
1767 SmallCaps = 5,
1768 TitleCase = 1004,
1769 UpperCamelCase = 1005,
1770 AllSmallCaps = 1006,
1771 };
1772 Q_ENUM( Capitalization )
1773
1774
1779 enum class TextRendererFlag : int
1780 {
1781 WrapLines = 1 << 0,
1782 };
1783 Q_ENUM( TextRendererFlag )
1784 Q_DECLARE_FLAGS( TextRendererFlags, TextRendererFlag )
1785 Q_FLAG( TextRendererFlags )
1786
1787
1793 {
1794 MapBox,
1795 Esri,
1796 };
1798
1805 {
1806 Clockwise,
1807 CounterClockwise,
1808 };
1809 Q_ENUM( AngularDirection )
1810
1811
1816 enum class RendererUsage : int
1817 {
1818 View,
1819 Export,
1820 Unknown,
1821 };
1822 Q_ENUM( RendererUsage )
1823
1824
1829 enum class ViewSyncModeFlag : int
1830 {
1831 Sync3DTo2D = 1 << 0,
1832 Sync2DTo3D = 1 << 1,
1833 };
1834 Q_ENUM( ViewSyncModeFlag )
1835 Q_DECLARE_FLAGS( ViewSyncModeFlags, ViewSyncModeFlag )
1836
1837
1842 enum class HistoryProviderBackend : int
1843 {
1844 LocalProfile = 1 << 0,
1845// Project = 1 << 1, //!< QGIS Project (not yet implemented)
1846 };
1847 Q_ENUM( HistoryProviderBackend )
1848 Q_DECLARE_FLAGS( HistoryProviderBackends, HistoryProviderBackend )
1849 Q_FLAG( HistoryProviderBackends )
1850
1851
1857 {
1858 Wkt SIP_MONKEYPATCH_COMPAT_NAME( FormatWkt ),
1859 Proj SIP_MONKEYPATCH_COMPAT_NAME( FormatProj ),
1860 };
1861 Q_ENUM( CrsDefinitionFormat )
1862
1863
1871 enum class FieldDomainSplitPolicy : int
1872 {
1873 DefaultValue,
1874 Duplicate,
1875 GeometryRatio,
1876 };
1877 Q_ENUM( FieldDomainSplitPolicy )
1878
1879
1887 enum class FieldDomainMergePolicy : int
1888 {
1889 DefaultValue,
1890 Sum,
1891 GeometryWeighted,
1892 };
1893 Q_ENUM( FieldDomainMergePolicy )
1894
1895
1900 enum class FieldDomainType : int
1901 {
1902 Coded,
1903 Range,
1904 Glob,
1905 };
1906 Q_ENUM( FieldDomainType )
1907
1908
1913 enum class TransactionMode : int
1914 {
1915 Disabled = 0,
1916 AutomaticGroups = 1,
1917 BufferedGroups = 2,
1918 };
1919 Q_ENUM( TransactionMode )
1920
1921
1926 enum class AltitudeClamping : int
1927 {
1928 Absolute,
1929 Relative,
1930 Terrain,
1931 };
1932 Q_ENUM( AltitudeClamping )
1933
1934
1939 enum class AltitudeBinding : int
1940 {
1941 Vertex,
1942 Centroid,
1943 };
1944 Q_ENUM( AltitudeBinding )
1945
1946
1952 {
1953 NoConstraint,
1954 Perpendicular,
1955 Parallel
1956 };
1957 Q_ENUM( BetweenLineConstraint )
1958
1959
1964 enum class LineExtensionSide : int
1965 {
1966 BeforeVertex,
1967 AfterVertex,
1968 NoVertex,
1969 };
1970 Q_ENUM( LineExtensionSide )
1971
1972
1977 enum class ProjectFlag : int
1978 {
1979 EvaluateDefaultValuesOnProviderSide = 1 << 0,
1980 TrustStoredLayerStatistics = 1 << 1,
1981 RememberLayerEditStatusBetweenSessions = 1 << 2,
1982 RememberAttributeTableWindowsBetweenSessions = 1 << 3,
1983 };
1984 Q_ENUM( ProjectFlag )
1985 Q_DECLARE_FLAGS( ProjectFlags, ProjectFlag )
1986 Q_FLAG( ProjectFlags )
1987
1988
1993 enum class PlotToolFlag : int
1994 {
1995 ShowContextMenu = 1 << 0,
1996 };
1997 Q_ENUM( PlotToolFlag )
1998 Q_DECLARE_FLAGS( PlotToolFlags, PlotToolFlag )
1999 Q_FLAG( PlotToolFlags )
2000
2001
2006 enum class LightSourceType : int
2007 {
2008 Point,
2009 Directional,
2010 };
2011 Q_ENUM( LightSourceType )
2012
2013
2019 {
2020 Line,
2021 FillBelow,
2022 };
2024
2030 enum class VectorProfileType : int
2031 {
2032 IndividualFeatures,
2033 ContinuousSurface,
2034 };
2036
2042 enum class ProfileGeneratorFlag : int
2043 {
2044 RespectsMaximumErrorMapUnit = 1 << 0,
2045 RespectsDistanceRange = 1 << 1,
2046 RespectsElevationRange = 1 << 2,
2047 };
2048 Q_ENUM( ProfileGeneratorFlag )
2049 Q_DECLARE_FLAGS( ProfileGeneratorFlags, ProfileGeneratorFlag )
2050 Q_FLAG( ProfileGeneratorFlags )
2051
2052
2058 {
2059 Square,
2060 Circle,
2061 };
2062 Q_ENUM( PointCloudSymbol )
2063
2064
2070 {
2071 Default,
2072 BottomToTop,
2073 TopToBottom,
2074 };
2075 Q_ENUM( PointCloudDrawOrder )
2076
2077
2085 {
2086 AllowIntersections,
2087 AvoidIntersectionsCurrentLayer,
2088 AvoidIntersectionsLayers,
2089 };
2090 Q_ENUM( AvoidIntersectionsMode )
2091
2092
2100 {
2101 Qgz,
2102 Qgs,
2103 };
2104 Q_ENUM( ProjectFileFormat )
2105
2106
2114 {
2115 DontResolveLayers SIP_MONKEYPATCH_COMPAT_NAME( FlagDontResolveLayers ) = 1 << 0,
2116 DontLoadLayouts SIP_MONKEYPATCH_COMPAT_NAME( FlagDontLoadLayouts ) = 1 << 1,
2117 TrustLayerMetadata SIP_MONKEYPATCH_COMPAT_NAME( FlagTrustLayerMetadata ) = 1 << 2,
2118 DontStoreOriginalStyles SIP_MONKEYPATCH_COMPAT_NAME( FlagDontStoreOriginalStyles ) = 1 << 3,
2119 DontLoad3DViews SIP_MONKEYPATCH_COMPAT_NAME( FlagDontLoad3DViews ) = 1 << 4,
2120 DontLoadProjectStyles = 1 << 5,
2121 ForceReadOnlyLayers = 1 << 6,
2122 };
2123 Q_ENUM( ProjectReadFlag )
2124
2125
2132 Q_DECLARE_FLAGS( ProjectReadFlags, ProjectReadFlag ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsProject, ReadFlags )
2133 Q_FLAG( ProjectReadFlags )
2134
2143 enum class ProjectCapability : int
2144 {
2145 ProjectStyles = 1 << 0,
2146 };
2147 Q_ENUM( ProjectCapability )
2148
2149
2154 Q_DECLARE_FLAGS( ProjectCapabilities, ProjectCapability )
2155 Q_FLAG( ProjectCapabilities )
2156
2157
2163 {
2164 Vector,
2165 Raster,
2166 RasterDem,
2167 GeoJson,
2168 Image,
2169 Video,
2170 Unknown,
2171 };
2172 Q_ENUM( MapBoxGlStyleSourceType )
2173
2174
2182 {
2183 FeatureServer SIP_MONKEYPATCH_COMPAT_NAME( FeatureService ),
2184 MapServer SIP_MONKEYPATCH_COMPAT_NAME( MapService ),
2185 ImageServer SIP_MONKEYPATCH_COMPAT_NAME( ImageService ),
2186 GlobeServer,
2187 GPServer,
2188 GeocodeServer,
2189 Unknown,
2190 };
2191 Q_ENUM( ArcGisRestServiceType )
2192
2193
2201 {
2202 Normal,
2203 Generated,
2204 };
2205 Q_ENUM( RelationshipType )
2206
2207
2215 {
2216 Association,
2217 Composition,
2218 };
2219 Q_ENUM( RelationshipStrength )
2220
2221
2227 {
2228 OneToOne,
2229 OneToMany,
2230 ManyToOne,
2231 ManyToMany,
2232 };
2233 Q_ENUM( RelationshipCardinality )
2234
2235
2240 enum class CoordinateDisplayType : int
2241 {
2242 MapCrs,
2243 MapGeographic,
2244 CustomCrs,
2245 };
2246 Q_ENUM( CoordinateDisplayType )
2247
2248
2252 static const double DEFAULT_SEARCH_RADIUS_MM;
2253
2255 static const float DEFAULT_MAPTOPIXEL_THRESHOLD;
2256
2263 static const QColor DEFAULT_HIGHLIGHT_COLOR;
2264
2269 static const double DEFAULT_HIGHLIGHT_BUFFER_MM;
2270
2275 static const double DEFAULT_HIGHLIGHT_MIN_WIDTH_MM;
2276
2283 static const double SCALE_PRECISION;
2284
2290 static const double DEFAULT_Z_COORDINATE;
2291
2297 static const double DEFAULT_M_COORDINATE;
2298
2304 static const double UI_SCALE_FACTOR;
2305
2310 static const double DEFAULT_SNAP_TOLERANCE;
2311
2316 static const QgsTolerance::UnitType DEFAULT_SNAP_UNITS;
2317
2323 static QString defaultProjectScales();
2324
2330 static int geosVersionInt();
2331
2337 static int geosVersionMajor();
2338
2344 static int geosVersionMinor();
2345
2351 static int geosVersionPatch();
2352
2358 static QString geosVersion();
2359};
2360
2362
2363Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolRenderHints )
2364Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolFlags )
2365Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolPreviewFlags )
2366Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolLayerFlags )
2367Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BrowserItemCapabilities )
2368Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SublayerQueryFlags )
2369Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SublayerFlags )
2370Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SqlLayerDefinitionCapabilities )
2371Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BabelFormatCapabilities )
2372Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BabelCommandFlags )
2373Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::GeometryValidityFlags )
2374Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::FileOperationFlags )
2375Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::AnnotationItemFlags )
2376Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::AnnotationItemGuiFlags )
2377Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MapSettingsFlags )
2378Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::RenderContextFlags )
2379Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::VectorLayerTypeFlags )
2380Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MarkerLinePlacements )
2381Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::TextRendererFlags )
2382Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::HistoryProviderBackends )
2383Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MapLayerProperties )
2384Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::DataProviderFlags )
2385Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SnappingTypes )
2386Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::PlotToolFlags )
2387Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::ProfileGeneratorFlags )
2388Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::ProjectReadFlags )
2389Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::ProjectCapabilities )
2390Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::CoordinateTransformationFlags )
2391Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::RasterTemporalCapabilityFlags )
2392Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SelectionFlags )
2393Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::RasterRendererFlags )
2394
2395// hack to workaround warnings when casting void pointers
2396// retrieved from QLibrary::resolve to function pointers.
2397// It's assumed that this works on all systems supporting
2398// QLibrary
2399#define cast_to_fptr(f) f
2400
2401
2410// based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
2411template<class Object> class QgsSignalBlocker SIP_SKIP SIP_SKIP // clazy:exclude=rule-of-three
2412{
2413 public:
2414
2419 explicit QgsSignalBlocker( Object * object )
2420 : mObject( object )
2421 , mPreviousState( object->blockSignals( true ) )
2422 {}
2423
2425 {
2426 mObject->blockSignals( mPreviousState );
2427 }
2428
2430 Object *operator->() { return mObject; }
2431
2432 private:
2433
2434 Object *mObject = nullptr;
2435 bool mPreviousState;
2436
2437};
2438
2452// based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
2453template<class Object> inline QgsSignalBlocker<Object> whileBlocking( Object *object ) SIP_SKIP SIP_SKIP
2454{
2455 return QgsSignalBlocker<Object>( object );
2456}
2457
2459CORE_EXPORT uint qHash( const QVariant &variant );
2460
2466inline QString qgsDoubleToString( double a, int precision = 17 )
2467{
2468 QString str;
2469 if ( precision )
2470 {
2471 if ( precision < 0 )
2472 {
2473 const double roundFactor = std::pow( 10, -precision );
2474 str = QString::number( static_cast< long long >( std::round( a / roundFactor ) * roundFactor ) );
2475 }
2476 else
2477 {
2478 str = QString::number( a, 'f', precision );
2479 if ( str.contains( QLatin1Char( '.' ) ) )
2480 {
2481 // remove ending 0s
2482 int idx = str.length() - 1;
2483 while ( str.at( idx ) == '0' && idx > 1 )
2484 {
2485 idx--;
2486 }
2487 if ( idx < str.length() - 1 )
2488 str.truncate( str.at( idx ) == '.' ? idx : idx + 1 );
2489 }
2490 }
2491 }
2492 else
2493 {
2494 str = QString::number( a, 'f', precision );
2495 }
2496 // avoid printing -0
2497 // see https://bugreports.qt.io/browse/QTBUG-71439
2498 if ( str == QLatin1String( "-0" ) )
2499 {
2500 return QLatin1String( "0" );
2501 }
2502 return str;
2503}
2504
2511inline bool qgsNanCompatibleEquals( double a, double b )
2512{
2513 const bool aIsNan = std::isnan( a );
2514 const bool bIsNan = std::isnan( b );
2515 if ( aIsNan || bIsNan )
2516 return aIsNan && bIsNan;
2517
2518 return a == b;
2519}
2520
2527inline bool qgsDoubleNear( double a, double b, double epsilon = 4 * std::numeric_limits<double>::epsilon() )
2528{
2529 const bool aIsNan = std::isnan( a );
2530 const bool bIsNan = std::isnan( b );
2531 if ( aIsNan || bIsNan )
2532 return aIsNan && bIsNan;
2533
2534 const double diff = a - b;
2535 return diff > -epsilon && diff <= epsilon;
2536}
2537
2544inline bool qgsFloatNear( float a, float b, float epsilon = 4 * FLT_EPSILON )
2545{
2546 const bool aIsNan = std::isnan( a );
2547 const bool bIsNan = std::isnan( b );
2548 if ( aIsNan || bIsNan )
2549 return aIsNan && bIsNan;
2550
2551 const float diff = a - b;
2552 return diff > -epsilon && diff <= epsilon;
2553}
2554
2556inline bool qgsDoubleNearSig( double a, double b, int significantDigits = 10 )
2557{
2558 const bool aIsNan = std::isnan( a );
2559 const bool bIsNan = std::isnan( b );
2560 if ( aIsNan || bIsNan )
2561 return aIsNan && bIsNan;
2562
2563 // The most simple would be to print numbers as %.xe and compare as strings
2564 // but that is probably too costly
2565 // Then the fastest would be to set some bits directly, but little/big endian
2566 // has to be considered (maybe TODO)
2567 // Is there a better way?
2568 int aexp, bexp;
2569 const double ar = std::frexp( a, &aexp );
2570 const double br = std::frexp( b, &bexp );
2571
2572 return aexp == bexp &&
2573 std::round( ar * std::pow( 10.0, significantDigits ) ) == std::round( br * std::pow( 10.0, significantDigits ) );
2574}
2575
2581inline double qgsRound( double number, int places )
2582{
2583 const double m = ( number < 0.0 ) ? -1.0 : 1.0;
2584 const double scaleFactor = std::pow( 10.0, places );
2585 return ( std::round( number * m * scaleFactor ) / scaleFactor ) * m;
2586}
2587
2588
2589#ifndef SIP_RUN
2590
2592
2602namespace qgis
2603{
2604
2617 template<typename To, typename From> inline To down_cast( From *f )
2618 {
2619 static_assert(
2620 ( std::is_base_of<From,
2621 typename std::remove_pointer<To>::type>::value ),
2622 "target type not derived from source type" );
2623 Q_ASSERT( f == nullptr || dynamic_cast<To>( f ) != nullptr );
2624 return static_cast<To>( f );
2625 }
2626
2627 template<class T>
2628 QSet<T> listToSet( const QList<T> &list )
2629 {
2630 return QSet<T>( list.begin(), list.end() );
2631 }
2632
2633 template<class T>
2634 QList<T> setToList( const QSet<T> &set )
2635 {
2636 return QList<T>( set.begin(), set.end() );
2637 }
2638}
2639
2641#endif
2642
2647template<class T> const QList<T> qgsEnumList() SIP_SKIP
2648{
2649 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2650 Q_ASSERT( metaEnum.isValid() );
2651 QList<T> enumList;
2652 for ( int idx = 0; idx < metaEnum.keyCount(); ++idx )
2653 {
2654 enumList.append( static_cast<T>( metaEnum.value( idx ) ) );
2655 }
2656 return enumList;
2657}
2658
2664template<class T> const QMap<T, QString> qgsEnumMap() SIP_SKIP
2665{
2666 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2667 Q_ASSERT( metaEnum.isValid() );
2668 QMap<T, QString> enumMap;
2669 for ( int idx = 0; idx < metaEnum.keyCount(); ++idx )
2670 {
2671 enumMap.insert( static_cast<T>( metaEnum.value( idx ) ), QString( metaEnum.key( idx ) ) );
2672 }
2673 return enumMap;
2674}
2675
2681template<class T> QString qgsEnumValueToKey( const T &value, bool *returnOk = nullptr ) SIP_SKIP
2682{
2683 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2684 Q_ASSERT( metaEnum.isValid() );
2685 const char *key = metaEnum.valueToKey( static_cast<int>( value ) );
2686 if ( returnOk )
2687 {
2688 *returnOk = key ? true : false;
2689 }
2690 return QString::fromUtf8( key );
2691}
2692
2700template<class T> T qgsEnumKeyToValue( const QString &key, const T &defaultValue, bool tryValueAsKey = true, bool *returnOk = nullptr ) SIP_SKIP
2701{
2702 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2703 Q_ASSERT( metaEnum.isValid() );
2704 bool ok = false;
2705 T v = static_cast<T>( metaEnum.keyToValue( key.toUtf8().data(), &ok ) );
2706 if ( returnOk )
2707 {
2708 *returnOk = ok;
2709 }
2710 if ( ok )
2711 {
2712 return v;
2713 }
2714 else
2715 {
2716 // if conversion has failed, try with conversion from int value
2717 if ( tryValueAsKey )
2718 {
2719 bool canConvert = false;
2720 const int intValue = key.toInt( &canConvert );
2721 if ( canConvert && metaEnum.valueToKey( intValue ) )
2722 {
2723 if ( returnOk )
2724 {
2725 *returnOk = true;
2726 }
2727 return static_cast<T>( intValue );
2728 }
2729 }
2730 }
2731 return defaultValue;
2732}
2733
2739template<class T> QString qgsFlagValueToKeys( const T &value, bool *returnOk = nullptr ) SIP_SKIP
2740{
2741 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2742 Q_ASSERT( metaEnum.isValid() );
2743 int intValue = static_cast<int>( value );
2744 const QByteArray ba = metaEnum.valueToKeys( intValue );
2745 // check that the int value does correspond to a flag
2746 // see https://stackoverflow.com/a/68495949/1548052
2747 const int intValueCheck = metaEnum.keysToValue( ba );
2748 bool ok = intValue == intValueCheck;
2749 if ( returnOk )
2750 *returnOk = ok;
2751 return ok ? QString::fromUtf8( ba ) : QString();
2752}
2753
2761template<class T> T qgsFlagKeysToValue( const QString &keys, const T &defaultValue, bool tryValueAsKey = true, bool *returnOk = nullptr ) SIP_SKIP
2762{
2763 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2764 Q_ASSERT( metaEnum.isValid() );
2765 bool ok = false;
2766 T v = static_cast<T>( metaEnum.keysToValue( keys.toUtf8().constData(), &ok ) );
2767 if ( returnOk )
2768 {
2769 *returnOk = ok;
2770 }
2771 if ( ok )
2772 {
2773 return v;
2774 }
2775 else
2776 {
2777 // if conversion has failed, try with conversion from int value
2778 if ( tryValueAsKey )
2779 {
2780 bool canConvert = false;
2781 const int intValue = keys.toInt( &canConvert );
2782 if ( canConvert )
2783 {
2784 const QByteArray keys = metaEnum.valueToKeys( intValue );
2785 const int intValueCheck = metaEnum.keysToValue( keys );
2786 if ( intValue == intValueCheck )
2787 {
2788 if ( returnOk )
2789 {
2790 *returnOk = true;
2791 }
2792 return T( intValue );
2793 }
2794 }
2795 }
2796 }
2797 return defaultValue;
2798}
2799
2800
2810CORE_EXPORT double qgsPermissiveToDouble( QString string, bool &ok );
2811
2821CORE_EXPORT int qgsPermissiveToInt( QString string, bool &ok );
2822
2832CORE_EXPORT qlonglong qgsPermissiveToLongLong( QString string, bool &ok );
2833
2843CORE_EXPORT bool qgsVariantLessThan( const QVariant &lhs, const QVariant &rhs );
2844
2853CORE_EXPORT bool qgsVariantEqual( const QVariant &lhs, const QVariant &rhs );
2854
2861CORE_EXPORT bool qgsVariantGreaterThan( const QVariant &lhs, const QVariant &rhs );
2862
2863#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
2864
2871inline bool operator> ( const QVariant &v1, const QVariant &v2 )
2872{
2873 return qgsVariantGreaterThan( v1, v2 );
2874}
2875
2885inline bool operator< ( const QVariant &v1, const QVariant &v2 )
2886{
2887 return qgsVariantLessThan( v1, v2 );
2888}
2889#endif
2890
2891
2892#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
2893
2897template<> CORE_EXPORT bool qMapLessThanKey<QVariantList>( const QVariantList &key1, const QVariantList &key2 ) SIP_SKIP;
2898#endif
2899
2900CORE_EXPORT QString qgsVsiPrefix( const QString &path );
2901
2907void CORE_EXPORT *qgsMalloc( size_t size ) SIP_SKIP;
2908
2913void CORE_EXPORT qgsFree( void *ptr ) SIP_SKIP;
2914
2915#ifndef SIP_RUN
2916
2917#ifdef _MSC_VER
2918#define CONSTLATIN1STRING inline const QLatin1String
2919#else
2920#define CONSTLATIN1STRING constexpr QLatin1String
2921#endif
2922
2924class ScopedIntIncrementor
2925{
2926 public:
2927
2928 ScopedIntIncrementor( int *variable )
2929 : mVariable( variable )
2930 {
2931 ( *mVariable )++;
2932 }
2933
2934 ScopedIntIncrementor( const ScopedIntIncrementor &other ) = delete;
2935 ScopedIntIncrementor &operator=( const ScopedIntIncrementor &other ) = delete;
2936
2937 void release()
2938 {
2939 if ( mVariable )
2940 ( *mVariable )--;
2941
2942 mVariable = nullptr;
2943 }
2944
2945 ~ScopedIntIncrementor()
2946 {
2947 release();
2948 }
2949
2950 private:
2951 int *mVariable = nullptr;
2952};
2954
2960{
2961 return QLatin1String(
2962 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]] )"""
2963 );
2964}
2965
2968{
2969 return QLatin1String( "+proj=longlat +datum=WGS84 +no_defs" );
2970}
2971
2974{
2975 return QLatin1String( "EPSG:4326" );
2976}
2977
2980{
2981 return QLatin1String( "NONE" );
2982}
2983
2985
2987const int PREVIEW_JOB_DELAY_MS = 250;
2988
2990const int MAXIMUM_LAYER_PREVIEW_TIME_MS = 250;
2991
2993
2994#endif
2995
2997const long GEOSRID = 4326;
2998
3000const long GEOCRS_ID = 3452;
3001
3003const long GEO_EPSG_CRS_ID = 4326;
3004
3009const int USER_CRS_START_ID = 100000;
3010
3011//
3012// Constants for point symbols
3013//
3014
3016const double DEFAULT_POINT_SIZE = 2.0;
3017const double DEFAULT_LINE_WIDTH = 0.26;
3018
3020const double DEFAULT_SEGMENT_EPSILON = 1e-8;
3021
3022typedef QMap<QString, QString> QgsStringMap SIP_SKIP;
3023
3032typedef unsigned long long qgssize;
3033
3034#ifndef SIP_RUN
3035#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
3036
3037#define Q_NOWARN_DEPRECATED_PUSH \
3038 _Pragma("GCC diagnostic push") \
3039 _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
3040#define Q_NOWARN_DEPRECATED_POP \
3041 _Pragma("GCC diagnostic pop");
3042#define Q_NOWARN_UNREACHABLE_PUSH
3043#define Q_NOWARN_UNREACHABLE_POP
3044
3045#elif defined(_MSC_VER)
3046
3047#define Q_NOWARN_DEPRECATED_PUSH \
3048 __pragma(warning(push)) \
3049 __pragma(warning(disable:4996))
3050#define Q_NOWARN_DEPRECATED_POP \
3051 __pragma(warning(pop))
3052#define Q_NOWARN_UNREACHABLE_PUSH \
3053 __pragma(warning(push)) \
3054 __pragma(warning(disable:4702))
3055#define Q_NOWARN_UNREACHABLE_POP \
3056 __pragma(warning(pop))
3057
3058#else
3059
3060#define Q_NOWARN_DEPRECATED_PUSH
3061#define Q_NOWARN_DEPRECATED_POP
3062#define Q_NOWARN_UNREACHABLE_PUSH
3063#define Q_NOWARN_UNREACHABLE_POP
3064
3065#endif
3066#endif
3067
3068#ifndef QGISEXTERN
3069#ifdef Q_OS_WIN
3070# define QGISEXTERN extern "C" __declspec( dllexport )
3071#else
3072# if defined(__GNUC__) || defined(__clang__)
3073# define QGISEXTERN extern "C" __attribute__ ((visibility ("default")))
3074# else
3075# define QGISEXTERN extern "C"
3076# endif
3077#endif
3078#endif
3079#endif
3080
3081#if __cplusplus >= 201500
3082#define FALLTHROUGH [[fallthrough]];
3083#elif defined(__clang__)
3084#define FALLTHROUGH [[clang::fallthrough]];
3085#elif defined(__GNUC__) && __GNUC__ >= 7
3086#define FALLTHROUGH [[gnu::fallthrough]];
3087#else
3088#define FALLTHROUGH
3089#endif
3090
3091// see https://infektor.net/posts/2017-01-19-using-cpp17-attributes-today.html#using-the-nodiscard-attribute
3092#if __cplusplus >= 201703L
3093#define NODISCARD [[nodiscard]]
3094#elif defined(__clang__)
3095#define NODISCARD [[nodiscard]]
3096#elif defined(_MSC_VER)
3097#define NODISCARD // no support
3098#elif defined(__has_cpp_attribute)
3099#if __has_cpp_attribute(nodiscard)
3100#define NODISCARD [[nodiscard]]
3101#elif __has_cpp_attribute(gnu::warn_unused_result)
3102#define NODISCARD [[gnu::warn_unused_result]]
3103#else
3104#define NODISCARD Q_REQUIRED_RESULT
3105#endif
3106#else
3107#define NODISCARD Q_REQUIRED_RESULT
3108#endif
3109
3110#if __cplusplus >= 201703L
3111#define MAYBE_UNUSED [[maybe_unused]]
3112#elif defined(__clang__)
3113#define MAYBE_UNUSED [[maybe_unused]]
3114#elif defined(_MSC_VER)
3115#define MAYBE_UNUSED // no support
3116#elif defined(__has_cpp_attribute)
3117#if __has_cpp_attribute(gnu::unused)
3118#define MAYBE_UNUSED [[gnu::unused]]
3119#else
3120#define MAYBE_UNUSED
3121#endif
3122#else
3123#define MAYBE_UNUSED
3124#endif
3125
3126#ifndef FINAL
3127#define FINAL final
3128#endif
3129
3130#ifndef SIP_RUN
3131#ifdef _MSC_VER
3132#define BUILTIN_UNREACHABLE \
3133 __assume(false);
3134#elif defined(__GNUC__) && !defined(__clang__)
3135// Workaround a GCC bug where a -Wreturn-type warning is emitted in constructs
3136// like:
3137// switch( mVariableThatCanOnlyBeXorY )
3138// {
3139// case X:
3140// return "foo";
3141// case Y:
3142// return "foo";
3143// }
3144// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
3145#define BUILTIN_UNREACHABLE \
3146 __builtin_unreachable();
3147#else
3148#define BUILTIN_UNREACHABLE
3149#endif
3150#endif // SIP_RUN
3151
3152#ifdef SIP_RUN
3153
3158QString CORE_EXPORT geoWkt();
3159
3161QString CORE_EXPORT geoProj4();
3162
3164QString CORE_EXPORT geoEpsgCrsAuthId();
3165
3167QString CORE_EXPORT geoNone();
3168
3169#endif
The Qgis class provides global constants for use throughout the application.
Definition: qgis.h:72
SettingsOption
Settings options.
Definition: qgis.h:248
ProfileGeneratorFlag
Flags that control the way the QgsAbstractProfileGenerator operate.
Definition: qgis.h:2043
GpsQualityIndicator
GPS signal quality indicator.
Definition: qgis.h:887
ProjectReadFlag
Flags which control project read behavior.
Definition: qgis.h:2114
PointCloudSymbol
Rendering symbols for point cloud points.
Definition: qgis.h:2058
GeometryValidityFlag
Geometry validity check flags.
Definition: qgis.h:983
MapLayerProperty
File operation flags.
Definition: qgis.h:1086
BufferSide
Side of line to buffer.
Definition: qgis.h:1008
RasterResamplingStage
Stage at which raster resampling occurs.
Definition: qgis.h:721
AltitudeClamping
Altitude clamping.
Definition: qgis.h:1927
VectorTemporalMode
Vector layer temporal feature modes.
Definition: qgis.h:1232
SublayerFlag
Sublayer query flags.
Definition: qgis.h:690
CoordinateDisplayType
Formats for displaying coordinates.
Definition: qgis.h:2241
DashPatternSizeAdjustment
Dash pattern size adjustment options.
Definition: qgis.h:1716
AnnotationItemNodeType
Annotation item GUI flags.
Definition: qgis.h:1208
static const char * QGIS_DEV_VERSION
The development version.
Definition: qgis.h:98
AngularDirection
Angular directions.
Definition: qgis.h:1805
DriveType
Drive types.
Definition: qgis.h:506
ContentStatus
Status for fetched or stored content.
Definition: qgis.h:872
SnappingType
SnappingTypeFlag defines on what object the snapping is performed.
Definition: qgis.h:273
RelationshipStrength
Relationship strength.
Definition: qgis.h:2215
MarkerLinePlacement
Defines how/where the symbols should be placed on a line.
Definition: qgis.h:1581
GeometryOperationResult
Success or failure of a geometry operation.
Definition: qgis.h:955
BrowserItemState
Browser item states.
Definition: qgis.h:368
MarkerClipMode
Marker clipping modes.
Definition: qgis.h:1674
AnnotationItemFlag
Flags for annotation items.
Definition: qgis.h:1180
RenderSubcomponentProperty
Rendering subcomponent properties.
Definition: qgis.h:1505
SymbolRenderHint
Flags controlling behavior of symbols during rendering.
Definition: qgis.h:293
CaptureTechnique
Capture technique.
Definition: qgis.h:153
BrowserItemCapability
Browser item capabilities.
Definition: qgis.h:381
LineClipMode
Line clipping modes.
Definition: qgis.h:1688
BrowserDirectoryMonitoring
Browser directory item monitoring switches.
Definition: qgis.h:426
LabelOffsetType
Behavior modifier for label offset and distance, only applies in some label placement modes.
Definition: qgis.h:608
GradientColorSource
Gradient color sources.
Definition: qgis.h:1603
LabelPlacement
Placement modes which determine how label candidates are generated for a feature.
Definition: qgis.h:561
VectorExportResult
Vector layer export result codes.
Definition: qgis.h:450
RasterTemporalCapabilityFlag
Flags for raster layer temporal capabilities.
Definition: qgis.h:1301
SymbolLayerFlag
Flags controlling behavior of symbol layers.
Definition: qgis.h:335
GradientSpread
Gradient spread options, which control how gradients are rendered outside of their start and end poin...
Definition: qgis.h:1647
ScaleMethod
Scale methods.
Definition: qgis.h:220
FilePathType
File path types.
Definition: qgis.h:772
PointCountMethod
Methods which define the number of points randomly filling a polygon.
Definition: qgis.h:1662
VertexType
Types of vertex.
Definition: qgis.h:1518
DataProviderFlag
Map layer properties.
Definition: qgis.h:1101
GeometryValidationEngine
Available engines for validating geometries.
Definition: qgis.h:996
TransactionMode
Transaction mode.
Definition: qgis.h:1914
Q_ENUM(ScaleToTileZoomLevelMethod)
ViewSyncModeFlag
Synchronization of 2D map canvas and 3D view.
Definition: qgis.h:1830
FileOperationFlag
File operation flags.
Definition: qgis.h:1071
ProjectCapability
Flags which control project capabilities.
Definition: qgis.h:2144
Q_ENUM(VectorProfileType)
FieldDomainMergePolicy
Merge policy for field domains.
Definition: qgis.h:1888
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition: qgis.h:115
SqlKeywordCategory
SQL layer definition capabilities.
Definition: qgis.h:488
GraduatedMethod
Methods for modifying symbols by range in a graduated symbol renderer.
Definition: qgis.h:1731
TextLayoutMode
Text layout modes.
Definition: qgis.h:1445
RasterRendererFlag
Flags which control behavior of raster renderers.
Definition: qgis.h:735
MeshEditingErrorType
Flags which control behavior of raster renderers.
Definition: qgis.h:755
FieldDomainSplitPolicy
Split policy for field domains.
Definition: qgis.h:1872
ArcGisRestServiceType
Available ArcGIS REST service types.
Definition: qgis.h:2182
AnnotationItemEditOperationResult
Results from an edit operation on an annotation item.
Definition: qgis.h:1219
ActionStart
Enum to determine when an operation would begin.
Definition: qgis.h:522
AvoidIntersectionsMode
Flags which control how intersections of pre-existing feature are handled when digitizing new feature...
Definition: qgis.h:2085
MarkerShape
Marker shapes.
Definition: qgis.h:1532
Capitalization
String capitalization options.
Definition: qgis.h:1762
TemporalIntervalMatchMethod
Method to use when resolving a temporal range to a data provider layer or band.
Definition: qgis.h:1286
LabelQuadrantPosition
Label quadrant positions.
Definition: qgis.h:622
ScaleToTileZoomLevelMethod
Available methods for converting map scales to tile zoom levels.
Definition: qgis.h:1793
SublayerQueryFlag
Flags which control how data providers will scan for sublayers in a dataset.
Definition: qgis.h:673
TextOrientation
Text orientations.
Definition: qgis.h:1430
PythonMacroMode
Vector layer type flags.
Definition: qgis.h:180
UnplacedLabelVisibility
Unplaced label visibility.
Definition: qgis.h:534
CrsDefinitionFormat
CRS definition formats.
Definition: qgis.h:1857
SpatialFilterType
Feature request spatial filter types.
Definition: qgis.h:1058
ProjectFlag
Flags which control the behavior of QgsProjects.
Definition: qgis.h:1978
BrowserItemType
Symbol layer flags.
Definition: qgis.h:349
SettingsType
Types of settings entries.
Definition: qgis.h:231
RasterTemporalMode
Raster layer temporal modes.
Definition: qgis.h:1273
RelationshipType
Relationship types.
Definition: qgis.h:2201
JoinStyle
Join styles for buffers.
Definition: qgis.h:1033
PointCloudDrawOrder
Pointcloud rendering order for 2d views.
Definition: qgis.h:2070
DpiMode
DpiMode enum.
Definition: qgis.h:1742
BrowserLayerType
Browser item layer types.
Definition: qgis.h:403
AltitudeBinding
Altitude binding.
Definition: qgis.h:1940
LabelMultiLineAlignment
Text alignment for multi-line labels.
Definition: qgis.h:658
VectorDataProviderTemporalMode
Vector data provider temporal handling modes.
Definition: qgis.h:1260
TextRenderFormat
Options for rendering text.
Definition: qgis.h:1416
DataType
Raster data types.
Definition: qgis.h:129
Q_ENUM(ProfileSurfaceSymbology)
Q_DECLARE_FLAGS(RenderContextFlags, RenderContextFlag) SIP_MONKEYPATCH_FLAGS_UNNEST(QgsRenderContext
Render context flags.
PlotToolFlag
Flags that control the way the QgsPlotTools operate.
Definition: qgis.h:1994
CoordinateOrder
Order of coordinates.
Definition: qgis.h:1167
SelectionFlag
Flags which control feature selection behavior.
Definition: qgis.h:824
EndCapStyle
End cap styles for buffers.
Definition: qgis.h:1020
BabelCommandFlag
Babel GPS format capabilities.
Definition: qgis.h:926
FieldDomainType
Types of field domain.
Definition: qgis.h:1901
RenderContextFlag
Flags which affect rendering operations.
Definition: qgis.h:1382
RasterPipeInterfaceRole
Sublayer flags.
Definition: qgis.h:704
SymbolPreviewFlag
Symbol flags.
Definition: qgis.h:321
AnnotationItemGuiFlag
Annotation item flags.
Definition: qgis.h:1194
MapBoxGlStyleSourceType
Flags which control project capabilities.
Definition: qgis.h:2163
DashPatternLineEndingRule
Dash pattern line ending rules.
Definition: qgis.h:1701
VertexMarkerType
Editing vertex markers, used for showing vertices during a edit operation.
Definition: qgis.h:860
HistoryProviderBackend
History provider backends.
Definition: qgis.h:1843
SublayerPromptMode
Specifies how to handle layer sources with multiple sublayers.
Definition: qgis.h:784
TextVerticalAlignment
Text vertical alignment.
Definition: qgis.h:1492
RelationshipCardinality
Relationship cardinality.
Definition: qgis.h:2227
GradientType
Gradient types.
Definition: qgis.h:1617
VectorProfileType
Types of elevation profiles to generate for vector sources.
Definition: qgis.h:2031
GpsFeatureType
Babel command flags.
Definition: qgis.h:940
VectorLayerTypeFlag
Vector layer type flags.
Definition: qgis.h:167
MakeValidMethod
Algorithms to use when repairing invalid geometries.
Definition: qgis.h:1046
VectorTemporalLimitMode
Mode for the handling of the limits of the filtering timeframe for vector features.
Definition: qgis.h:1248
SqlLayerDefinitionCapability
SqlLayerDefinitionCapability enum lists the arguments supported by the provider when creating SQL que...
Definition: qgis.h:471
VectorEditResult
Flags which control feature selection behavior.
Definition: qgis.h:845
Q_DECLARE_FLAGS(GeometryValidityFlags, GeometryValidityFlag) SIP_MONKEYPATCH_FLAGS_UNNEST(QgsGeometry
Geometry validity flags.
ProjectFileFormat
Flags which control project read behavior.
Definition: qgis.h:2100
SnappingMode
SnappingMode defines on which layer the snapping is performed.
Definition: qgis.h:261
SymbolType
Symbol types.
Definition: qgis.h:206
ProfileSurfaceSymbology
Surface symbology type for elevation profile plots.
Definition: qgis.h:2019
RendererUsage
Usage of the renderer.
Definition: qgis.h:1817
BabelFormatCapability
Babel GPS format capabilities.
Definition: qgis.h:907
BetweenLineConstraint
Between line constraints which can be enabled.
Definition: qgis.h:1952
TextHorizontalAlignment
Text horizontal alignment.
Definition: qgis.h:1476
SymbolFlag
Flags controlling behavior of symbols.
Definition: qgis.h:307
LineExtensionSide
Designates whether the line extension constraint is currently soft locked with the previous or next v...
Definition: qgis.h:1965
HttpMethod
Different methods of HTTP requests.
Definition: qgis.h:438
SymbolCoordinateReference
Symbol coordinate reference modes.
Definition: qgis.h:1632
TextRendererFlag
Flags which control the behavior of rendering text.
Definition: qgis.h:1780
SelectGeometryRelationship
Geometry relationship test to apply for selecting features.
Definition: qgis.h:812
CrsAxisDirection
Data provider flags.
Definition: qgis.h:1117
LabelOverlapHandling
Label overlap handling.
Definition: qgis.h:546
CoordinateTransformationFlag
Flags which adjust the coordinate transformations behave.
Definition: qgis.h:1332
TextComponent
Text components.
Definition: qgis.h:1460
TransformDirection
Flags for raster layer temporal capabilities.
Definition: qgis.h:1320
LightSourceType
Light source types for 3D scenes.
Definition: qgis.h:2007
LabelPredefinedPointPosition
Positions for labels when using the Qgis::LabelPlacement::OrderedPositionsAroundPoint placement mode.
Definition: qgis.h:583
UpsideDownLabelHandling
Handling techniques for upside down labels.
Definition: qgis.h:643
Q_DECLARE_FLAGS(MapSettingsFlags, MapSettingsFlag) SIP_MONKEYPATCH_FLAGS_UNNEST(QgsMapSettings
Map settings flags.
MapSettingsFlag
Coordinate transformation flags.
Definition: qgis.h:1352
SelectBehavior
Specifies how a selection should be applied.
Definition: qgis.h:798
Utility functions for working with ArcGIS REST services.
This class represents a coordinate reference system (CRS).
Class for doing transforms between two map coordinate systems.
Abstract base class for curved geometry type.
Definition: qgscurve.h:36
Base class for all items in the model.
Definition: qgsdataitem.h:46
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:164
Item that represents a layer that can be opened with one of the providers.
Definition: qgslayeritem.h:31
Base class for all map layer types.
Definition: qgsmaplayer.h:73
The QgsMapSettings class contains configuration for rendering of the map.
Registry for temporary fetched files.
Contains settings for how a map layer will be labeled.
Abstract base class for 2d point cloud renderers.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition: qgsproject.h:104
A fill symbol layer which places markers at random locations within polygons.
Implementation of data provider temporal properties for QgsRasterDataProviders.
Implementation of map layer temporal properties for raster layers.
Contains a pipeline of raster interfaces for sequential raster processing.
Definition: qgsrasterpipe.h:50
Contains information about the context of a rendering operation.
Represent settings entry and provides methods for reading and writing settings values.
RAII signal blocking class.
Definition: qgis.h:2412
Object * operator->()
Returns pointer to blocked QObject.
Definition: qgis.h:2430
~QgsSignalBlocker()
Definition: qgis.h:2424
QgsSignalBlocker(Object *object)
Constructor for QgsSignalBlocker.
Definition: qgis.h:2419
Abstract base class for simple marker symbol layers.
This is a container for configuration of the snapping of the project.
Utility functions for working with strings.
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:93
Base class for templated line symbols, e.g.
Container for all settings relating to text rendering.
Definition: qgstextformat.h:41
Handles rendering text using rich formatting options, including drop shadows, buffers and background ...
This is the class is providing tolerance value in map unit values.
Definition: qgstolerance.h:33
Implementation of data provider temporal properties for QgsVectorDataProviders.
This is the base class for vector data providers.
A convenience class for exporting vector layers to a destination data provider.
Implementation of map layer temporal properties for vector layers.
Represents a vector layer which manages a vector based data sets.
FeatureCountState
Enumeration of feature count states.
Definition: qgis.h:195
QgsMapLayerType
Types of layers that can be added to a map.
Definition: qgis.h:47
@ PointCloudLayer
Point cloud layer. Added in QGIS 3.18.
@ MeshLayer
Mesh layer. Added in QGIS 3.2.
@ VectorLayer
Vector layer.
@ RasterLayer
Raster layer.
@ GroupLayer
Composite group layer. Added in QGIS 3.24.
@ VectorTileLayer
Vector tile layer. Added in QGIS 3.14.
@ AnnotationLayer
Contains freeform, georeferenced annotations. Added in QGIS 3.16.
@ PluginLayer
Plugin based layer.
int significantDigits(const Qgis::DataType rasterDataType)
Returns the maximum number of significant digits a for the given rasterDataType.
As part of the API refactoring and improvements which landed in QGIS
#define str(x)
Definition: qgis.cpp:37
CONSTLATIN1STRING geoNone()
Constant that holds the string representation for "No ellips/No CRS".
Definition: qgis.h:2979
const double DEFAULT_LINE_WIDTH
Definition: qgis.h:3017
CORE_EXPORT uint qHash(const QVariant &variant)
Hash for QVariant.
Definition: qgis.cpp:217
bool operator>(const QVariant &v1, const QVariant &v2)
Compares two QVariant values and returns whether the first is greater than the second.
Definition: qgis.h:2871
CORE_EXPORT QString qgsVsiPrefix(const QString &path)
Definition: qgis.cpp:192
CORE_EXPORT bool qgsVariantEqual(const QVariant &lhs, const QVariant &rhs)
Compares two QVariant values and returns whether they are equal, two NULL values are always treated a...
Definition: qgis.cpp:266
T qgsEnumKeyToValue(const QString &key, const T &defaultValue, bool tryValueAsKey=true, bool *returnOk=nullptr)
Returns the value corresponding to the given key of an enum.
Definition: qgis.h:2700
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
Definition: qgis.h:2466
QString qgsEnumValueToKey(const T &value, bool *returnOk=nullptr)
Returns the value for the given key of an enum.
Definition: qgis.h:2681
QString qgsFlagValueToKeys(const T &value, bool *returnOk=nullptr)
Returns the value for the given keys of a flag.
Definition: qgis.h:2739
const long GEO_EPSG_CRS_ID
Magic number for a geographic coord sys in EpsgCrsId ID format.
Definition: qgis.h:3003
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:2761
CORE_EXPORT bool qgsVariantGreaterThan(const QVariant &lhs, const QVariant &rhs)
Compares two QVariant values and returns whether the first is greater than the second.
Definition: qgis.cpp:187
unsigned long long qgssize
Qgssize is used instead of size_t, because size_t is stdlib type, unknown by SIP, and it would be har...
Definition: qgis.h:3032
const QMap< T, QString > qgsEnumMap()
Returns a map of all enum entries.
Definition: qgis.h:2664
bool qgsFloatNear(float a, float b, float epsilon=4 *FLT_EPSILON)
Compare two floats (but allow some difference)
Definition: qgis.h:2544
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
const QList< T > qgsEnumList()
Returns a list all enum entries.
Definition: qgis.h:2647
double qgsRound(double number, int places)
Returns a double number, rounded (as close as possible) to the specified number of places.
Definition: qgis.h:2581
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
Definition: qgis.h:2527
CONSTLATIN1STRING geoProj4()
PROJ4 string that represents a geographic coord sys.
Definition: qgis.h:2967
bool qgsNanCompatibleEquals(double a, double b)
Compare two doubles, treating nan values as equal.
Definition: qgis.h:2511
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition: qgis.h:2453
void CORE_EXPORT * qgsMalloc(size_t size)
Allocates size bytes and returns a pointer to the allocated memory.
Definition: qgis.cpp:92
const double DEFAULT_SEGMENT_EPSILON
Default snapping tolerance for segments.
Definition: qgis.h:3020
QMap< QString, QString > QgsStringMap
Definition: qgis.h:3022
#define CONSTLATIN1STRING
Definition: qgis.h:2920
CONSTLATIN1STRING geoWkt()
Wkt string that represents a geographic coord sys.
Definition: qgis.h:2959
bool qgsDoubleNearSig(double a, double b, int significantDigits=10)
Compare two doubles using specified number of significant digits.
Definition: qgis.h:2556
const int USER_CRS_START_ID
Magick number that determines whether a projection crsid is a system (srs.db) or user (~/....
Definition: qgis.h:3009
void CORE_EXPORT qgsFree(void *ptr)
Frees the memory space pointed to by ptr.
Definition: qgis.cpp:114
CORE_EXPORT qlonglong qgsPermissiveToLongLong(QString string, bool &ok)
Converts a string to an qlonglong in a permissive way, e.g., allowing for incorrect numbers of digits...
Definition: qgis.cpp:85
CORE_EXPORT int qgsPermissiveToInt(QString string, bool &ok)
Converts a string to an integer in a permissive way, e.g., allowing for incorrect numbers of digits b...
Definition: qgis.cpp:78
CORE_EXPORT bool qgsVariantLessThan(const QVariant &lhs, const QVariant &rhs)
Compares two QVariant values and returns whether the first is less than the second.
Definition: qgis.cpp:119
const long GEOSRID
Magic number for a geographic coord sys in POSTGIS SRID.
Definition: qgis.h:2997
#define QHASH_FOR_CLASS_ENUM(T)
Definition: qgis.h:61
bool operator<(const QVariant &v1, const QVariant &v2)
Compares two QVariant values and returns whether the first is less than the second.
Definition: qgis.h:2885
CONSTLATIN1STRING geoEpsgCrsAuthId()
Geographic coord sys from EPSG authority.
Definition: qgis.h:2973
const long GEOCRS_ID
Magic number for a geographic coord sys in QGIS srs.db tbl_srs.srs_id.
Definition: qgis.h:3000
const double DEFAULT_POINT_SIZE
Magic number that determines the default point size for point symbols.
Definition: qgis.h:3016
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition: qgis_sip.h:266
#define SIP_MONKEYPATCH_FLAGS_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition: qgis_sip.h:267
#define SIP_MONKEYPATCH_SCOPEENUM
Definition: qgis_sip.h:265
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)
Definition: qgis_sip.h:268
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
int precision
Utility class for identifying a unique vertex within a geometry.
Definition: qgsvertexid.h:31