QGIS API Documentation 3.27.0-Master (f261cc1f8b)
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 MeshEditingErrorType : int
735 {
736 NoError,
737 InvalidFace,
738 TooManyVerticesInFace,
739 FlatFace,
740 UniqueSharedVertex,
741 InvalidVertex,
742 ManifoldFace,
743 };
744 Q_ENUM( MeshEditingErrorType )
745
746
751 enum class FilePathType : int
752 {
753 Absolute,
754 Relative,
755 };
756 Q_ENUM( FilePathType )
757
758
763 enum class SublayerPromptMode : int
764 {
765 AlwaysAsk,
766 AskExcludingRasterBands,
767 NeverAskSkip,
768 NeverAskLoadAll,
769 };
770 Q_ENUM( SublayerPromptMode )
771
772
778 {
779 SetSelection,
780 AddToSelection,
781 IntersectSelection,
782 RemoveFromSelection,
783 };
784 Q_ENUM( SelectBehavior )
785
786
792 {
793 Intersect,
794 Within,
795 };
796 Q_ENUM( SelectGeometryRelationship )
797
798
803 enum class SelectionFlag : int
804 {
805 SingleFeatureSelection = 1 << 0,
806 ToggleSelection = 1 << 1,
807 };
808
814 Q_DECLARE_FLAGS( SelectionFlags, SelectionFlag )
815
816 Q_ENUM( SelectionFlag )
817 Q_FLAG( SelectionFlags )
818
819
825 {
826 Success = 0,
827 EmptyGeometry = 1,
828 EditFailed = 2,
829 FetchFeatureFailed = 3,
830 InvalidLayer = 4,
831 };
832 Q_ENUM( VectorEditResult )
833
834
840 {
841 SemiTransparentCircle,
842 Cross,
843 NoMarker,
844 };
845 Q_ENUM( VertexMarkerType )
846
847
851 enum class ContentStatus : int
852 {
853 NotStarted,
854 Running,
855 Finished,
856 Failed,
857 Canceled,
858 };
859 Q_ENUM( ContentStatus )
860
861
867 {
868 Unknown = -1,
869 Invalid,
870 GPS,
871 DGPS,
872 PPS,
873 RTK,
874 FloatRTK,
875 Estimated,
876 Manual,
877 Simulation,
878 };
879 Q_ENUM( GpsQualityIndicator )
880
881
886 enum class BabelFormatCapability : int
887 {
888 Import = 1 << 0,
889 Export = 1 << 1,
890 Waypoints = 1 << 2,
891 Routes = 1 << 3,
892 Tracks = 1 << 4,
893 };
895 Q_DECLARE_FLAGS( BabelFormatCapabilities, BabelFormatCapability )
896 Q_ENUM( BabelFormatCapability )
897 Q_FLAG( BabelFormatCapabilities )
898
899
905 enum class BabelCommandFlag : int
906 {
907 QuoteFilePaths = 1 << 0,
908 };
910 Q_DECLARE_FLAGS( BabelCommandFlags, BabelCommandFlag )
911 Q_ENUM( BabelCommandFlag )
912 Q_FLAG( BabelCommandFlags )
913
914
919 enum class GpsFeatureType : int
920 {
921 Waypoint,
922 Route,
923 Track,
924 };
925 Q_ENUM( GpsFeatureType )
926
927
935 {
936 Success = 0,
937 NothingHappened = 1000,
938 InvalidBaseGeometry,
939 InvalidInputGeometryType,
940 SelectionIsEmpty,
941 SelectionIsGreaterThanOne,
942 GeometryEngineError,
943 LayerNotEditable,
944 /* Add part issues */
945 AddPartSelectedGeometryNotFound,
946 AddPartNotMultiGeometry,
947 /* Add ring issues*/
948 AddRingNotClosed,
949 AddRingNotValid,
950 AddRingCrossesExistingRings,
951 AddRingNotInExistingFeature,
952 /* Split features */
953 SplitCannotSplitPoint,
954 };
955 Q_ENUM( GeometryOperationResult )
956
957
963 {
964 AllowSelfTouchingHoles SIP_MONKEYPATCH_COMPAT_NAME( FlagAllowSelfTouchingHoles ) = 1 << 0,
965 };
968 Q_ENUM( GeometryValidityFlag )
969 Q_FLAG( GeometryValidityFlags )
970
971
976 {
977 QgisInternal SIP_MONKEYPATCH_COMPAT_NAME( ValidatorQgisInternal ),
978 Geos SIP_MONKEYPATCH_COMPAT_NAME( ValidatorGeos ),
979 };
980 Q_ENUM( GeometryValidationEngine )
981
982
988 {
989 Left SIP_MONKEYPATCH_COMPAT_NAME( SideLeft ) = 0,
991 };
992 Q_ENUM( BufferSide )
993
994
1000 {
1001 Round SIP_MONKEYPATCH_COMPAT_NAME( CapRound ) = 1,
1002 Flat SIP_MONKEYPATCH_COMPAT_NAME( CapFlat ),
1003 Square SIP_MONKEYPATCH_COMPAT_NAME( CapSquare ),
1004 };
1005 Q_ENUM( EndCapStyle )
1006
1007
1013 {
1014 Round SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleRound ) = 1,
1015 Miter SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleMiter ),
1016 Bevel SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleBevel ),
1017 };
1018 Q_ENUM( JoinStyle )
1019
1020
1025 enum class SpatialFilterType : int
1026 {
1027 NoFilter,
1028 BoundingBox,
1029 DistanceWithin,
1030 };
1031 Q_ENUM( SpatialFilterType )
1032
1033
1038 enum class FileOperationFlag : int
1039 {
1040 IncludeMetadataFile = 1 << 0,
1041 IncludeStyleFile = 1 << 1,
1042 };
1044 Q_DECLARE_FLAGS( FileOperationFlags, FileOperationFlag )
1045 Q_ENUM( FileOperationFlag )
1046 Q_FLAG( FileOperationFlags )
1047
1048
1053 enum class MapLayerProperty : int
1054 {
1055 UsersCannotToggleEditing = 1 << 0,
1056 IsBasemapLayer = 1 << 1,
1057 };
1059 Q_DECLARE_FLAGS( MapLayerProperties, MapLayerProperty )
1060 Q_ENUM( MapLayerProperty )
1061 Q_FLAG( MapLayerProperties )
1062
1063
1068 enum class DataProviderFlag : int
1069 {
1070 IsBasemapSource = 1 << 1,
1071 };
1073 Q_DECLARE_FLAGS( DataProviderFlags, DataProviderFlag )
1074 Q_ENUM( DataProviderFlag )
1075 Q_FLAG( DataProviderFlags )
1076
1077
1084 enum class CrsAxisDirection : int
1085 {
1086 North,
1087 NorthNorthEast,
1088 NorthEast,
1089 EastNorthEast,
1090 East,
1091 EastSouthEast,
1092 SouthEast,
1093 SouthSouthEast,
1094 South,
1095 SouthSouthWest,
1096 SouthWest,
1097 WestSouthWest,
1098 West,
1099 WestNorthWest,
1100 NorthWest,
1101 NorthNorthWest,
1102 GeocentricX,
1103 GeocentricY,
1104 GeocentricZ,
1105 Up,
1106 Down,
1107 Forward,
1108 Aft,
1109 Port,
1110 Starboard,
1111 Clockwise,
1112 CounterClockwise,
1113 ColumnPositive,
1114 ColumnNegative,
1115 RowPositive,
1116 RowNegative,
1117 DisplayRight,
1118 DisplayLeft,
1119 DisplayUp,
1120 DisplayDown,
1121 Future,
1122 Past,
1123 Towards,
1124 AwayFrom,
1125 Unspecified,
1126 };
1127 Q_ENUM( CrsAxisDirection )
1128
1129
1134 enum class CoordinateOrder : int
1135 {
1136 Default,
1137 XY,
1138 YX,
1139 };
1140 Q_ENUM( CoordinateOrder )
1141
1142
1147 enum class AnnotationItemFlag : int
1148 {
1149 ScaleDependentBoundingBox = 1 << 0,
1150 };
1152 Q_DECLARE_FLAGS( AnnotationItemFlags, AnnotationItemFlag )
1153 Q_ENUM( AnnotationItemFlag )
1154 Q_FLAG( AnnotationItemFlags )
1155
1156
1161 enum class AnnotationItemGuiFlag : int
1162 {
1163 FlagNoCreationTools = 1 << 0,
1164 };
1166 Q_DECLARE_FLAGS( AnnotationItemGuiFlags, AnnotationItemGuiFlag )
1167 Q_ENUM( AnnotationItemGuiFlag )
1168 Q_FLAG( AnnotationItemGuiFlags )
1169
1170
1175 enum class AnnotationItemNodeType : int
1176 {
1177 VertexHandle,
1178 };
1179 Q_ENUM( AnnotationItemNodeType )
1180
1181
1187 {
1188 Success,
1189 Invalid,
1190 ItemCleared,
1191 };
1192 Q_ENUM( AnnotationItemEditOperationResult )
1193
1194
1200 {
1201 FixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ModeFixedTemporalRange ) = 0,
1202 FeatureDateTimeInstantFromField SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeInstantFromField ),
1203 FeatureDateTimeStartAndEndFromFields SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndEndFromFields ),
1204 FeatureDateTimeStartAndDurationFromFields SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndDurationFromFields ),
1205 FeatureDateTimeStartAndEndFromExpressions SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndEndFromExpressions ),
1206 RedrawLayerOnly SIP_MONKEYPATCH_COMPAT_NAME( ModeRedrawLayerOnly ),
1207 };
1208 Q_ENUM( VectorTemporalMode )
1209
1210
1216 {
1217 IncludeBeginExcludeEnd = 0,
1218 IncludeBeginIncludeEnd,
1219 };
1220 Q_ENUM( VectorTemporalLimitMode )
1221
1222
1228 {
1229 HasFixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ProviderHasFixedTemporalRange ) = 0,
1230 StoresFeatureDateTimeInstantInField SIP_MONKEYPATCH_COMPAT_NAME( ProviderStoresFeatureDateTimeInstantInField ),
1231 StoresFeatureDateTimeStartAndEndInSeparateFields SIP_MONKEYPATCH_COMPAT_NAME( ProviderStoresFeatureDateTimeStartAndEndInSeparateFields ),
1232 };
1233 Q_ENUM( VectorDataProviderTemporalMode )
1234
1235
1241 {
1242 FixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ModeFixedTemporalRange ) = 0,
1243 TemporalRangeFromDataProvider SIP_MONKEYPATCH_COMPAT_NAME( ModeTemporalRangeFromDataProvider ) = 1,
1244 RedrawLayerOnly SIP_MONKEYPATCH_COMPAT_NAME( ModeRedrawLayerOnly ) = 2,
1245 };
1246 Q_ENUM( RasterTemporalMode )
1247
1248
1254 {
1255 MatchUsingWholeRange,
1256 MatchExactUsingStartOfRange,
1257 MatchExactUsingEndOfRange,
1258 FindClosestMatchToStartOfRange,
1259 FindClosestMatchToEndOfRange
1260 };
1261 Q_ENUM( TemporalIntervalMatchMethod )
1262
1263
1269 {
1270 RequestedTimesMustExactlyMatchAllAvailableTemporalRanges = 1 << 0,
1271 };
1272 Q_ENUM( RasterTemporalCapabilityFlag )
1273
1274
1279 Q_DECLARE_FLAGS( RasterTemporalCapabilityFlags, RasterTemporalCapabilityFlag )
1280 Q_ENUM( RasterTemporalCapabilityFlags )
1281
1282
1288 {
1289 Forward SIP_MONKEYPATCH_COMPAT_NAME( ForwardTransform ),
1290 Reverse SIP_MONKEYPATCH_COMPAT_NAME( ReverseTransform )
1291 };
1292 Q_ENUM( TransformDirection )
1293
1294
1300 {
1301 BallparkTransformsAreAppropriate = 1 << 0,
1302 IgnoreImpossibleTransformations = 1 << 1,
1303 };
1304 Q_ENUM( CoordinateTransformationFlag )
1305
1306
1311 Q_DECLARE_FLAGS( CoordinateTransformationFlags, CoordinateTransformationFlag )
1312 Q_ENUM( CoordinateTransformationFlags )
1313
1314
1320 {
1321 Antialiasing = 0x01,
1322 DrawEditingInfo = 0x02,
1323 ForceVectorOutput = 0x04,
1324 UseAdvancedEffects = 0x08,
1325 DrawLabeling = 0x10,
1326 UseRenderingOptimization = 0x20,
1327 DrawSelection = 0x40,
1328 DrawSymbolBounds = 0x80,
1329 RenderMapTile = 0x100,
1330 RenderPartialOutput = 0x200,
1331 RenderPreviewJob = 0x400,
1332 RenderBlocking = 0x800,
1333 LosslessImageRendering = 0x1000,
1334 Render3DMap = 0x2000,
1335 HighQualityImageTransforms = 0x4000,
1336 SkipSymbolRendering = 0x8000,
1337 ForceRasterMasks = 0x10000,
1338 };
1341 Q_ENUM( MapSettingsFlag )
1342 Q_FLAG( MapSettingsFlags )
1343
1344
1350 {
1351 DrawEditingInfo = 0x01,
1352 ForceVectorOutput = 0x02,
1353 UseAdvancedEffects = 0x04,
1354 UseRenderingOptimization = 0x08,
1355 DrawSelection = 0x10,
1356 DrawSymbolBounds = 0x20,
1357 RenderMapTile = 0x40,
1358 Antialiasing = 0x80,
1359 RenderPartialOutput = 0x100,
1360 RenderPreviewJob = 0x200,
1361 RenderBlocking = 0x400,
1362 RenderSymbolPreview = 0x800,
1363 LosslessImageRendering = 0x1000,
1364 ApplyScalingWorkaroundForTextRendering = 0x2000,
1365 Render3DMap = 0x4000,
1366 ApplyClipAfterReprojection = 0x8000,
1367 RenderingSubSymbol = 0x10000,
1368 HighQualityImageTransforms = 0x20000,
1369 SkipSymbolRendering = 0x40000,
1370 };
1373 Q_ENUM( RenderContextFlag )
1374 Q_FLAG( RenderContextFlags )
1375
1376 // refs for below dox: https://github.com/qgis/QGIS/pull/1286#issuecomment-39806854
1377 // https://github.com/qgis/QGIS/pull/8573#issuecomment-445585826
1378
1379
1384 {
1385 AlwaysOutlines SIP_MONKEYPATCH_COMPAT_NAME( TextFormatAlwaysOutlines ),
1386 AlwaysText SIP_MONKEYPATCH_COMPAT_NAME( TextFormatAlwaysText ),
1387 };
1388 Q_ENUM( TextRenderFormat )
1389
1390
1396 {
1397 Generic,
1398 ShadowOffset,
1399 BlurSize,
1400 GlowSpread,
1401 };
1402 Q_ENUM( RenderSubcomponentProperty )
1403
1404
1409 {
1410 Segment SIP_MONKEYPATCH_COMPAT_NAME( SegmentVertex ) = 1,
1411 Curve SIP_MONKEYPATCH_COMPAT_NAME( CurveVertex ) = 2,
1412 };
1413 Q_ENUM( VertexType )
1414
1415
1423 {
1424 Square,
1425 Diamond,
1426 Pentagon,
1427 Hexagon,
1428 Triangle,
1429 EquilateralTriangle,
1430 Star,
1431 Arrow,
1432 Circle,
1433 Cross,
1434 CrossFill,
1435 Cross2,
1436 Line,
1437 ArrowHead,
1438 ArrowHeadFilled,
1439 SemiCircle,
1440 ThirdCircle,
1441 QuarterCircle,
1442 QuarterSquare,
1443 HalfSquare,
1444 DiagonalHalfSquare,
1445 RightHalfTriangle,
1446 LeftHalfTriangle,
1447 Octagon,
1448 SquareWithCorners,
1449 AsteriskFill,
1450 HalfArc,
1451 ThirdArc,
1452 QuarterArc,
1453 };
1454 Q_ENUM( MarkerShape )
1455
1456
1464 {
1465 Interval = 1 << 0,
1466 Vertex = 1 << 1,
1467 LastVertex = 1 << 2,
1468 FirstVertex = 1 << 3,
1469 CentralPoint = 1 << 4,
1470 CurvePoint = 1 << 5,
1471 SegmentCenter = 1 << 6,
1472 InnerVertices = 1 << 7,
1473 };
1474 Q_ENUM( MarkerLinePlacement )
1475 Q_DECLARE_FLAGS( MarkerLinePlacements, MarkerLinePlacement )
1476 Q_FLAG( MarkerLinePlacements )
1477
1478
1486 {
1487 SimpleTwoColor,
1488 ColorRamp,
1489 };
1490 Q_ENUM( GradientColorSource )
1491
1492
1500 {
1501 Linear,
1502 Radial,
1503 Conical,
1504 };
1505 Q_ENUM( GradientType )
1506
1507
1515 {
1516 Feature,
1517 Viewport,
1518 };
1519 Q_ENUM( SymbolCoordinateReference )
1520
1521
1530 {
1531 Pad,
1532 Reflect,
1533 Repeat,
1534 };
1535 Q_ENUM( GradientSpread )
1536
1537
1545 {
1546 Absolute SIP_MONKEYPATCH_COMPAT_NAME( AbsoluteCount ),
1547 DensityBased SIP_MONKEYPATCH_COMPAT_NAME( DensityBasedCount ),
1548 };
1549 Q_ENUM( PointCountMethod )
1550
1551
1556 enum class MarkerClipMode : int
1557 {
1558 NoClipping,
1559 Shape,
1560 CentroidWithin,
1561 CompletelyWithin,
1562 };
1563 Q_ENUM( MarkerClipMode )
1564
1565
1570 enum class LineClipMode : int
1571 {
1572 ClipPainterOnly,
1573 ClipToIntersection,
1574 NoClipping,
1575 };
1576 Q_ENUM( LineClipMode )
1577
1578
1584 {
1585 NoRule,
1586 FullDash,
1587 HalfDash,
1588 FullGap,
1589 HalfGap,
1590 };
1591 Q_ENUM( DashPatternLineEndingRule )
1592
1593
1599 {
1600 ScaleBothDashAndGap,
1601 ScaleDashOnly,
1602 ScaleGapOnly,
1603 };
1604 Q_ENUM( DashPatternSizeAdjustment )
1605
1606
1614 {
1615 Color SIP_MONKEYPATCH_COMPAT_NAME( GraduatedColor ),
1616 Size SIP_MONKEYPATCH_COMPAT_NAME( GraduatedSize ),
1617 };
1618 Q_ENUM( GraduatedMethod )
1619
1620
1624 enum class DpiMode
1625 {
1626 All = 7,
1627 Off = 0,
1628 QGIS = 1,
1629 UMN = 2,
1630 GeoServer = 4,
1631 };
1632 Q_ENUM( DpiMode )
1633
1634
1635 // NOTE -- the hardcoded numbers here must match QFont::Capitalization!
1636
1637
1645 {
1646 MixedCase = 0,
1647 AllUppercase = 1,
1648 AllLowercase = 2,
1649 ForceFirstLetterToCapital = 4,
1650 SmallCaps = 5,
1651 TitleCase = 1004,
1652 UpperCamelCase = 1005,
1653 AllSmallCaps = 1006,
1654 };
1655 Q_ENUM( Capitalization )
1656
1657
1662 enum class TextRendererFlag : int
1663 {
1664 WrapLines = 1 << 0,
1665 };
1666 Q_ENUM( TextRendererFlag )
1667 Q_DECLARE_FLAGS( TextRendererFlags, TextRendererFlag )
1668 Q_FLAG( TextRendererFlags )
1669
1670
1676 {
1677 MapBox,
1678 Esri,
1679 };
1681
1688 {
1689 Clockwise,
1690 CounterClockwise,
1691 };
1692 Q_ENUM( AngularDirection )
1693
1694
1699 enum class RendererUsage : int
1700 {
1701 View,
1702 Export,
1703 Unknown,
1704 };
1705 Q_ENUM( RendererUsage )
1706
1707
1712 enum class ViewSyncModeFlag : int
1713 {
1714 Sync3DTo2D = 1 << 0,
1715 Sync2DTo3D = 1 << 1,
1716 };
1717 Q_ENUM( ViewSyncModeFlag )
1718 Q_DECLARE_FLAGS( ViewSyncModeFlags, ViewSyncModeFlag )
1719
1720
1725 enum class HistoryProviderBackend : int
1726 {
1727 LocalProfile = 1 << 0,
1728// Project = 1 << 1, //!< QGIS Project (not yet implemented)
1729 };
1730 Q_ENUM( HistoryProviderBackend )
1731 Q_DECLARE_FLAGS( HistoryProviderBackends, HistoryProviderBackend )
1732 Q_FLAG( HistoryProviderBackends )
1733
1734
1740 {
1741 Wkt SIP_MONKEYPATCH_COMPAT_NAME( FormatWkt ),
1742 Proj SIP_MONKEYPATCH_COMPAT_NAME( FormatProj ),
1743 };
1744 Q_ENUM( CrsDefinitionFormat )
1745
1746
1754 enum class FieldDomainSplitPolicy : int
1755 {
1756 DefaultValue,
1757 Duplicate,
1758 GeometryRatio,
1759 };
1760 Q_ENUM( FieldDomainSplitPolicy )
1761
1762
1770 enum class FieldDomainMergePolicy : int
1771 {
1772 DefaultValue,
1773 Sum,
1774 GeometryWeighted,
1775 };
1776 Q_ENUM( FieldDomainMergePolicy )
1777
1778
1783 enum class FieldDomainType : int
1784 {
1785 Coded,
1786 Range,
1787 Glob,
1788 };
1789 Q_ENUM( FieldDomainType )
1790
1791
1796 enum class TransactionMode : int
1797 {
1798 Disabled = 0,
1799 AutomaticGroups = 1,
1800 BufferedGroups = 2,
1801 };
1802 Q_ENUM( TransactionMode )
1803
1804
1809 enum class AltitudeClamping : int
1810 {
1811 Absolute,
1812 Relative,
1813 Terrain,
1814 };
1815 Q_ENUM( AltitudeClamping )
1816
1817
1822 enum class AltitudeBinding : int
1823 {
1824 Vertex,
1825 Centroid,
1826 };
1827 Q_ENUM( AltitudeBinding )
1828
1829
1835 {
1836 NoConstraint,
1837 Perpendicular,
1838 Parallel
1839 };
1840 Q_ENUM( BetweenLineConstraint )
1841
1842
1847 enum class LineExtensionSide : int
1848 {
1849 BeforeVertex,
1850 AfterVertex,
1851 NoVertex,
1852 };
1853 Q_ENUM( LineExtensionSide )
1854
1855
1860 enum class ProjectFlag : int
1861 {
1862 EvaluateDefaultValuesOnProviderSide = 1 << 0,
1863 TrustStoredLayerStatistics = 1 << 1,
1864 RememberLayerEditStatusBetweenSessions = 1 << 2,
1865 RememberAttributeTableWindowsBetweenSessions = 1 << 3,
1866 };
1867 Q_ENUM( ProjectFlag )
1868 Q_DECLARE_FLAGS( ProjectFlags, ProjectFlag )
1869 Q_FLAG( ProjectFlags )
1870
1871
1876 enum class PlotToolFlag : int
1877 {
1878 ShowContextMenu = 1 << 0,
1879 };
1880 Q_ENUM( PlotToolFlag )
1881 Q_DECLARE_FLAGS( PlotToolFlags, PlotToolFlag )
1882 Q_FLAG( PlotToolFlags )
1883
1884
1889 enum class LightSourceType : int
1890 {
1891 Point,
1892 Directional,
1893 };
1894 Q_ENUM( LightSourceType )
1895
1896
1902 {
1903 Line,
1904 FillBelow,
1905 };
1907
1913 enum class VectorProfileType : int
1914 {
1915 IndividualFeatures,
1916 ContinuousSurface,
1917 };
1919
1925 enum class ProfileGeneratorFlag : int
1926 {
1927 RespectsMaximumErrorMapUnit = 1 << 0,
1928 RespectsDistanceRange = 1 << 1,
1929 RespectsElevationRange = 1 << 2,
1930 };
1931 Q_ENUM( ProfileGeneratorFlag )
1932 Q_DECLARE_FLAGS( ProfileGeneratorFlags, ProfileGeneratorFlag )
1933 Q_FLAG( ProfileGeneratorFlags )
1934
1935
1941 {
1942 Square,
1943 Circle,
1944 };
1945 Q_ENUM( PointCloudSymbol )
1946
1947
1953 {
1954 Default,
1955 BottomToTop,
1956 TopToBottom,
1957 };
1958 Q_ENUM( PointCloudDrawOrder )
1959
1960
1968 {
1969 AllowIntersections,
1970 AvoidIntersectionsCurrentLayer,
1971 AvoidIntersectionsLayers,
1972 };
1973 Q_ENUM( AvoidIntersectionsMode )
1974
1975
1983 {
1984 Qgz,
1985 Qgs,
1986 };
1987 Q_ENUM( ProjectFileFormat )
1988
1989
1997 {
1998 DontResolveLayers SIP_MONKEYPATCH_COMPAT_NAME( FlagDontResolveLayers ) = 1 << 0,
1999 DontLoadLayouts SIP_MONKEYPATCH_COMPAT_NAME( FlagDontLoadLayouts ) = 1 << 1,
2000 TrustLayerMetadata SIP_MONKEYPATCH_COMPAT_NAME( FlagTrustLayerMetadata ) = 1 << 2,
2001 DontStoreOriginalStyles SIP_MONKEYPATCH_COMPAT_NAME( FlagDontStoreOriginalStyles ) = 1 << 3,
2002 DontLoad3DViews SIP_MONKEYPATCH_COMPAT_NAME( FlagDontLoad3DViews ) = 1 << 4,
2003 DontLoadProjectStyles = 1 << 5,
2004 };
2005 Q_ENUM( ProjectReadFlag )
2006
2007
2014 Q_DECLARE_FLAGS( ProjectReadFlags, ProjectReadFlag ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsProject, ReadFlags )
2015 Q_FLAG( ProjectReadFlags )
2016
2025 enum class ProjectCapability : int
2026 {
2027 ProjectStyles = 1 << 0,
2028 };
2029 Q_ENUM( ProjectCapability )
2030
2031
2036 Q_DECLARE_FLAGS( ProjectCapabilities, ProjectCapability )
2037 Q_FLAG( ProjectCapabilities )
2038
2039
2045 {
2046 Vector,
2047 Raster,
2048 RasterDem,
2049 GeoJson,
2050 Image,
2051 Video,
2052 Unknown,
2053 };
2054 Q_ENUM( MapBoxGlStyleSourceType )
2055
2056
2064 {
2065 FeatureServer SIP_MONKEYPATCH_COMPAT_NAME( FeatureService ),
2066 MapServer SIP_MONKEYPATCH_COMPAT_NAME( MapService ),
2067 ImageServer SIP_MONKEYPATCH_COMPAT_NAME( ImageService ),
2068 GlobeServer,
2069 GPServer,
2070 GeocodeServer,
2071 Unknown,
2072 };
2073 Q_ENUM( ArcGisRestServiceType )
2074
2075
2083 {
2084 Normal,
2085 Generated,
2086 };
2087 Q_ENUM( RelationshipType )
2088
2089
2097 {
2098 Association,
2099 Composition,
2100 };
2101 Q_ENUM( RelationshipStrength )
2102
2103
2109 {
2110 OneToOne,
2111 OneToMany,
2112 ManyToOne,
2113 ManyToMany,
2114 };
2115 Q_ENUM( RelationshipCardinality )
2116
2117
2121 static const double DEFAULT_SEARCH_RADIUS_MM;
2122
2124 static const float DEFAULT_MAPTOPIXEL_THRESHOLD;
2125
2132 static const QColor DEFAULT_HIGHLIGHT_COLOR;
2133
2138 static const double DEFAULT_HIGHLIGHT_BUFFER_MM;
2139
2144 static const double DEFAULT_HIGHLIGHT_MIN_WIDTH_MM;
2145
2152 static const double SCALE_PRECISION;
2153
2159 static const double DEFAULT_Z_COORDINATE;
2160
2166 static const double DEFAULT_M_COORDINATE;
2167
2173 static const double UI_SCALE_FACTOR;
2174
2179 static const double DEFAULT_SNAP_TOLERANCE;
2180
2185 static const QgsTolerance::UnitType DEFAULT_SNAP_UNITS;
2186
2192 static QString defaultProjectScales();
2193
2199 static int geosVersionInt();
2200
2206 static int geosVersionMajor();
2207
2213 static int geosVersionMinor();
2214
2220 static int geosVersionPatch();
2221
2227 static QString geosVersion();
2228};
2229
2231
2232Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolRenderHints )
2233Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolFlags )
2234Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolPreviewFlags )
2235Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolLayerFlags )
2236Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BrowserItemCapabilities )
2237Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SublayerQueryFlags )
2238Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SublayerFlags )
2239Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SqlLayerDefinitionCapabilities )
2240Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BabelFormatCapabilities )
2241Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BabelCommandFlags )
2242Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::GeometryValidityFlags )
2243Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::FileOperationFlags )
2244Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::AnnotationItemFlags )
2245Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::AnnotationItemGuiFlags )
2246Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MapSettingsFlags )
2247Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::RenderContextFlags )
2248Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::VectorLayerTypeFlags )
2249Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MarkerLinePlacements )
2250Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::TextRendererFlags )
2251Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::HistoryProviderBackends )
2252Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MapLayerProperties )
2253Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::DataProviderFlags )
2254Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SnappingTypes )
2255Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::PlotToolFlags )
2256Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::ProfileGeneratorFlags )
2257Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::ProjectReadFlags )
2258Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::ProjectCapabilities )
2259Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::CoordinateTransformationFlags )
2260Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::RasterTemporalCapabilityFlags )
2261Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SelectionFlags )
2262
2263
2264// hack to workaround warnings when casting void pointers
2265// retrieved from QLibrary::resolve to function pointers.
2266// It's assumed that this works on all systems supporting
2267// QLibrary
2268#define cast_to_fptr(f) f
2269
2270
2279// based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
2280template<class Object> class QgsSignalBlocker SIP_SKIP SIP_SKIP // clazy:exclude=rule-of-three
2281{
2282 public:
2283
2288 explicit QgsSignalBlocker( Object * object )
2289 : mObject( object )
2290 , mPreviousState( object->blockSignals( true ) )
2291 {}
2292
2294 {
2295 mObject->blockSignals( mPreviousState );
2296 }
2297
2299 Object *operator->() { return mObject; }
2300
2301 private:
2302
2303 Object *mObject = nullptr;
2304 bool mPreviousState;
2305
2306};
2307
2321// based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
2322template<class Object> inline QgsSignalBlocker<Object> whileBlocking( Object *object ) SIP_SKIP SIP_SKIP
2323{
2324 return QgsSignalBlocker<Object>( object );
2325}
2326
2328CORE_EXPORT uint qHash( const QVariant &variant );
2329
2335inline QString qgsDoubleToString( double a, int precision = 17 )
2336{
2337 QString str;
2338 if ( precision )
2339 {
2340 if ( precision < 0 )
2341 {
2342 const double roundFactor = std::pow( 10, -precision );
2343 str = QString::number( static_cast< long long >( std::round( a / roundFactor ) * roundFactor ) );
2344 }
2345 else
2346 {
2347 str = QString::number( a, 'f', precision );
2348 if ( str.contains( QLatin1Char( '.' ) ) )
2349 {
2350 // remove ending 0s
2351 int idx = str.length() - 1;
2352 while ( str.at( idx ) == '0' && idx > 1 )
2353 {
2354 idx--;
2355 }
2356 if ( idx < str.length() - 1 )
2357 str.truncate( str.at( idx ) == '.' ? idx : idx + 1 );
2358 }
2359 }
2360 }
2361 else
2362 {
2363 str = QString::number( a, 'f', precision );
2364 }
2365 // avoid printing -0
2366 // see https://bugreports.qt.io/browse/QTBUG-71439
2367 if ( str == QLatin1String( "-0" ) )
2368 {
2369 return QLatin1String( "0" );
2370 }
2371 return str;
2372}
2373
2380inline bool qgsNanCompatibleEquals( double a, double b )
2381{
2382 const bool aIsNan = std::isnan( a );
2383 const bool bIsNan = std::isnan( b );
2384 if ( aIsNan || bIsNan )
2385 return aIsNan && bIsNan;
2386
2387 return a == b;
2388}
2389
2396inline bool qgsDoubleNear( double a, double b, double epsilon = 4 * std::numeric_limits<double>::epsilon() )
2397{
2398 const bool aIsNan = std::isnan( a );
2399 const bool bIsNan = std::isnan( b );
2400 if ( aIsNan || bIsNan )
2401 return aIsNan && bIsNan;
2402
2403 const double diff = a - b;
2404 return diff > -epsilon && diff <= epsilon;
2405}
2406
2413inline bool qgsFloatNear( float a, float b, float epsilon = 4 * FLT_EPSILON )
2414{
2415 const bool aIsNan = std::isnan( a );
2416 const bool bIsNan = std::isnan( b );
2417 if ( aIsNan || bIsNan )
2418 return aIsNan && bIsNan;
2419
2420 const float diff = a - b;
2421 return diff > -epsilon && diff <= epsilon;
2422}
2423
2425inline bool qgsDoubleNearSig( double a, double b, int significantDigits = 10 )
2426{
2427 const bool aIsNan = std::isnan( a );
2428 const bool bIsNan = std::isnan( b );
2429 if ( aIsNan || bIsNan )
2430 return aIsNan && bIsNan;
2431
2432 // The most simple would be to print numbers as %.xe and compare as strings
2433 // but that is probably too costly
2434 // Then the fastest would be to set some bits directly, but little/big endian
2435 // has to be considered (maybe TODO)
2436 // Is there a better way?
2437 int aexp, bexp;
2438 const double ar = std::frexp( a, &aexp );
2439 const double br = std::frexp( b, &bexp );
2440
2441 return aexp == bexp &&
2442 std::round( ar * std::pow( 10.0, significantDigits ) ) == std::round( br * std::pow( 10.0, significantDigits ) );
2443}
2444
2450inline double qgsRound( double number, int places )
2451{
2452 const double m = ( number < 0.0 ) ? -1.0 : 1.0;
2453 const double scaleFactor = std::pow( 10.0, places );
2454 return ( std::round( number * m * scaleFactor ) / scaleFactor ) * m;
2455}
2456
2457
2458#ifndef SIP_RUN
2459
2461
2471namespace qgis
2472{
2473
2486 template<typename To, typename From> inline To down_cast( From *f )
2487 {
2488 static_assert(
2489 ( std::is_base_of<From,
2490 typename std::remove_pointer<To>::type>::value ),
2491 "target type not derived from source type" );
2492 Q_ASSERT( f == nullptr || dynamic_cast<To>( f ) != nullptr );
2493 return static_cast<To>( f );
2494 }
2495
2496 template<class T>
2497 QSet<T> listToSet( const QList<T> &list )
2498 {
2499#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
2500 return list.toSet();
2501#else
2502 return QSet<T>( list.begin(), list.end() );
2503#endif
2504 }
2505
2506 template<class T>
2507 QList<T> setToList( const QSet<T> &set )
2508 {
2509#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
2510 return set.toList();
2511#else
2512 return QList<T>( set.begin(), set.end() );
2513#endif
2514 }
2515}
2516
2517#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
2518namespace std
2519{
2520 template<> struct hash<QString>
2521 {
2522 std::size_t operator()( const QString &s ) const noexcept
2523 {
2524 return ( size_t ) qHash( s );
2525 }
2526 };
2527}
2528#endif
2529
2531#endif
2532
2537template<class T> const QList<T> qgsEnumList() SIP_SKIP
2538{
2539 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2540 Q_ASSERT( metaEnum.isValid() );
2541 QList<T> enumList;
2542 for ( int idx = 0; idx < metaEnum.keyCount(); ++idx )
2543 {
2544 enumList.append( static_cast<T>( metaEnum.value( idx ) ) );
2545 }
2546 return enumList;
2547}
2548
2554template<class T> const QMap<T, QString> qgsEnumMap() SIP_SKIP
2555{
2556 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2557 Q_ASSERT( metaEnum.isValid() );
2558 QMap<T, QString> enumMap;
2559 for ( int idx = 0; idx < metaEnum.keyCount(); ++idx )
2560 {
2561 enumMap.insert( static_cast<T>( metaEnum.value( idx ) ), QString( metaEnum.key( idx ) ) );
2562 }
2563 return enumMap;
2564}
2565
2571template<class T> QString qgsEnumValueToKey( const T &value, bool *returnOk = nullptr ) SIP_SKIP
2572{
2573 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2574 Q_ASSERT( metaEnum.isValid() );
2575 const char *key = metaEnum.valueToKey( static_cast<int>( value ) );
2576 if ( returnOk )
2577 {
2578 *returnOk = key ? true : false;
2579 }
2580 return QString::fromUtf8( key );
2581}
2582
2590template<class T> T qgsEnumKeyToValue( const QString &key, const T &defaultValue, bool tryValueAsKey = true, bool *returnOk = nullptr ) SIP_SKIP
2591{
2592 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2593 Q_ASSERT( metaEnum.isValid() );
2594 bool ok = false;
2595 T v = static_cast<T>( metaEnum.keyToValue( key.toUtf8().data(), &ok ) );
2596 if ( returnOk )
2597 {
2598 *returnOk = ok;
2599 }
2600 if ( ok )
2601 {
2602 return v;
2603 }
2604 else
2605 {
2606 // if conversion has failed, try with conversion from int value
2607 if ( tryValueAsKey )
2608 {
2609 bool canConvert = false;
2610 const int intValue = key.toInt( &canConvert );
2611 if ( canConvert && metaEnum.valueToKey( intValue ) )
2612 {
2613 if ( returnOk )
2614 {
2615 *returnOk = true;
2616 }
2617 return static_cast<T>( intValue );
2618 }
2619 }
2620 }
2621 return defaultValue;
2622}
2623
2629template<class T> QString qgsFlagValueToKeys( const T &value, bool *returnOk = nullptr ) SIP_SKIP
2630{
2631 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2632 Q_ASSERT( metaEnum.isValid() );
2633 int intValue = static_cast<int>( value );
2634 const QByteArray ba = metaEnum.valueToKeys( intValue );
2635 // check that the int value does correspond to a flag
2636 // see https://stackoverflow.com/a/68495949/1548052
2637 const int intValueCheck = metaEnum.keysToValue( ba );
2638 bool ok = intValue == intValueCheck;
2639 if ( returnOk )
2640 *returnOk = ok;
2641 return ok ? QString::fromUtf8( ba ) : QString();
2642}
2643
2651template<class T> T qgsFlagKeysToValue( const QString &keys, const T &defaultValue, bool tryValueAsKey = true, bool *returnOk = nullptr ) SIP_SKIP
2652{
2653 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2654 Q_ASSERT( metaEnum.isValid() );
2655 bool ok = false;
2656 T v = static_cast<T>( metaEnum.keysToValue( keys.toUtf8().constData(), &ok ) );
2657 if ( returnOk )
2658 {
2659 *returnOk = ok;
2660 }
2661 if ( ok )
2662 {
2663 return v;
2664 }
2665 else
2666 {
2667 // if conversion has failed, try with conversion from int value
2668 if ( tryValueAsKey )
2669 {
2670 bool canConvert = false;
2671 const int intValue = keys.toInt( &canConvert );
2672 if ( canConvert )
2673 {
2674 const QByteArray keys = metaEnum.valueToKeys( intValue );
2675 const int intValueCheck = metaEnum.keysToValue( keys );
2676 if ( intValue == intValueCheck )
2677 {
2678 if ( returnOk )
2679 {
2680 *returnOk = true;
2681 }
2682 return T( intValue );
2683 }
2684 }
2685 }
2686 }
2687 return defaultValue;
2688}
2689
2690
2700CORE_EXPORT double qgsPermissiveToDouble( QString string, bool &ok );
2701
2711CORE_EXPORT int qgsPermissiveToInt( QString string, bool &ok );
2712
2722CORE_EXPORT qlonglong qgsPermissiveToLongLong( QString string, bool &ok );
2723
2733CORE_EXPORT bool qgsVariantLessThan( const QVariant &lhs, const QVariant &rhs );
2734
2743CORE_EXPORT bool qgsVariantEqual( const QVariant &lhs, const QVariant &rhs );
2744
2751CORE_EXPORT bool qgsVariantGreaterThan( const QVariant &lhs, const QVariant &rhs );
2752
2753#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
2754
2761inline bool operator> ( const QVariant &v1, const QVariant &v2 )
2762{
2763 return qgsVariantGreaterThan( v1, v2 );
2764}
2765
2775inline bool operator< ( const QVariant &v1, const QVariant &v2 )
2776{
2777 return qgsVariantLessThan( v1, v2 );
2778}
2779#endif
2780
2781
2782#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
2783
2787template<> CORE_EXPORT bool qMapLessThanKey<QVariantList>( const QVariantList &key1, const QVariantList &key2 ) SIP_SKIP;
2788#endif
2789
2790CORE_EXPORT QString qgsVsiPrefix( const QString &path );
2791
2797void CORE_EXPORT *qgsMalloc( size_t size ) SIP_SKIP;
2798
2803void CORE_EXPORT qgsFree( void *ptr ) SIP_SKIP;
2804
2805#ifndef SIP_RUN
2806
2807#ifdef _MSC_VER
2808#define CONSTLATIN1STRING inline const QLatin1String
2809#else
2810#define CONSTLATIN1STRING constexpr QLatin1String
2811#endif
2812
2814class ScopedIntIncrementor
2815{
2816 public:
2817
2818 ScopedIntIncrementor( int *variable )
2819 : mVariable( variable )
2820 {
2821 ( *mVariable )++;
2822 }
2823
2824 ScopedIntIncrementor( const ScopedIntIncrementor &other ) = delete;
2825 ScopedIntIncrementor &operator=( const ScopedIntIncrementor &other ) = delete;
2826
2827 void release()
2828 {
2829 if ( mVariable )
2830 ( *mVariable )--;
2831
2832 mVariable = nullptr;
2833 }
2834
2835 ~ScopedIntIncrementor()
2836 {
2837 release();
2838 }
2839
2840 private:
2841 int *mVariable = nullptr;
2842};
2844
2850{
2851 return QLatin1String(
2852 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]] )"""
2853 );
2854}
2855
2858{
2859 return QLatin1String( "+proj=longlat +datum=WGS84 +no_defs" );
2860}
2861
2864{
2865 return QLatin1String( "EPSG:4326" );
2866}
2867
2870{
2871 return QLatin1String( "NONE" );
2872}
2873
2875
2877const int PREVIEW_JOB_DELAY_MS = 250;
2878
2880const int MAXIMUM_LAYER_PREVIEW_TIME_MS = 250;
2881
2883
2884#endif
2885
2887const long GEOSRID = 4326;
2888
2890const long GEOCRS_ID = 3452;
2891
2893const long GEO_EPSG_CRS_ID = 4326;
2894
2899const int USER_CRS_START_ID = 100000;
2900
2901//
2902// Constants for point symbols
2903//
2904
2906const double DEFAULT_POINT_SIZE = 2.0;
2907const double DEFAULT_LINE_WIDTH = 0.26;
2908
2910const double DEFAULT_SEGMENT_EPSILON = 1e-8;
2911
2912typedef QMap<QString, QString> QgsStringMap SIP_SKIP;
2913
2922typedef unsigned long long qgssize;
2923
2924#ifndef SIP_RUN
2925#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
2926
2927#define Q_NOWARN_DEPRECATED_PUSH \
2928 _Pragma("GCC diagnostic push") \
2929 _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
2930#define Q_NOWARN_DEPRECATED_POP \
2931 _Pragma("GCC diagnostic pop");
2932#define Q_NOWARN_UNREACHABLE_PUSH
2933#define Q_NOWARN_UNREACHABLE_POP
2934
2935#elif defined(_MSC_VER)
2936
2937#define Q_NOWARN_DEPRECATED_PUSH \
2938 __pragma(warning(push)) \
2939 __pragma(warning(disable:4996))
2940#define Q_NOWARN_DEPRECATED_POP \
2941 __pragma(warning(pop))
2942#define Q_NOWARN_UNREACHABLE_PUSH \
2943 __pragma(warning(push)) \
2944 __pragma(warning(disable:4702))
2945#define Q_NOWARN_UNREACHABLE_POP \
2946 __pragma(warning(pop))
2947
2948#else
2949
2950#define Q_NOWARN_DEPRECATED_PUSH
2951#define Q_NOWARN_DEPRECATED_POP
2952#define Q_NOWARN_UNREACHABLE_PUSH
2953#define Q_NOWARN_UNREACHABLE_POP
2954
2955#endif
2956#endif
2957
2958#ifndef QGISEXTERN
2959#ifdef Q_OS_WIN
2960# define QGISEXTERN extern "C" __declspec( dllexport )
2961#else
2962# if defined(__GNUC__) || defined(__clang__)
2963# define QGISEXTERN extern "C" __attribute__ ((visibility ("default")))
2964# else
2965# define QGISEXTERN extern "C"
2966# endif
2967#endif
2968#endif
2969#endif
2970
2971#if __cplusplus >= 201500
2972#define FALLTHROUGH [[fallthrough]];
2973#elif defined(__clang__)
2974#define FALLTHROUGH [[clang::fallthrough]];
2975#elif defined(__GNUC__) && __GNUC__ >= 7
2976#define FALLTHROUGH [[gnu::fallthrough]];
2977#else
2978#define FALLTHROUGH
2979#endif
2980
2981// see https://infektor.net/posts/2017-01-19-using-cpp17-attributes-today.html#using-the-nodiscard-attribute
2982#if __cplusplus >= 201703L
2983#define NODISCARD [[nodiscard]]
2984#elif defined(__clang__)
2985#define NODISCARD [[nodiscard]]
2986#elif defined(_MSC_VER)
2987#define NODISCARD // no support
2988#elif defined(__has_cpp_attribute)
2989#if __has_cpp_attribute(nodiscard)
2990#define NODISCARD [[nodiscard]]
2991#elif __has_cpp_attribute(gnu::warn_unused_result)
2992#define NODISCARD [[gnu::warn_unused_result]]
2993#else
2994#define NODISCARD Q_REQUIRED_RESULT
2995#endif
2996#else
2997#define NODISCARD Q_REQUIRED_RESULT
2998#endif
2999
3000#if __cplusplus >= 201703L
3001#define MAYBE_UNUSED [[maybe_unused]]
3002#elif defined(__clang__)
3003#define MAYBE_UNUSED [[maybe_unused]]
3004#elif defined(_MSC_VER)
3005#define MAYBE_UNUSED // no support
3006#elif defined(__has_cpp_attribute)
3007#if __has_cpp_attribute(gnu::unused)
3008#define MAYBE_UNUSED [[gnu::unused]]
3009#else
3010#define MAYBE_UNUSED
3011#endif
3012#else
3013#define MAYBE_UNUSED
3014#endif
3015
3016#ifndef FINAL
3017#define FINAL final
3018#endif
3019
3020#ifndef SIP_RUN
3021#ifdef _MSC_VER
3022#define BUILTIN_UNREACHABLE \
3023 __assume(false);
3024#elif defined(__GNUC__) && !defined(__clang__)
3025// Workaround a GCC bug where a -Wreturn-type warning is emitted in constructs
3026// like:
3027// switch( mVariableThatCanOnlyBeXorY )
3028// {
3029// case X:
3030// return "foo";
3031// case Y:
3032// return "foo";
3033// }
3034// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
3035#define BUILTIN_UNREACHABLE \
3036 __builtin_unreachable();
3037#else
3038#define BUILTIN_UNREACHABLE
3039#endif
3040#endif // SIP_RUN
3041
3042#ifdef SIP_RUN
3043
3048QString CORE_EXPORT geoWkt();
3049
3051QString CORE_EXPORT geoProj4();
3052
3054QString CORE_EXPORT geoEpsgCrsAuthId();
3055
3057QString CORE_EXPORT geoNone();
3058
3059#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:1926
GpsQualityIndicator
GPS signal quality indicator.
Definition: qgis.h:867
ProjectReadFlag
Flags which control project read behavior.
Definition: qgis.h:1997
PointCloudSymbol
Rendering symbols for point cloud points.
Definition: qgis.h:1941
GeometryValidityFlag
Geometry validity check flags.
Definition: qgis.h:963
MapLayerProperty
File operation flags.
Definition: qgis.h:1054
BufferSide
Side of line to buffer.
Definition: qgis.h:988
RasterResamplingStage
Stage at which raster resampling occurs.
Definition: qgis.h:721
AltitudeClamping
Altitude clamping.
Definition: qgis.h:1810
VectorTemporalMode
Vector layer temporal feature modes.
Definition: qgis.h:1200
SublayerFlag
Sublayer query flags.
Definition: qgis.h:690
DashPatternSizeAdjustment
Dash pattern size adjustment options.
Definition: qgis.h:1599
AnnotationItemNodeType
Annotation item GUI flags.
Definition: qgis.h:1176
static const char * QGIS_DEV_VERSION
The development version.
Definition: qgis.h:98
AngularDirection
Angular directions.
Definition: qgis.h:1688
DriveType
Drive types.
Definition: qgis.h:506
ContentStatus
Status for fetched or stored content.
Definition: qgis.h:852
SnappingType
SnappingTypeFlag defines on what object the snapping is performed.
Definition: qgis.h:273
RelationshipStrength
Relationship strength.
Definition: qgis.h:2097
MarkerLinePlacement
Defines how/where the symbols should be placed on a line.
Definition: qgis.h:1464
GeometryOperationResult
Success or failure of a geometry operation.
Definition: qgis.h:935
BrowserItemState
Browser item states.
Definition: qgis.h:368
MarkerClipMode
Marker clipping modes.
Definition: qgis.h:1557
AnnotationItemFlag
Flags for annotation items.
Definition: qgis.h:1148
RenderSubcomponentProperty
Rendering subcomponent properties.
Definition: qgis.h:1396
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:1571
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:1486
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:1269
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:1530
ScaleMethod
Scale methods.
Definition: qgis.h:220
FilePathType
File path types.
Definition: qgis.h:752
PointCountMethod
Methods which define the number of points randomly filling a polygon.
Definition: qgis.h:1545
VertexType
Types of vertex.
Definition: qgis.h:1409
DataProviderFlag
Map layer properties.
Definition: qgis.h:1069
GeometryValidationEngine
Available engines for validating geometries.
Definition: qgis.h:976
TransactionMode
Transaction mode.
Definition: qgis.h:1797
Q_ENUM(ScaleToTileZoomLevelMethod)
ViewSyncModeFlag
Synchronization of 2D map canvas and 3D view.
Definition: qgis.h:1713
FileOperationFlag
File operation flags.
Definition: qgis.h:1039
ProjectCapability
Flags which control project capabilities.
Definition: qgis.h:2026
Q_ENUM(VectorProfileType)
FieldDomainMergePolicy
Merge policy for field domains.
Definition: qgis.h:1771
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:1614
MeshEditingErrorType
Type of error that can occur during mesh frame editing.
Definition: qgis.h:735
FieldDomainSplitPolicy
Split policy for field domains.
Definition: qgis.h:1755
ArcGisRestServiceType
Available ArcGIS REST service types.
Definition: qgis.h:2064
AnnotationItemEditOperationResult
Results from an edit operation on an annotation item.
Definition: qgis.h:1187
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:1968
MarkerShape
Marker shapes.
Definition: qgis.h:1423
Capitalization
String capitalization options.
Definition: qgis.h:1645
TemporalIntervalMatchMethod
Method to use when resolving a temporal range to a data provider layer or band.
Definition: qgis.h:1254
LabelQuadrantPosition
Label quadrant positions.
Definition: qgis.h:622
ScaleToTileZoomLevelMethod
Available methods for converting map scales to tile zoom levels.
Definition: qgis.h:1676
SublayerQueryFlag
Flags which control how data providers will scan for sublayers in a dataset.
Definition: qgis.h:673
PythonMacroMode
Vector layer type flags.
Definition: qgis.h:180
UnplacedLabelVisibility
Unplaced label visibility.
Definition: qgis.h:534
CrsDefinitionFormat
CRS definition formats.
Definition: qgis.h:1740
SpatialFilterType
Feature request spatial filter types.
Definition: qgis.h:1026
ProjectFlag
Flags which control the behavior of QgsProjects.
Definition: qgis.h:1861
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:1241
RelationshipType
Relationship types.
Definition: qgis.h:2083
JoinStyle
Join styles for buffers.
Definition: qgis.h:1013
PointCloudDrawOrder
Pointcloud rendering order for 2d views.
Definition: qgis.h:1953
DpiMode
DpiMode enum.
Definition: qgis.h:1625
BrowserLayerType
Browser item layer types.
Definition: qgis.h:403
AltitudeBinding
Altitude binding.
Definition: qgis.h:1823
LabelMultiLineAlignment
Text alignment for multi-line labels.
Definition: qgis.h:658
VectorDataProviderTemporalMode
Vector data provider temporal handling modes.
Definition: qgis.h:1228
TextRenderFormat
Options for rendering text.
Definition: qgis.h:1384
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:1877
CoordinateOrder
Order of coordinates.
Definition: qgis.h:1135
SelectionFlag
Flags which control feature selection behavior.
Definition: qgis.h:804
EndCapStyle
End cap styles for buffers.
Definition: qgis.h:1000
BabelCommandFlag
Babel GPS format capabilities.
Definition: qgis.h:906
FieldDomainType
Types of field domain.
Definition: qgis.h:1784
RenderContextFlag
Flags which affect rendering operations.
Definition: qgis.h:1350
RasterPipeInterfaceRole
Sublayer flags.
Definition: qgis.h:704
SymbolPreviewFlag
Symbol flags.
Definition: qgis.h:321
AnnotationItemGuiFlag
Annotation item flags.
Definition: qgis.h:1162
MapBoxGlStyleSourceType
Flags which control project capabilities.
Definition: qgis.h:2045
DashPatternLineEndingRule
Dash pattern line ending rules.
Definition: qgis.h:1584
VertexMarkerType
Editing vertex markers, used for showing vertices during a edit operation.
Definition: qgis.h:840
HistoryProviderBackend
History provider backends.
Definition: qgis.h:1726
SublayerPromptMode
Specifies how to handle layer sources with multiple sublayers.
Definition: qgis.h:764
RelationshipCardinality
Relationship cardinality.
Definition: qgis.h:2109
GradientType
Gradient types.
Definition: qgis.h:1500
VectorProfileType
Types of elevation profiles to generate for vector sources.
Definition: qgis.h:1914
GpsFeatureType
Babel command flags.
Definition: qgis.h:920
VectorLayerTypeFlag
Vector layer type flags.
Definition: qgis.h:167
VectorTemporalLimitMode
Mode for the handling of the limits of the filtering timeframe for vector features.
Definition: qgis.h:1216
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:825
Q_DECLARE_FLAGS(GeometryValidityFlags, GeometryValidityFlag) SIP_MONKEYPATCH_FLAGS_UNNEST(QgsGeometry
Geometry validity flags.
ProjectFileFormat
Flags which control project read behavior.
Definition: qgis.h:1983
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:1902
RendererUsage
Usage of the renderer.
Definition: qgis.h:1700
BabelFormatCapability
Babel GPS format capabilities.
Definition: qgis.h:887
BetweenLineConstraint
Between line constraints which can be enabled.
Definition: qgis.h:1835
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:1848
HttpMethod
Different methods of HTTP requests.
Definition: qgis.h:438
SymbolCoordinateReference
Symbol coordinate reference modes.
Definition: qgis.h:1515
TextRendererFlag
Flags which control the behavior of rendering text.
Definition: qgis.h:1663
SelectGeometryRelationship
Geometry relationship test to apply for selecting features.
Definition: qgis.h:792
CrsAxisDirection
Data provider flags.
Definition: qgis.h:1085
LabelOverlapHandling
Label overlap handling.
Definition: qgis.h:546
CoordinateTransformationFlag
Flags which adjust the coordinate transformations behave.
Definition: qgis.h:1300
TransformDirection
Flags for raster layer temporal capabilities.
Definition: qgis.h:1288
LightSourceType
Light source types for 3D scenes.
Definition: qgis.h:1890
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:1320
SelectBehavior
Specifies how a selection should be applied.
Definition: qgis.h:778
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:125
Item that represents a layer that can be opened with one of the providers.
Definition: qgslayeritem.h:30
Base class for all map layer types.
Definition: qgsmaplayer.h:73
The QgsMapSettings class contains configuration for rendering of the map.
Registry for temporary fetched files.
Contains settings for how a map layer will be labeled.
Abstract base class for 2d point cloud renderers.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition: qgsproject.h:104
A fill symbol layer which places markers at random locations within polygons.
Implementation of data provider temporal properties for QgsRasterDataProviders.
Implementation of map layer temporal properties for raster layers.
Contains a pipeline of raster interfaces for sequential raster processing.
Definition: qgsrasterpipe.h:50
Contains information about the context of a rendering operation.
Represent settings entry and provides methods for reading and writing settings values.
RAII signal blocking class.
Definition: qgis.h:2281
Object * operator->()
Returns pointer to blocked QObject.
Definition: qgis.h:2299
~QgsSignalBlocker()
Definition: qgis.h:2293
QgsSignalBlocker(Object *object)
Constructor for QgsSignalBlocker.
Definition: qgis.h:2288
Abstract base class for simple marker symbol layers.
This is a container for configuration of the snapping of the project.
Utility functions for working with strings.
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:93
Base class for templated line symbols, e.g.
This is the class is providing tolerance value in map unit values.
Definition: qgstolerance.h:33
Implementation of data provider temporal properties for QgsVectorDataProviders.
This is the base class for vector data providers.
A convenience class for exporting vector layers to a destination data provider.
Implementation of map layer temporal properties for vector layers.
Represents a vector layer which manages a vector based data sets.
FeatureCountState
Enumeration of feature count states.
Definition: qgis.h:195
QgsMapLayerType
Types of layers that can be added to a map.
Definition: qgis.h:47
@ PointCloudLayer
Point cloud layer. Added in QGIS 3.18.
@ MeshLayer
Mesh layer. Added in QGIS 3.2.
@ VectorLayer
Vector layer.
@ RasterLayer
Raster layer.
@ GroupLayer
Composite group layer. Added in QGIS 3.24.
@ VectorTileLayer
Vector tile layer. Added in QGIS 3.14.
@ AnnotationLayer
Contains freeform, georeferenced annotations. Added in QGIS 3.16.
@ PluginLayer
Plugin based layer.
int significantDigits(const Qgis::DataType rasterDataType)
Returns the maximum number of significant digits a for the given rasterDataType.
As part of the API refactoring and improvements which landed in QGIS
#define str(x)
Definition: qgis.cpp:37
CONSTLATIN1STRING geoNone()
Constant that holds the string representation for "No ellips/No CRS".
Definition: qgis.h:2869
const double DEFAULT_LINE_WIDTH
Definition: qgis.h:2907
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:2761
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:2590
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
Definition: qgis.h:2335
QString qgsEnumValueToKey(const T &value, bool *returnOk=nullptr)
Returns the value for the given key of an enum.
Definition: qgis.h:2571
QString qgsFlagValueToKeys(const T &value, bool *returnOk=nullptr)
Returns the value for the given keys of a flag.
Definition: qgis.h:2629
const long GEO_EPSG_CRS_ID
Magic number for a geographic coord sys in EpsgCrsId ID format.
Definition: qgis.h:2893
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:2651
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:2922
const QMap< T, QString > qgsEnumMap()
Returns a map of all enum entries.
Definition: qgis.h:2554
bool qgsFloatNear(float a, float b, float epsilon=4 *FLT_EPSILON)
Compare two floats (but allow some difference)
Definition: qgis.h:2413
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:2537
double qgsRound(double number, int places)
Returns a double number, rounded (as close as possible) to the specified number of places.
Definition: qgis.h:2450
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
Definition: qgis.h:2396
CONSTLATIN1STRING geoProj4()
PROJ4 string that represents a geographic coord sys.
Definition: qgis.h:2857
bool qgsNanCompatibleEquals(double a, double b)
Compare two doubles, treating nan values as equal.
Definition: qgis.h:2380
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition: qgis.h:2322
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:2910
QMap< QString, QString > QgsStringMap
Definition: qgis.h:2912
#define CONSTLATIN1STRING
Definition: qgis.h:2810
CONSTLATIN1STRING geoWkt()
Wkt string that represents a geographic coord sys.
Definition: qgis.h:2849
bool qgsDoubleNearSig(double a, double b, int significantDigits=10)
Compare two doubles using specified number of significant digits.
Definition: qgis.h:2425
const int USER_CRS_START_ID
Magick number that determines whether a projection crsid is a system (srs.db) or user (~/....
Definition: qgis.h:2899
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:2887
#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:2775
CONSTLATIN1STRING geoEpsgCrsAuthId()
Geographic coord sys from EPSG authority.
Definition: qgis.h:2863
const long GEOCRS_ID
Magic number for a geographic coord sys in QGIS srs.db tbl_srs.srs_id.
Definition: qgis.h:2890
const double DEFAULT_POINT_SIZE
Magic number that determines the default point size for point symbols.
Definition: qgis.h:2906
#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