QGIS API Documentation 3.29.0-Master (8c80f25a4f)
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
755 {
756 Generic = 0,
757 PixelCount = 1,
758 Name = 2,
759 Min = 3,
760 Max = 4,
761 MinMax = 5,
762 Red = 6,
763 Green = 7,
764 Blue = 8,
765 Alpha = 9,
766 RedMin = 10,
767 GreenMin = 11,
768 BlueMin = 12,
769 AlphaMin = 13,
770 RedMax = 14,
771 GreenMax = 15,
772 BlueMax = 16,
773 AlphaMax = 17,
774 MaxCount
775 };
776 Q_ENUM( RasterAttributeTableFieldUsage )
777
778
784 {
785 Thematic = 0,
786 Athematic = 1
787 };
788 Q_ENUM( RasterAttributeTableType )
789
790
795 enum class MeshEditingErrorType : int
796 {
797 NoError,
798 InvalidFace,
799 TooManyVerticesInFace,
800 FlatFace,
801 UniqueSharedVertex,
802 InvalidVertex,
803 ManifoldFace,
804 };
805 Q_ENUM( MeshEditingErrorType )
806
807
812 enum class FilePathType : int
813 {
814 Absolute,
815 Relative,
816 };
817 Q_ENUM( FilePathType )
818
819
824 enum class SublayerPromptMode : int
825 {
826 AlwaysAsk,
827 AskExcludingRasterBands,
828 NeverAskSkip,
829 NeverAskLoadAll,
830 };
831 Q_ENUM( SublayerPromptMode )
832
833
839 {
840 SetSelection,
841 AddToSelection,
842 IntersectSelection,
843 RemoveFromSelection,
844 };
845 Q_ENUM( SelectBehavior )
846
847
853 {
854 Intersect,
855 Within,
856 };
857 Q_ENUM( SelectGeometryRelationship )
858
859
864 enum class SelectionFlag : int
865 {
866 SingleFeatureSelection = 1 << 0,
867 ToggleSelection = 1 << 1,
868 };
869
875 Q_DECLARE_FLAGS( SelectionFlags, SelectionFlag )
876
877 Q_ENUM( SelectionFlag )
878 Q_FLAG( SelectionFlags )
879
880
886 {
887 Success = 0,
888 EmptyGeometry = 1,
889 EditFailed = 2,
890 FetchFeatureFailed = 3,
891 InvalidLayer = 4,
892 };
893 Q_ENUM( VectorEditResult )
894
895
901 {
902 SemiTransparentCircle,
903 Cross,
904 NoMarker,
905 };
906 Q_ENUM( VertexMarkerType )
907
908
912 enum class ContentStatus : int
913 {
914 NotStarted,
915 Running,
916 Finished,
917 Failed,
918 Canceled,
919 };
920 Q_ENUM( ContentStatus )
921
922
927 enum class GpsConnectionType : int
928 {
929 Automatic,
930 Internal,
931 Serial,
932 Gpsd,
933 };
934 Q_ENUM( GpsConnectionType )
935
936
941 enum class GpsConnectionStatus : int
942 {
943 Disconnected,
944 Connecting,
945 Connected,
946 };
947 Q_ENUM( GpsConnectionStatus )
948
949
957 {
958 NoData,
959 NoFix,
960 Fix2D,
961 Fix3D
962 };
964
965
972 {
973 Unknown,
974 Gps,
975 Glonass,
976 Galileo,
977 BeiDou,
978 Qzss,
979 Navic,
980 Sbas,
981 };
983
990 {
991 Unknown = -1,
992 Invalid,
993 GPS,
994 DGPS,
995 PPS,
996 RTK,
997 FloatRTK,
998 Estimated,
999 Manual,
1000 Simulation,
1001 };
1002 Q_ENUM( GpsQualityIndicator )
1003
1004
1010 {
1011 Location = 1 << 0,
1012 Altitude = 1 << 1,
1013 GroundSpeed = 1 << 2,
1014 Bearing = 1 << 3,
1015 TotalTrackLength = 1 << 4,
1016 TrackDistanceFromStart = 1 << 5,
1017 Pdop = 1 << 6,
1018 Hdop = 1 << 7,
1019 Vdop = 1 << 8,
1020 HorizontalAccuracy = 1 << 9,
1021 VerticalAccuracy = 1 << 10,
1022 HvAccuracy = 1 << 11,
1023 SatellitesUsed = 1 << 12,
1024 Timestamp = 1 << 13,
1025 TrackStartTime = 1 << 14,
1026 TrackEndTime = 1 << 15,
1027 TrackDistanceSinceLastPoint = 1 << 16,
1028 TrackTimeSinceLastPoint = 1 << 17,
1029 GeoidalSeparation = 1 << 18,
1030 EllipsoidAltitude = 1 << 19,
1031 };
1032
1038 Q_DECLARE_FLAGS( GpsInformationComponents, GpsInformationComponent )
1039 Q_ENUM( GpsInformationComponent )
1040 Q_FLAG( GpsInformationComponents )
1041
1042
1047 enum class BabelFormatCapability : int
1048 {
1049 Import = 1 << 0,
1050 Export = 1 << 1,
1051 Waypoints = 1 << 2,
1052 Routes = 1 << 3,
1053 Tracks = 1 << 4,
1054 };
1056 Q_DECLARE_FLAGS( BabelFormatCapabilities, BabelFormatCapability )
1057 Q_ENUM( BabelFormatCapability )
1058 Q_FLAG( BabelFormatCapabilities )
1059
1060
1066 enum class BabelCommandFlag : int
1067 {
1068 QuoteFilePaths = 1 << 0,
1069 };
1071 Q_DECLARE_FLAGS( BabelCommandFlags, BabelCommandFlag )
1072 Q_ENUM( BabelCommandFlag )
1073 Q_FLAG( BabelCommandFlags )
1074
1075
1080 enum class GpsFeatureType : int
1081 {
1082 Waypoint,
1083 Route,
1084 Track,
1085 };
1086 Q_ENUM( GpsFeatureType )
1087
1088
1096 {
1097 Success = 0,
1098 NothingHappened = 1000,
1099 InvalidBaseGeometry,
1100 InvalidInputGeometryType,
1101 SelectionIsEmpty,
1102 SelectionIsGreaterThanOne,
1103 GeometryEngineError,
1104 LayerNotEditable,
1105 /* Add part issues */
1106 AddPartSelectedGeometryNotFound,
1107 AddPartNotMultiGeometry,
1108 /* Add ring issues*/
1109 AddRingNotClosed,
1110 AddRingNotValid,
1111 AddRingCrossesExistingRings,
1112 AddRingNotInExistingFeature,
1113 /* Split features */
1114 SplitCannotSplitPoint,
1115 };
1116 Q_ENUM( GeometryOperationResult )
1117
1118
1124 {
1125 AllowSelfTouchingHoles SIP_MONKEYPATCH_COMPAT_NAME( FlagAllowSelfTouchingHoles ) = 1 << 0,
1126 };
1129 Q_ENUM( GeometryValidityFlag )
1130 Q_FLAG( GeometryValidityFlags )
1131
1132
1137 {
1138 QgisInternal SIP_MONKEYPATCH_COMPAT_NAME( ValidatorQgisInternal ),
1139 Geos SIP_MONKEYPATCH_COMPAT_NAME( ValidatorGeos ),
1140 };
1141 Q_ENUM( GeometryValidationEngine )
1142
1143
1149 {
1150 Left SIP_MONKEYPATCH_COMPAT_NAME( SideLeft ) = 0,
1151 Right SIP_MONKEYPATCH_COMPAT_NAME( SideRight ),
1152 };
1153 Q_ENUM( BufferSide )
1154
1155
1161 {
1162 Round SIP_MONKEYPATCH_COMPAT_NAME( CapRound ) = 1,
1163 Flat SIP_MONKEYPATCH_COMPAT_NAME( CapFlat ),
1164 Square SIP_MONKEYPATCH_COMPAT_NAME( CapSquare ),
1165 };
1166 Q_ENUM( EndCapStyle )
1167
1168
1174 {
1175 Round SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleRound ) = 1,
1176 Miter SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleMiter ),
1177 Bevel SIP_MONKEYPATCH_COMPAT_NAME( JoinStyleBevel ),
1178 };
1179 Q_ENUM( JoinStyle )
1180
1181
1186 enum class MakeValidMethod : int
1187 {
1188 Linework = 0,
1189 Structure = 1,
1190 };
1191 Q_ENUM( MakeValidMethod )
1192
1193
1198 enum class SpatialFilterType : int
1199 {
1200 NoFilter,
1201 BoundingBox,
1202 DistanceWithin,
1203 };
1204 Q_ENUM( SpatialFilterType )
1205
1206
1211 enum class FileOperationFlag : int
1212 {
1213 IncludeMetadataFile = 1 << 0,
1214 IncludeStyleFile = 1 << 1,
1215 };
1217 Q_DECLARE_FLAGS( FileOperationFlags, FileOperationFlag )
1218 Q_ENUM( FileOperationFlag )
1219 Q_FLAG( FileOperationFlags )
1220
1221
1226 enum class MapLayerProperty : int
1227 {
1228 UsersCannotToggleEditing = 1 << 0,
1229 IsBasemapLayer = 1 << 1,
1230 };
1232 Q_DECLARE_FLAGS( MapLayerProperties, MapLayerProperty )
1233 Q_ENUM( MapLayerProperty )
1234 Q_FLAG( MapLayerProperties )
1235
1236
1241 enum class DataProviderFlag : int
1242 {
1243 IsBasemapSource = 1 << 1,
1244 };
1246 Q_DECLARE_FLAGS( DataProviderFlags, DataProviderFlag )
1247 Q_ENUM( DataProviderFlag )
1248 Q_FLAG( DataProviderFlags )
1249
1250
1257 enum class CrsAxisDirection : int
1258 {
1259 North,
1260 NorthNorthEast,
1261 NorthEast,
1262 EastNorthEast,
1263 East,
1264 EastSouthEast,
1265 SouthEast,
1266 SouthSouthEast,
1267 South,
1268 SouthSouthWest,
1269 SouthWest,
1270 WestSouthWest,
1271 West,
1272 WestNorthWest,
1273 NorthWest,
1274 NorthNorthWest,
1275 GeocentricX,
1276 GeocentricY,
1277 GeocentricZ,
1278 Up,
1279 Down,
1280 Forward,
1281 Aft,
1282 Port,
1283 Starboard,
1284 Clockwise,
1285 CounterClockwise,
1286 ColumnPositive,
1287 ColumnNegative,
1288 RowPositive,
1289 RowNegative,
1290 DisplayRight,
1291 DisplayLeft,
1292 DisplayUp,
1293 DisplayDown,
1294 Future,
1295 Past,
1296 Towards,
1297 AwayFrom,
1298 Unspecified,
1299 };
1300 Q_ENUM( CrsAxisDirection )
1301
1302
1307 enum class CoordinateOrder : int
1308 {
1309 Default,
1310 XY,
1311 YX,
1312 };
1313 Q_ENUM( CoordinateOrder )
1314
1315
1320 enum class AnnotationItemFlag : int
1321 {
1322 ScaleDependentBoundingBox = 1 << 0,
1323 };
1325 Q_DECLARE_FLAGS( AnnotationItemFlags, AnnotationItemFlag )
1326 Q_ENUM( AnnotationItemFlag )
1327 Q_FLAG( AnnotationItemFlags )
1328
1329
1334 enum class AnnotationItemGuiFlag : int
1335 {
1336 FlagNoCreationTools = 1 << 0,
1337 };
1339 Q_DECLARE_FLAGS( AnnotationItemGuiFlags, AnnotationItemGuiFlag )
1340 Q_ENUM( AnnotationItemGuiFlag )
1341 Q_FLAG( AnnotationItemGuiFlags )
1342
1343
1348 enum class AnnotationItemNodeType : int
1349 {
1350 VertexHandle,
1351 };
1352 Q_ENUM( AnnotationItemNodeType )
1353
1354
1360 {
1361 Success,
1362 Invalid,
1363 ItemCleared,
1364 };
1365 Q_ENUM( AnnotationItemEditOperationResult )
1366
1367
1373 {
1374 FixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ModeFixedTemporalRange ) = 0,
1375 FeatureDateTimeInstantFromField SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeInstantFromField ),
1376 FeatureDateTimeStartAndEndFromFields SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndEndFromFields ),
1377 FeatureDateTimeStartAndDurationFromFields SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndDurationFromFields ),
1378 FeatureDateTimeStartAndEndFromExpressions SIP_MONKEYPATCH_COMPAT_NAME( ModeFeatureDateTimeStartAndEndFromExpressions ),
1379 RedrawLayerOnly SIP_MONKEYPATCH_COMPAT_NAME( ModeRedrawLayerOnly ),
1380 };
1381 Q_ENUM( VectorTemporalMode )
1382
1383
1389 {
1390 IncludeBeginExcludeEnd = 0,
1391 IncludeBeginIncludeEnd,
1392 };
1393 Q_ENUM( VectorTemporalLimitMode )
1394
1395
1401 {
1402 HasFixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ProviderHasFixedTemporalRange ) = 0,
1403 StoresFeatureDateTimeInstantInField SIP_MONKEYPATCH_COMPAT_NAME( ProviderStoresFeatureDateTimeInstantInField ),
1404 StoresFeatureDateTimeStartAndEndInSeparateFields SIP_MONKEYPATCH_COMPAT_NAME( ProviderStoresFeatureDateTimeStartAndEndInSeparateFields ),
1405 };
1406 Q_ENUM( VectorDataProviderTemporalMode )
1407
1408
1414 {
1415 FixedTemporalRange SIP_MONKEYPATCH_COMPAT_NAME( ModeFixedTemporalRange ) = 0,
1416 TemporalRangeFromDataProvider SIP_MONKEYPATCH_COMPAT_NAME( ModeTemporalRangeFromDataProvider ) = 1,
1417 RedrawLayerOnly SIP_MONKEYPATCH_COMPAT_NAME( ModeRedrawLayerOnly ) = 2,
1418 };
1419 Q_ENUM( RasterTemporalMode )
1420
1421
1427 {
1428 MatchUsingWholeRange,
1429 MatchExactUsingStartOfRange,
1430 MatchExactUsingEndOfRange,
1431 FindClosestMatchToStartOfRange,
1432 FindClosestMatchToEndOfRange
1433 };
1434 Q_ENUM( TemporalIntervalMatchMethod )
1435
1436
1442 {
1443 RequestedTimesMustExactlyMatchAllAvailableTemporalRanges = 1 << 0,
1444 };
1445 Q_ENUM( RasterTemporalCapabilityFlag )
1446
1447
1452 Q_DECLARE_FLAGS( RasterTemporalCapabilityFlags, RasterTemporalCapabilityFlag )
1453 Q_ENUM( RasterTemporalCapabilityFlags )
1454
1455
1461 {
1462 Forward SIP_MONKEYPATCH_COMPAT_NAME( ForwardTransform ),
1463 Reverse SIP_MONKEYPATCH_COMPAT_NAME( ReverseTransform )
1464 };
1465 Q_ENUM( TransformDirection )
1466
1467
1473 {
1474 BallparkTransformsAreAppropriate = 1 << 0,
1475 IgnoreImpossibleTransformations = 1 << 1,
1476 };
1477 Q_ENUM( CoordinateTransformationFlag )
1478
1479
1484 Q_DECLARE_FLAGS( CoordinateTransformationFlags, CoordinateTransformationFlag )
1485 Q_ENUM( CoordinateTransformationFlags )
1486
1487
1493 {
1494 Antialiasing = 0x01,
1495 DrawEditingInfo = 0x02,
1496 ForceVectorOutput = 0x04,
1497 UseAdvancedEffects = 0x08,
1498 DrawLabeling = 0x10,
1499 UseRenderingOptimization = 0x20,
1500 DrawSelection = 0x40,
1501 DrawSymbolBounds = 0x80,
1502 RenderMapTile = 0x100,
1503 RenderPartialOutput = 0x200,
1504 RenderPreviewJob = 0x400,
1505 RenderBlocking = 0x800,
1506 LosslessImageRendering = 0x1000,
1507 Render3DMap = 0x2000,
1508 HighQualityImageTransforms = 0x4000,
1509 SkipSymbolRendering = 0x8000,
1510 ForceRasterMasks = 0x10000,
1511 };
1514 Q_ENUM( MapSettingsFlag )
1515 Q_FLAG( MapSettingsFlags )
1516
1517
1523 {
1524 DrawEditingInfo = 0x01,
1525 ForceVectorOutput = 0x02,
1526 UseAdvancedEffects = 0x04,
1527 UseRenderingOptimization = 0x08,
1528 DrawSelection = 0x10,
1529 DrawSymbolBounds = 0x20,
1530 RenderMapTile = 0x40,
1531 Antialiasing = 0x80,
1532 RenderPartialOutput = 0x100,
1533 RenderPreviewJob = 0x200,
1534 RenderBlocking = 0x400,
1535 RenderSymbolPreview = 0x800,
1536 LosslessImageRendering = 0x1000,
1537 ApplyScalingWorkaroundForTextRendering = 0x2000,
1538 Render3DMap = 0x4000,
1539 ApplyClipAfterReprojection = 0x8000,
1540 RenderingSubSymbol = 0x10000,
1541 HighQualityImageTransforms = 0x20000,
1542 SkipSymbolRendering = 0x40000,
1543 };
1546 Q_ENUM( RenderContextFlag )
1547 Q_FLAG( RenderContextFlags )
1548
1549 // refs for below dox: https://github.com/qgis/QGIS/pull/1286#issuecomment-39806854
1550 // https://github.com/qgis/QGIS/pull/8573#issuecomment-445585826
1551
1552
1557 {
1558 AlwaysOutlines SIP_MONKEYPATCH_COMPAT_NAME( TextFormatAlwaysOutlines ),
1559 AlwaysText SIP_MONKEYPATCH_COMPAT_NAME( TextFormatAlwaysText ),
1560 };
1561 Q_ENUM( TextRenderFormat )
1562
1563
1571 {
1572 UseAllLabels = 1 << 1,
1573 UsePartialCandidates = 1 << 2,
1574 // TODO QGIS 4.0: remove
1575 RenderOutlineLabels = 1 << 3,
1576 DrawLabelRectOnly = 1 << 4,
1577 DrawCandidates = 1 << 5,
1578 DrawUnplacedLabels = 1 << 6,
1579 CollectUnplacedLabels = 1 << 7,
1580 DrawLabelMetrics = 1 << 8,
1581 };
1582 Q_ENUM( LabelingFlag )
1583
1584
1591 Q_DECLARE_FLAGS( LabelingFlags, LabelingFlag ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsLabelingEngineSettings, Flags )
1592 Q_FLAG( LabelingFlags )
1593
1602 {
1603 Version1 SIP_MONKEYPATCH_COMPAT_NAME( PlacementEngineVersion1 ),
1604 Version2 SIP_MONKEYPATCH_COMPAT_NAME( PlacementEngineVersion2 ),
1605 };
1606 Q_ENUM( LabelPlacementEngineVersion )
1607
1608
1616 {
1617 Horizontal SIP_MONKEYPATCH_COMPAT_NAME( HorizontalOrientation ),
1618 Vertical SIP_MONKEYPATCH_COMPAT_NAME( VerticalOrientation ),
1619 RotationBased SIP_MONKEYPATCH_COMPAT_NAME( RotationBasedOrientation ),
1620 };
1621 Q_ENUM( TextOrientation )
1622
1623
1631 {
1632 Rectangle SIP_MONKEYPATCH_COMPAT_NAME( Rect ),
1633 Point,
1634 Labeling SIP_MONKEYPATCH_COMPAT_NAME( Label ),
1635 RectangleCapHeightBased,
1636 RectangleAscentBased,
1637 };
1638 Q_ENUM( TextLayoutMode )
1639
1640
1648 {
1649 Text,
1650 Buffer,
1651 Background,
1652 Shadow,
1653 };
1654 Q_ENUM( TextComponent )
1655
1656
1664 {
1665 Left SIP_MONKEYPATCH_COMPAT_NAME( AlignLeft ),
1666 Center SIP_MONKEYPATCH_COMPAT_NAME( AlignCenter ),
1667 Right SIP_MONKEYPATCH_COMPAT_NAME( AlignRight ),
1668 Justify SIP_MONKEYPATCH_COMPAT_NAME( AlignJustify ),
1669 };
1670 Q_ENUM( TextHorizontalAlignment )
1671
1672
1683 {
1684 Top SIP_MONKEYPATCH_COMPAT_NAME( AlignTop ),
1685 VerticalCenter SIP_MONKEYPATCH_COMPAT_NAME( AlignVCenter ),
1686 Bottom SIP_MONKEYPATCH_COMPAT_NAME( AlignBottom ),
1687 };
1688 Q_ENUM( TextVerticalAlignment )
1689
1690
1699 {
1700 Normal,
1701 SuperScript,
1702 SubScript,
1703 };
1704 Q_ENUM( TextCharacterVerticalAlignment )
1705
1706
1712 {
1713 Generic,
1714 ShadowOffset,
1715 BlurSize,
1716 GlowSpread,
1717 };
1718 Q_ENUM( RenderSubcomponentProperty )
1719
1720
1725 {
1726 Segment SIP_MONKEYPATCH_COMPAT_NAME( SegmentVertex ) = 1,
1727 Curve SIP_MONKEYPATCH_COMPAT_NAME( CurveVertex ) = 2,
1728 };
1729 Q_ENUM( VertexType )
1730
1731
1739 {
1740 Square,
1741 Diamond,
1742 Pentagon,
1743 Hexagon,
1744 Triangle,
1745 EquilateralTriangle,
1746 Star,
1747 Arrow,
1748 Circle,
1749 Cross,
1750 CrossFill,
1751 Cross2,
1752 Line,
1753 ArrowHead,
1754 ArrowHeadFilled,
1755 SemiCircle,
1756 ThirdCircle,
1757 QuarterCircle,
1758 QuarterSquare,
1759 HalfSquare,
1760 DiagonalHalfSquare,
1761 RightHalfTriangle,
1762 LeftHalfTriangle,
1763 Octagon,
1764 SquareWithCorners,
1765 AsteriskFill,
1766 HalfArc,
1767 ThirdArc,
1768 QuarterArc,
1769 ParallelogramRight,
1770 ParallelogramLeft,
1771 Trapezoid,
1772 Shield,
1773 DiamondStar,
1774 Heart,
1775 Decagon,
1776 RoundedSquare,
1777 };
1778 Q_ENUM( MarkerShape )
1779
1780
1788 {
1789 Interval = 1 << 0,
1790 Vertex = 1 << 1,
1791 LastVertex = 1 << 2,
1792 FirstVertex = 1 << 3,
1793 CentralPoint = 1 << 4,
1794 CurvePoint = 1 << 5,
1795 SegmentCenter = 1 << 6,
1796 InnerVertices = 1 << 7,
1797 };
1798 Q_ENUM( MarkerLinePlacement )
1799 Q_DECLARE_FLAGS( MarkerLinePlacements, MarkerLinePlacement )
1800 Q_FLAG( MarkerLinePlacements )
1801
1802
1810 {
1811 SimpleTwoColor,
1812 ColorRamp,
1813 };
1814 Q_ENUM( GradientColorSource )
1815
1816
1824 {
1825 Linear,
1826 Radial,
1827 Conical,
1828 };
1829 Q_ENUM( GradientType )
1830
1831
1839 {
1840 Feature,
1841 Viewport,
1842 };
1843 Q_ENUM( SymbolCoordinateReference )
1844
1845
1854 {
1855 Pad,
1856 Reflect,
1857 Repeat,
1858 };
1859 Q_ENUM( GradientSpread )
1860
1861
1869 {
1870 Absolute SIP_MONKEYPATCH_COMPAT_NAME( AbsoluteCount ),
1871 DensityBased SIP_MONKEYPATCH_COMPAT_NAME( DensityBasedCount ),
1872 };
1873 Q_ENUM( PointCountMethod )
1874
1875
1880 enum class MarkerClipMode : int
1881 {
1882 NoClipping,
1883 Shape,
1884 CentroidWithin,
1885 CompletelyWithin,
1886 };
1887 Q_ENUM( MarkerClipMode )
1888
1889
1894 enum class LineClipMode : int
1895 {
1896 ClipPainterOnly,
1897 ClipToIntersection,
1898 NoClipping,
1899 };
1900 Q_ENUM( LineClipMode )
1901
1902
1908 {
1909 NoRule,
1910 FullDash,
1911 HalfDash,
1912 FullGap,
1913 HalfGap,
1914 };
1915 Q_ENUM( DashPatternLineEndingRule )
1916
1917
1923 {
1924 ScaleBothDashAndGap,
1925 ScaleDashOnly,
1926 ScaleGapOnly,
1927 };
1928 Q_ENUM( DashPatternSizeAdjustment )
1929
1930
1938 {
1939 Color SIP_MONKEYPATCH_COMPAT_NAME( GraduatedColor ),
1940 Size SIP_MONKEYPATCH_COMPAT_NAME( GraduatedSize ),
1941 };
1942 Q_ENUM( GraduatedMethod )
1943
1944
1948 enum class DpiMode
1949 {
1950 All = 7,
1951 Off = 0,
1952 QGIS = 1,
1953 UMN = 2,
1954 GeoServer = 4,
1955 };
1956 Q_ENUM( DpiMode )
1957
1958
1963 {
1964 Undefined = 0,
1965 StandardDpi = 1,
1966 HighDpi = 2,
1967 };
1968 Q_ENUM( TilePixelRatio )
1969
1970 // NOTE -- the hardcoded numbers here must match QFont::Capitalization!
1971
1972
1980 {
1981 MixedCase = 0,
1982 AllUppercase = 1,
1983 AllLowercase = 2,
1984 ForceFirstLetterToCapital = 4,
1985 SmallCaps = 5,
1986 TitleCase = 1004,
1987 UpperCamelCase = 1005,
1988 AllSmallCaps = 1006,
1989 };
1990 Q_ENUM( Capitalization )
1991
1992
1997 enum class TextRendererFlag : int
1998 {
1999 WrapLines = 1 << 0,
2000 };
2001 Q_ENUM( TextRendererFlag )
2002 Q_DECLARE_FLAGS( TextRendererFlags, TextRendererFlag )
2003 Q_FLAG( TextRendererFlags )
2004
2005
2011 {
2012 MapBox,
2013 Esri,
2014 };
2016
2023 {
2024 Clockwise,
2025 CounterClockwise,
2026 };
2027 Q_ENUM( AngularDirection )
2028
2029
2034 enum class RendererUsage : int
2035 {
2036 View,
2037 Export,
2038 Unknown,
2039 };
2040 Q_ENUM( RendererUsage )
2041
2042
2047 enum class ViewSyncModeFlag : int
2048 {
2049 Sync3DTo2D = 1 << 0,
2050 Sync2DTo3D = 1 << 1,
2051 };
2052 Q_ENUM( ViewSyncModeFlag )
2053 Q_DECLARE_FLAGS( ViewSyncModeFlags, ViewSyncModeFlag )
2054
2055
2061 {
2062 Always,
2063 WhenOutsideVisibleExtent,
2064 Never,
2065 };
2066 Q_ENUM( MapRecenteringMode )
2067
2068
2073 enum class HistoryProviderBackend : int
2074 {
2075 LocalProfile = 1 << 0,
2076// Project = 1 << 1, //!< QGIS Project (not yet implemented)
2077 };
2078 Q_ENUM( HistoryProviderBackend )
2079 Q_DECLARE_FLAGS( HistoryProviderBackends, HistoryProviderBackend )
2080 Q_FLAG( HistoryProviderBackends )
2081
2082
2088 {
2089 Wkt SIP_MONKEYPATCH_COMPAT_NAME( FormatWkt ),
2090 Proj SIP_MONKEYPATCH_COMPAT_NAME( FormatProj ),
2091 };
2092 Q_ENUM( CrsDefinitionFormat )
2093
2094
2102 enum class FieldDomainSplitPolicy : int
2103 {
2104 DefaultValue,
2105 Duplicate,
2106 GeometryRatio,
2107 };
2108 Q_ENUM( FieldDomainSplitPolicy )
2109
2110
2118 enum class FieldDomainMergePolicy : int
2119 {
2120 DefaultValue,
2121 Sum,
2122 GeometryWeighted,
2123 };
2124 Q_ENUM( FieldDomainMergePolicy )
2125
2126
2131 enum class FieldDomainType : int
2132 {
2133 Coded,
2134 Range,
2135 Glob,
2136 };
2137 Q_ENUM( FieldDomainType )
2138
2139
2144 enum class TransactionMode : int
2145 {
2146 Disabled = 0,
2147 AutomaticGroups = 1,
2148 BufferedGroups = 2,
2149 };
2150 Q_ENUM( TransactionMode )
2151
2152
2157 enum class AltitudeClamping : int
2158 {
2159 Absolute,
2160 Relative,
2161 Terrain,
2162 };
2163 Q_ENUM( AltitudeClamping )
2164
2165
2170 enum class AltitudeBinding : int
2171 {
2172 Vertex,
2173 Centroid,
2174 };
2175 Q_ENUM( AltitudeBinding )
2176
2177
2183 {
2184 NoConstraint,
2185 Perpendicular,
2186 Parallel
2187 };
2188 Q_ENUM( BetweenLineConstraint )
2189
2190
2195 enum class LineExtensionSide : int
2196 {
2197 BeforeVertex,
2198 AfterVertex,
2199 NoVertex,
2200 };
2201 Q_ENUM( LineExtensionSide )
2202
2203
2208 enum class ProjectFlag : int
2209 {
2210 EvaluateDefaultValuesOnProviderSide = 1 << 0,
2211 TrustStoredLayerStatistics = 1 << 1,
2212 RememberLayerEditStatusBetweenSessions = 1 << 2,
2213 RememberAttributeTableWindowsBetweenSessions = 1 << 3,
2214 };
2215 Q_ENUM( ProjectFlag )
2216 Q_DECLARE_FLAGS( ProjectFlags, ProjectFlag )
2217 Q_FLAG( ProjectFlags )
2218
2219
2224 enum class PlotToolFlag : int
2225 {
2226 ShowContextMenu = 1 << 0,
2227 };
2228 Q_ENUM( PlotToolFlag )
2229 Q_DECLARE_FLAGS( PlotToolFlags, PlotToolFlag )
2230 Q_FLAG( PlotToolFlags )
2231
2232
2237 enum class LightSourceType : int
2238 {
2239 Point,
2240 Directional,
2241 };
2242 Q_ENUM( LightSourceType )
2243
2244
2250 {
2251 Line,
2252 FillBelow,
2253 };
2255
2261 enum class VectorProfileType : int
2262 {
2263 IndividualFeatures,
2264 ContinuousSurface,
2265 };
2267
2273 enum class ProfileGeneratorFlag : int
2274 {
2275 RespectsMaximumErrorMapUnit = 1 << 0,
2276 RespectsDistanceRange = 1 << 1,
2277 RespectsElevationRange = 1 << 2,
2278 };
2279 Q_ENUM( ProfileGeneratorFlag )
2280 Q_DECLARE_FLAGS( ProfileGeneratorFlags, ProfileGeneratorFlag )
2281 Q_FLAG( ProfileGeneratorFlags )
2282
2283
2289 {
2290 Square,
2291 Circle,
2292 };
2293 Q_ENUM( PointCloudSymbol )
2294
2295
2301 {
2302 Default,
2303 BottomToTop,
2304 TopToBottom,
2305 };
2306 Q_ENUM( PointCloudDrawOrder )
2307
2308
2316 {
2317 AllowIntersections,
2318 AvoidIntersectionsCurrentLayer,
2319 AvoidIntersectionsLayers,
2320 };
2321 Q_ENUM( AvoidIntersectionsMode )
2322
2323
2331 {
2332 Qgz,
2333 Qgs,
2334 };
2335 Q_ENUM( ProjectFileFormat )
2336
2337
2345 {
2346 DontResolveLayers SIP_MONKEYPATCH_COMPAT_NAME( FlagDontResolveLayers ) = 1 << 0,
2347 DontLoadLayouts SIP_MONKEYPATCH_COMPAT_NAME( FlagDontLoadLayouts ) = 1 << 1,
2348 TrustLayerMetadata SIP_MONKEYPATCH_COMPAT_NAME( FlagTrustLayerMetadata ) = 1 << 2,
2349 DontStoreOriginalStyles SIP_MONKEYPATCH_COMPAT_NAME( FlagDontStoreOriginalStyles ) = 1 << 3,
2350 DontLoad3DViews SIP_MONKEYPATCH_COMPAT_NAME( FlagDontLoad3DViews ) = 1 << 4,
2351 DontLoadProjectStyles = 1 << 5,
2352 ForceReadOnlyLayers = 1 << 6,
2353 };
2354 Q_ENUM( ProjectReadFlag )
2355
2356
2363 Q_DECLARE_FLAGS( ProjectReadFlags, ProjectReadFlag ) SIP_MONKEYPATCH_FLAGS_UNNEST( QgsProject, ReadFlags )
2364 Q_FLAG( ProjectReadFlags )
2365
2374 enum class ProjectCapability : int
2375 {
2376 ProjectStyles = 1 << 0,
2377 };
2378 Q_ENUM( ProjectCapability )
2379
2380
2385 Q_DECLARE_FLAGS( ProjectCapabilities, ProjectCapability )
2386 Q_FLAG( ProjectCapabilities )
2387
2388
2394 {
2395 Vector,
2396 Raster,
2397 RasterDem,
2398 GeoJson,
2399 Image,
2400 Video,
2401 Unknown,
2402 };
2403 Q_ENUM( MapBoxGlStyleSourceType )
2404
2405
2413 {
2414 FeatureServer SIP_MONKEYPATCH_COMPAT_NAME( FeatureService ),
2415 MapServer SIP_MONKEYPATCH_COMPAT_NAME( MapService ),
2416 ImageServer SIP_MONKEYPATCH_COMPAT_NAME( ImageService ),
2417 GlobeServer,
2418 GPServer,
2419 GeocodeServer,
2420 Unknown,
2421 };
2422 Q_ENUM( ArcGisRestServiceType )
2423
2424
2432 {
2433 Normal,
2434 Generated,
2435 };
2436 Q_ENUM( RelationshipType )
2437
2438
2446 {
2447 Association,
2448 Composition,
2449 };
2450 Q_ENUM( RelationshipStrength )
2451
2452
2458 {
2459 OneToOne,
2460 OneToMany,
2461 ManyToOne,
2462 ManyToMany,
2463 };
2464 Q_ENUM( RelationshipCardinality )
2465
2466
2471 enum class RelationshipCapability : int
2472 {
2473 MultipleFieldKeys = 1 << 0,
2474 ForwardPathLabel = 1 << 1,
2475 BackwardPathLabel = 1 << 2,
2476 };
2477 Q_ENUM( RelationshipCapability )
2478
2479
2484 Q_DECLARE_FLAGS( RelationshipCapabilities, RelationshipCapability )
2485 Q_FLAG( RelationshipCapabilities )
2486
2487
2492 enum class CoordinateDisplayType : int
2493 {
2494 MapCrs,
2495 MapGeographic,
2496 CustomCrs,
2497 };
2498 Q_ENUM( CoordinateDisplayType )
2499
2500
2505 enum class ScriptLanguage : int
2506 {
2507 Css,
2508 QgisExpression,
2509 Html,
2510 JavaScript,
2511 Json,
2512 Python,
2513 R,
2514 Sql,
2515 Unknown,
2516 };
2517 Q_ENUM( ScriptLanguage )
2518
2519
2525 {
2526 AboveInsertionPoint,
2527 TopOfTree,
2528 OptimalInInsertionGroup,
2529 };
2530 Q_ENUM( LayerTreeInsertionMethod )
2531
2532
2539 enum class ActionType : int
2540 {
2541 Invalid,
2542 MapLayerAction,
2543 AttributeAction
2544 };
2545 Q_ENUM( ActionType )
2546
2547
2554 enum class MapLayerActionTarget : int
2555 {
2556 Layer = 1 << 0,
2557 SingleFeature = 1 << 1,
2558 MultipleFeatures = 1 << 2,
2559 AllActions = Layer | SingleFeature | MultipleFeatures
2560 };
2561 Q_ENUM( MapLayerActionTarget )
2562
2563
2570 Q_DECLARE_FLAGS( MapLayerActionTargets, MapLayerActionTarget )
2571 Q_FLAG( MapLayerActionTargets )
2572
2573
2580 enum class MapLayerActionFlag : int
2581 {
2582 EnabledOnlyWhenEditable = 1 << 1,
2583 };
2584 Q_ENUM( MapLayerActionFlag )
2585
2586
2593 Q_DECLARE_FLAGS( MapLayerActionFlags, MapLayerActionFlag )
2594 Q_FLAG( MapLayerActionFlags )
2595
2596
2604 {
2605 Generic,
2606 GenericPython,
2607 Mac,
2608 Windows,
2609 Unix,
2610 OpenUrl,
2611 SubmitUrlEncoded,
2612 SubmitUrlMultipart,
2613 };
2614 Q_ENUM( AttributeActionType )
2615
2616
2622 {
2623 Created,
2624 Published,
2625 Revised,
2626 Superseded,
2627 };
2628 Q_ENUM( MetadataDateType )
2629
2630
2634 static const double DEFAULT_SEARCH_RADIUS_MM;
2635
2637 static const float DEFAULT_MAPTOPIXEL_THRESHOLD;
2638
2645 static const QColor DEFAULT_HIGHLIGHT_COLOR;
2646
2651 static const double DEFAULT_HIGHLIGHT_BUFFER_MM;
2652
2657 static const double DEFAULT_HIGHLIGHT_MIN_WIDTH_MM;
2658
2665 static const double SCALE_PRECISION;
2666
2672 static const double DEFAULT_Z_COORDINATE;
2673
2679 static const double DEFAULT_M_COORDINATE;
2680
2686 static const double UI_SCALE_FACTOR;
2687
2692 static const double DEFAULT_SNAP_TOLERANCE;
2693
2698 static const QgsTolerance::UnitType DEFAULT_SNAP_UNITS;
2699
2705 static QString defaultProjectScales();
2706
2712 static int geosVersionInt();
2713
2719 static int geosVersionMajor();
2720
2726 static int geosVersionMinor();
2727
2733 static int geosVersionPatch();
2734
2740 static QString geosVersion();
2741};
2742
2745
2746Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolRenderHints )
2747Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolFlags )
2748Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolPreviewFlags )
2749Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SymbolLayerFlags )
2750Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BrowserItemCapabilities )
2751Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SublayerQueryFlags )
2752Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SublayerFlags )
2753Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SqlLayerDefinitionCapabilities )
2754Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BabelFormatCapabilities )
2755Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::BabelCommandFlags )
2756Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::GeometryValidityFlags )
2757Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::FileOperationFlags )
2758Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::AnnotationItemFlags )
2759Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::AnnotationItemGuiFlags )
2760Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MapSettingsFlags )
2761Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::RenderContextFlags )
2762Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::VectorLayerTypeFlags )
2763Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MarkerLinePlacements )
2764Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::TextRendererFlags )
2765Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::HistoryProviderBackends )
2766Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MapLayerProperties )
2767Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::DataProviderFlags )
2768Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SnappingTypes )
2769Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::PlotToolFlags )
2770Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::ProfileGeneratorFlags )
2771Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::ProjectReadFlags )
2772Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::ProjectCapabilities )
2773Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::CoordinateTransformationFlags )
2774Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::RasterTemporalCapabilityFlags )
2775Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::SelectionFlags )
2776Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::RasterRendererFlags )
2777Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::LabelingFlags )
2778Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::GpsInformationComponents )
2779Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MapLayerActionTargets )
2780Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::MapLayerActionFlags )
2781Q_DECLARE_OPERATORS_FOR_FLAGS( Qgis::RelationshipCapabilities )
2782
2783// hack to workaround warnings when casting void pointers
2784// retrieved from QLibrary::resolve to function pointers.
2785// It's assumed that this works on all systems supporting
2786// QLibrary
2787#define cast_to_fptr(f) f
2788
2789
2798// based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
2799template<class Object> class QgsSignalBlocker SIP_SKIP SIP_SKIP // clazy:exclude=rule-of-three
2800{
2801 public:
2802
2807 explicit QgsSignalBlocker( Object * object )
2808 : mObject( object )
2809 , mPreviousState( object->blockSignals( true ) )
2810 {}
2811
2813 {
2814 mObject->blockSignals( mPreviousState );
2815 }
2816
2818 Object *operator->() { return mObject; }
2819
2820 private:
2821
2822 Object *mObject = nullptr;
2823 bool mPreviousState;
2824
2825};
2826
2840// based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
2841template<class Object> inline QgsSignalBlocker<Object> whileBlocking( Object *object ) SIP_SKIP SIP_SKIP
2842{
2843 return QgsSignalBlocker<Object>( object );
2844}
2845
2847CORE_EXPORT uint qHash( const QVariant &variant );
2848
2854inline QString qgsDoubleToString( double a, int precision = 17 )
2855{
2856 QString str;
2857 if ( precision )
2858 {
2859 if ( precision < 0 )
2860 {
2861 const double roundFactor = std::pow( 10, -precision );
2862 str = QString::number( static_cast< long long >( std::round( a / roundFactor ) * roundFactor ) );
2863 }
2864 else
2865 {
2866 str = QString::number( a, 'f', precision );
2867 if ( str.contains( QLatin1Char( '.' ) ) )
2868 {
2869 // remove ending 0s
2870 int idx = str.length() - 1;
2871 while ( str.at( idx ) == '0' && idx > 1 )
2872 {
2873 idx--;
2874 }
2875 if ( idx < str.length() - 1 )
2876 str.truncate( str.at( idx ) == '.' ? idx : idx + 1 );
2877 }
2878 }
2879 }
2880 else
2881 {
2882 str = QString::number( a, 'f', precision );
2883 }
2884 // avoid printing -0
2885 // see https://bugreports.qt.io/browse/QTBUG-71439
2886 if ( str == QLatin1String( "-0" ) )
2887 {
2888 return QLatin1String( "0" );
2889 }
2890 return str;
2891}
2892
2899inline bool qgsNanCompatibleEquals( double a, double b )
2900{
2901 const bool aIsNan = std::isnan( a );
2902 const bool bIsNan = std::isnan( b );
2903 if ( aIsNan || bIsNan )
2904 return aIsNan && bIsNan;
2905
2906 return a == b;
2907}
2908
2915inline bool qgsDoubleNear( double a, double b, double epsilon = 4 * std::numeric_limits<double>::epsilon() )
2916{
2917 const bool aIsNan = std::isnan( a );
2918 const bool bIsNan = std::isnan( b );
2919 if ( aIsNan || bIsNan )
2920 return aIsNan && bIsNan;
2921
2922 const double diff = a - b;
2923 return diff > -epsilon && diff <= epsilon;
2924}
2925
2932inline bool qgsFloatNear( float a, float b, float epsilon = 4 * FLT_EPSILON )
2933{
2934 const bool aIsNan = std::isnan( a );
2935 const bool bIsNan = std::isnan( b );
2936 if ( aIsNan || bIsNan )
2937 return aIsNan && bIsNan;
2938
2939 const float diff = a - b;
2940 return diff > -epsilon && diff <= epsilon;
2941}
2942
2944inline bool qgsDoubleNearSig( double a, double b, int significantDigits = 10 )
2945{
2946 const bool aIsNan = std::isnan( a );
2947 const bool bIsNan = std::isnan( b );
2948 if ( aIsNan || bIsNan )
2949 return aIsNan && bIsNan;
2950
2951 // The most simple would be to print numbers as %.xe and compare as strings
2952 // but that is probably too costly
2953 // Then the fastest would be to set some bits directly, but little/big endian
2954 // has to be considered (maybe TODO)
2955 // Is there a better way?
2956 int aexp, bexp;
2957 const double ar = std::frexp( a, &aexp );
2958 const double br = std::frexp( b, &bexp );
2959
2960 return aexp == bexp &&
2961 std::round( ar * std::pow( 10.0, significantDigits ) ) == std::round( br * std::pow( 10.0, significantDigits ) );
2962}
2963
2969inline double qgsRound( double number, int places )
2970{
2971 const double m = ( number < 0.0 ) ? -1.0 : 1.0;
2972 const double scaleFactor = std::pow( 10.0, places );
2973 return ( std::round( number * m * scaleFactor ) / scaleFactor ) * m;
2974}
2975
2976#ifndef SIP_RUN
2977
2984template<class Key, class Value>
2985QString qgsMapJoinKeys( const QMap<Key, Value> &map, const QString &separator )
2986{
2987 QString result;
2988 for ( auto it = map.constBegin(); it != map.constEnd(); it++ )
2989 result += QString( "%1%2" ).arg( it.key() ).arg( separator );
2990
2991 result.chop( separator.size() );
2992 return result;
2993}
2994
3001template<class Key, class Value>
3002QString qgsMapJoinValues( const QMap<Key, Value> &map, const QString &separator )
3003{
3004 QString result;
3005 for ( auto it = map.constBegin(); it != map.constEnd(); it++ )
3006 result += QString( "%1%2" ).arg( it.value() ).arg( separator );
3007
3008 result.chop( separator.size() );
3009 return result;
3010}
3011
3018template<class T>
3019QString qgsSetJoin( const QSet<T> &set, const QString &separator )
3020{
3021 QString result;
3022 for ( auto it = set.constBegin(); it != set.constEnd(); it++ )
3023 result += QString( "%1%2" ).arg( *it ).arg( separator );
3024
3025 result.chop( separator.size() );
3026 return result;
3027}
3028
3030
3040namespace qgis
3041{
3042
3055 template<typename To, typename From> inline To down_cast( From *f )
3056 {
3057 static_assert(
3058 ( std::is_base_of<From,
3059 typename std::remove_pointer<To>::type>::value ),
3060 "target type not derived from source type" );
3061 Q_ASSERT( f == nullptr || dynamic_cast<To>( f ) != nullptr );
3062 return static_cast<To>( f );
3063 }
3064
3065 template<class T>
3066 QSet<T> listToSet( const QList<T> &list )
3067 {
3068 return QSet<T>( list.begin(), list.end() );
3069 }
3070
3071 template<class T>
3072 QList<T> setToList( const QSet<T> &set )
3073 {
3074 return QList<T>( set.begin(), set.end() );
3075 }
3076}
3077
3079#endif
3080
3085template<class T> const QList<T> qgsEnumList() SIP_SKIP
3086{
3087 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
3088 Q_ASSERT( metaEnum.isValid() );
3089 QList<T> enumList;
3090 for ( int idx = 0; idx < metaEnum.keyCount(); ++idx )
3091 {
3092 enumList.append( static_cast<T>( metaEnum.value( idx ) ) );
3093 }
3094 return enumList;
3095}
3096
3102template<class T> const QMap<T, QString> qgsEnumMap() SIP_SKIP
3103{
3104 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
3105 Q_ASSERT( metaEnum.isValid() );
3106 QMap<T, QString> enumMap;
3107 for ( int idx = 0; idx < metaEnum.keyCount(); ++idx )
3108 {
3109 enumMap.insert( static_cast<T>( metaEnum.value( idx ) ), QString( metaEnum.key( idx ) ) );
3110 }
3111 return enumMap;
3112}
3113
3119template<class T> QString qgsEnumValueToKey( const T &value, bool *returnOk = nullptr ) SIP_SKIP
3120{
3121 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
3122 Q_ASSERT( metaEnum.isValid() );
3123 const char *key = metaEnum.valueToKey( static_cast<int>( value ) );
3124 if ( returnOk )
3125 {
3126 *returnOk = key ? true : false;
3127 }
3128 return QString::fromUtf8( key );
3129}
3130
3138template<class T> T qgsEnumKeyToValue( const QString &key, const T &defaultValue, bool tryValueAsKey = true, bool *returnOk = nullptr ) SIP_SKIP
3139{
3140 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
3141 Q_ASSERT( metaEnum.isValid() );
3142 bool ok = false;
3143 T v = static_cast<T>( metaEnum.keyToValue( key.toUtf8().data(), &ok ) );
3144 if ( returnOk )
3145 {
3146 *returnOk = ok;
3147 }
3148 if ( ok )
3149 {
3150 return v;
3151 }
3152 else
3153 {
3154 // if conversion has failed, try with conversion from int value
3155 if ( tryValueAsKey )
3156 {
3157 bool canConvert = false;
3158 const int intValue = key.toInt( &canConvert );
3159 if ( canConvert && metaEnum.valueToKey( intValue ) )
3160 {
3161 if ( returnOk )
3162 {
3163 *returnOk = true;
3164 }
3165 return static_cast<T>( intValue );
3166 }
3167 }
3168 }
3169 return defaultValue;
3170}
3171
3177template<class T> QString qgsFlagValueToKeys( const T &value, bool *returnOk = nullptr ) SIP_SKIP
3178{
3179 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
3180 Q_ASSERT( metaEnum.isValid() );
3181 int intValue = static_cast<int>( value );
3182 const QByteArray ba = metaEnum.valueToKeys( intValue );
3183 // check that the int value does correspond to a flag
3184 // see https://stackoverflow.com/a/68495949/1548052
3185 const int intValueCheck = metaEnum.keysToValue( ba );
3186 bool ok = intValue == intValueCheck;
3187 if ( returnOk )
3188 *returnOk = ok;
3189 return ok ? QString::fromUtf8( ba ) : QString();
3190}
3191
3199template<class T> T qgsFlagKeysToValue( const QString &keys, const T &defaultValue, bool tryValueAsKey = true, bool *returnOk = nullptr ) SIP_SKIP
3200{
3201 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
3202 Q_ASSERT( metaEnum.isValid() );
3203 bool ok = false;
3204 T v = static_cast<T>( metaEnum.keysToValue( keys.toUtf8().constData(), &ok ) );
3205 if ( returnOk )
3206 {
3207 *returnOk = ok;
3208 }
3209 if ( ok )
3210 {
3211 return v;
3212 }
3213 else
3214 {
3215 // if conversion has failed, try with conversion from int value
3216 if ( tryValueAsKey )
3217 {
3218 bool canConvert = false;
3219 const int intValue = keys.toInt( &canConvert );
3220 if ( canConvert )
3221 {
3222 const QByteArray keys = metaEnum.valueToKeys( intValue );
3223 const int intValueCheck = metaEnum.keysToValue( keys );
3224 if ( intValue == intValueCheck )
3225 {
3226 if ( returnOk )
3227 {
3228 *returnOk = true;
3229 }
3230 return T( intValue );
3231 }
3232 }
3233 }
3234 }
3235 return defaultValue;
3236}
3237
3238
3248CORE_EXPORT double qgsPermissiveToDouble( QString string, bool &ok );
3249
3259CORE_EXPORT int qgsPermissiveToInt( QString string, bool &ok );
3260
3270CORE_EXPORT qlonglong qgsPermissiveToLongLong( QString string, bool &ok );
3271
3281CORE_EXPORT bool qgsVariantLessThan( const QVariant &lhs, const QVariant &rhs );
3282
3291CORE_EXPORT bool qgsVariantEqual( const QVariant &lhs, const QVariant &rhs );
3292
3299CORE_EXPORT bool qgsVariantGreaterThan( const QVariant &lhs, const QVariant &rhs );
3300
3301#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
3302
3309inline bool operator> ( const QVariant &v1, const QVariant &v2 )
3310{
3311 return qgsVariantGreaterThan( v1, v2 );
3312}
3313
3323inline bool operator< ( const QVariant &v1, const QVariant &v2 )
3324{
3325 return qgsVariantLessThan( v1, v2 );
3326}
3327#endif
3328
3329
3330#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
3331
3335template<> CORE_EXPORT bool qMapLessThanKey<QVariantList>( const QVariantList &key1, const QVariantList &key2 ) SIP_SKIP;
3336#endif
3337
3338CORE_EXPORT QString qgsVsiPrefix( const QString &path );
3339
3345void CORE_EXPORT *qgsMalloc( size_t size ) SIP_SKIP;
3346
3351void CORE_EXPORT qgsFree( void *ptr ) SIP_SKIP;
3352
3353#ifndef SIP_RUN
3354
3355#ifdef _MSC_VER
3356#define CONSTLATIN1STRING inline const QLatin1String
3357#else
3358#define CONSTLATIN1STRING constexpr QLatin1String
3359#endif
3360
3362class ScopedIntIncrementor
3363{
3364 public:
3365
3366 ScopedIntIncrementor( int *variable )
3367 : mVariable( variable )
3368 {
3369 ( *mVariable )++;
3370 }
3371
3372 ScopedIntIncrementor( const ScopedIntIncrementor &other ) = delete;
3373 ScopedIntIncrementor &operator=( const ScopedIntIncrementor &other ) = delete;
3374
3375 void release()
3376 {
3377 if ( mVariable )
3378 ( *mVariable )--;
3379
3380 mVariable = nullptr;
3381 }
3382
3383 ~ScopedIntIncrementor()
3384 {
3385 release();
3386 }
3387
3388 private:
3389 int *mVariable = nullptr;
3390};
3392
3398{
3399 return QLatin1String(
3400 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]] )"""
3401 );
3402}
3403
3406{
3407 return QLatin1String( "+proj=longlat +datum=WGS84 +no_defs" );
3408}
3409
3412{
3413 return QLatin1String( "EPSG:4326" );
3414}
3415
3418{
3419 return QLatin1String( "NONE" );
3420}
3421
3423
3425const int PREVIEW_JOB_DELAY_MS = 250;
3426
3428const int MAXIMUM_LAYER_PREVIEW_TIME_MS = 250;
3429
3431
3432#endif
3433
3435const long GEOSRID = 4326;
3436
3438const long GEOCRS_ID = 3452;
3439
3441const long GEO_EPSG_CRS_ID = 4326;
3442
3447const int USER_CRS_START_ID = 100000;
3448
3449//
3450// Constants for point symbols
3451//
3452
3454const double DEFAULT_POINT_SIZE = 2.0;
3455const double DEFAULT_LINE_WIDTH = 0.26;
3456
3458const double DEFAULT_SEGMENT_EPSILON = 1e-8;
3459
3460typedef QMap<QString, QString> QgsStringMap SIP_SKIP;
3461
3470typedef unsigned long long qgssize;
3471
3472#ifndef SIP_RUN
3473#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
3474
3475#define Q_NOWARN_DEPRECATED_PUSH \
3476 _Pragma("GCC diagnostic push") \
3477 _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
3478#define Q_NOWARN_DEPRECATED_POP \
3479 _Pragma("GCC diagnostic pop");
3480#define Q_NOWARN_UNREACHABLE_PUSH
3481#define Q_NOWARN_UNREACHABLE_POP
3482
3483#elif defined(_MSC_VER)
3484
3485#define Q_NOWARN_DEPRECATED_PUSH \
3486 __pragma(warning(push)) \
3487 __pragma(warning(disable:4996))
3488#define Q_NOWARN_DEPRECATED_POP \
3489 __pragma(warning(pop))
3490#define Q_NOWARN_UNREACHABLE_PUSH \
3491 __pragma(warning(push)) \
3492 __pragma(warning(disable:4702))
3493#define Q_NOWARN_UNREACHABLE_POP \
3494 __pragma(warning(pop))
3495
3496#else
3497
3498#define Q_NOWARN_DEPRECATED_PUSH
3499#define Q_NOWARN_DEPRECATED_POP
3500#define Q_NOWARN_UNREACHABLE_PUSH
3501#define Q_NOWARN_UNREACHABLE_POP
3502
3503#endif
3504#endif
3505
3506#ifndef QGISEXTERN
3507#ifdef Q_OS_WIN
3508# define QGISEXTERN extern "C" __declspec( dllexport )
3509#else
3510# if defined(__GNUC__) || defined(__clang__)
3511# define QGISEXTERN extern "C" __attribute__ ((visibility ("default")))
3512# else
3513# define QGISEXTERN extern "C"
3514# endif
3515#endif
3516#endif
3517#endif
3518
3519#if __cplusplus >= 201500
3520#define FALLTHROUGH [[fallthrough]];
3521#elif defined(__clang__)
3522#define FALLTHROUGH [[clang::fallthrough]];
3523#elif defined(__GNUC__) && __GNUC__ >= 7
3524#define FALLTHROUGH [[gnu::fallthrough]];
3525#else
3526#define FALLTHROUGH
3527#endif
3528
3529// see https://infektor.net/posts/2017-01-19-using-cpp17-attributes-today.html#using-the-nodiscard-attribute
3530#if __cplusplus >= 201703L
3531#define NODISCARD [[nodiscard]]
3532#elif defined(__clang__)
3533#define NODISCARD [[nodiscard]]
3534#elif defined(_MSC_VER)
3535#define NODISCARD // no support
3536#elif defined(__has_cpp_attribute)
3537#if __has_cpp_attribute(nodiscard)
3538#define NODISCARD [[nodiscard]]
3539#elif __has_cpp_attribute(gnu::warn_unused_result)
3540#define NODISCARD [[gnu::warn_unused_result]]
3541#else
3542#define NODISCARD Q_REQUIRED_RESULT
3543#endif
3544#else
3545#define NODISCARD Q_REQUIRED_RESULT
3546#endif
3547
3548#if __cplusplus >= 201703L
3549#define MAYBE_UNUSED [[maybe_unused]]
3550#elif defined(__clang__)
3551#define MAYBE_UNUSED [[maybe_unused]]
3552#elif defined(_MSC_VER)
3553#define MAYBE_UNUSED // no support
3554#elif defined(__has_cpp_attribute)
3555#if __has_cpp_attribute(gnu::unused)
3556#define MAYBE_UNUSED [[gnu::unused]]
3557#else
3558#define MAYBE_UNUSED
3559#endif
3560#else
3561#define MAYBE_UNUSED
3562#endif
3563
3564#ifndef FINAL
3565#define FINAL final
3566#endif
3567
3568#ifndef SIP_RUN
3569#ifdef _MSC_VER
3570#define BUILTIN_UNREACHABLE \
3571 __assume(false);
3572#elif defined(__GNUC__) && !defined(__clang__)
3573// Workaround a GCC bug where a -Wreturn-type warning is emitted in constructs
3574// like:
3575// switch( mVariableThatCanOnlyBeXorY )
3576// {
3577// case X:
3578// return "foo";
3579// case Y:
3580// return "foo";
3581// }
3582// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
3583#define BUILTIN_UNREACHABLE \
3584 __builtin_unreachable();
3585#else
3586#define BUILTIN_UNREACHABLE
3587#endif
3588#endif // SIP_RUN
3589
3590#ifdef SIP_RUN
3591
3596QString CORE_EXPORT geoWkt();
3597
3599QString CORE_EXPORT geoProj4();
3600
3602QString CORE_EXPORT geoEpsgCrsAuthId();
3603
3605QString CORE_EXPORT geoNone();
3606
3607#endif
The Qgis class provides global constants for use throughout the application.
Definition: qgis.h:72
GnssConstellation
GNSS constellation.
Definition: qgis.h:972
SettingsOption
Settings options.
Definition: qgis.h:248
ProfileGeneratorFlag
Flags that control the way the QgsAbstractProfileGenerator operate.
Definition: qgis.h:2274
GpsQualityIndicator
GPS signal quality indicator.
Definition: qgis.h:990
ProjectReadFlag
Flags which control project read behavior.
Definition: qgis.h:2345
PointCloudSymbol
Rendering symbols for point cloud points.
Definition: qgis.h:2289
GeometryValidityFlag
Geometry validity check flags.
Definition: qgis.h:1124
MapLayerActionFlag
Map layer action targets.
Definition: qgis.h:2581
MapLayerProperty
File operation flags.
Definition: qgis.h:1227
BufferSide
Side of line to buffer.
Definition: qgis.h:1149
RasterResamplingStage
Stage at which raster resampling occurs.
Definition: qgis.h:721
AltitudeClamping
Altitude clamping.
Definition: qgis.h:2158
VectorTemporalMode
Vector layer temporal feature modes.
Definition: qgis.h:1373
SublayerFlag
Sublayer query flags.
Definition: qgis.h:690
CoordinateDisplayType
Relationship capabilities.
Definition: qgis.h:2493
DashPatternSizeAdjustment
Dash pattern size adjustment options.
Definition: qgis.h:1923
GpsFixStatus
GPS fix status.
Definition: qgis.h:957
AnnotationItemNodeType
Annotation item GUI flags.
Definition: qgis.h:1349
static const char * QGIS_DEV_VERSION
The development version.
Definition: qgis.h:98
AngularDirection
Angular directions.
Definition: qgis.h:2023
DriveType
Drive types.
Definition: qgis.h:506
ContentStatus
Status for fetched or stored content.
Definition: qgis.h:913
SnappingType
SnappingTypeFlag defines on what object the snapping is performed.
Definition: qgis.h:273
Q_ENUM(GpsFixStatus)
RelationshipStrength
Relationship strength.
Definition: qgis.h:2446
Q_ENUM(GnssConstellation)
MarkerLinePlacement
Defines how/where the symbols should be placed on a line.
Definition: qgis.h:1788
GeometryOperationResult
Success or failure of a geometry operation.
Definition: qgis.h:1096
BrowserItemState
Browser item states.
Definition: qgis.h:368
MarkerClipMode
Marker clipping modes.
Definition: qgis.h:1881
AnnotationItemFlag
Flags for annotation items.
Definition: qgis.h:1321
RenderSubcomponentProperty
Rendering subcomponent properties.
Definition: qgis.h:1712
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
LayerTreeInsertionMethod
Layer tree insertion methods.
Definition: qgis.h:2525
LineClipMode
Line clipping modes.
Definition: qgis.h:1895
BrowserDirectoryMonitoring
Browser directory item monitoring switches.
Definition: qgis.h:426
TilePixelRatio
DpiMode enum.
Definition: qgis.h:1963
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:1810
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:1442
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:1854
ScaleMethod
Scale methods.
Definition: qgis.h:220
FilePathType
File path types.
Definition: qgis.h:813
PointCountMethod
Methods which define the number of points randomly filling a polygon.
Definition: qgis.h:1869
VertexType
Types of vertex.
Definition: qgis.h:1725
DataProviderFlag
Map layer properties.
Definition: qgis.h:1242
GeometryValidationEngine
Available engines for validating geometries.
Definition: qgis.h:1137
TransactionMode
Transaction mode.
Definition: qgis.h:2145
Q_ENUM(ScaleToTileZoomLevelMethod)
GpsInformationComponent
GPS information component.
Definition: qgis.h:1010
ViewSyncModeFlag
Synchronization of 2D map canvas and 3D view.
Definition: qgis.h:2048
FileOperationFlag
File operation flags.
Definition: qgis.h:1212
ProjectCapability
Flags which control project capabilities.
Definition: qgis.h:2375
Q_ENUM(VectorProfileType)
AttributeActionType
Map layer action flags.
Definition: qgis.h:2604
FieldDomainMergePolicy
Merge policy for field domains.
Definition: qgis.h:2119
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:1938
TextLayoutMode
Text layout modes.
Definition: qgis.h:1631
RasterRendererFlag
Flags which control behavior of raster renderers.
Definition: qgis.h:735
MeshEditingErrorType
Type of error that can occur during mesh frame editing.
Definition: qgis.h:796
FieldDomainSplitPolicy
Split policy for field domains.
Definition: qgis.h:2103
ArcGisRestServiceType
Available ArcGIS REST service types.
Definition: qgis.h:2413
AnnotationItemEditOperationResult
Results from an edit operation on an annotation item.
Definition: qgis.h:1360
MapRecenteringMode
Modes for recentering map canvases.
Definition: qgis.h:2061
ActionType
Action types.
Definition: qgis.h:2540
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:2316
MarkerShape
Marker shapes.
Definition: qgis.h:1739
Capitalization
String capitalization options.
Definition: qgis.h:1980
TemporalIntervalMatchMethod
Method to use when resolving a temporal range to a data provider layer or band.
Definition: qgis.h:1427
LabelQuadrantPosition
Label quadrant positions.
Definition: qgis.h:622
ScaleToTileZoomLevelMethod
Available methods for converting map scales to tile zoom levels.
Definition: qgis.h:2011
SublayerQueryFlag
Flags which control how data providers will scan for sublayers in a dataset.
Definition: qgis.h:673
TextOrientation
Text orientations.
Definition: qgis.h:1616
PythonMacroMode
Vector layer type flags.
Definition: qgis.h:180
UnplacedLabelVisibility
Unplaced label visibility.
Definition: qgis.h:534
CrsDefinitionFormat
CRS definition formats.
Definition: qgis.h:2088
SpatialFilterType
Feature request spatial filter types.
Definition: qgis.h:1199
ProjectFlag
Flags which control the behavior of QgsProjects.
Definition: qgis.h:2209
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:1414
RasterAttributeTableType
The RasterAttributeTableType enum represents the type of RAT.
Definition: qgis.h:784
LabelingFlag
Various flags that affect drawing and placement of labels.
Definition: qgis.h:1571
RelationshipType
Relationship types.
Definition: qgis.h:2432
JoinStyle
Join styles for buffers.
Definition: qgis.h:1174
PointCloudDrawOrder
Pointcloud rendering order for 2d views.
Definition: qgis.h:2301
TextCharacterVerticalAlignment
Text vertical alignment for characters.
Definition: qgis.h:1699
DpiMode
DpiMode enum.
Definition: qgis.h:1949
BrowserLayerType
Browser item layer types.
Definition: qgis.h:403
AltitudeBinding
Altitude binding.
Definition: qgis.h:2171
MapLayerActionTarget
Map layer action targets.
Definition: qgis.h:2555
ScriptLanguage
Scripting languages.
Definition: qgis.h:2506
LabelMultiLineAlignment
Text alignment for multi-line labels.
Definition: qgis.h:658
VectorDataProviderTemporalMode
Vector data provider temporal handling modes.
Definition: qgis.h:1401
TextRenderFormat
Options for rendering text.
Definition: qgis.h:1557
DataType
Raster data types.
Definition: qgis.h:129
Q_ENUM(ProfileSurfaceSymbology)
RasterAttributeTableFieldUsage
Flags which control behavior of raster renderers.
Definition: qgis.h:755
RelationshipCapability
Relationship capabilities.
Definition: qgis.h:2472
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:2225
CoordinateOrder
Order of coordinates.
Definition: qgis.h:1308
SelectionFlag
Flags which control feature selection behavior.
Definition: qgis.h:865
EndCapStyle
End cap styles for buffers.
Definition: qgis.h:1161
BabelCommandFlag
Babel GPS format capabilities.
Definition: qgis.h:1067
FieldDomainType
Types of field domain.
Definition: qgis.h:2132
RenderContextFlag
Flags which affect rendering operations.
Definition: qgis.h:1523
RasterPipeInterfaceRole
Sublayer flags.
Definition: qgis.h:704
SymbolPreviewFlag
Symbol flags.
Definition: qgis.h:321
AnnotationItemGuiFlag
Annotation item flags.
Definition: qgis.h:1335
MapBoxGlStyleSourceType
Flags which control project capabilities.
Definition: qgis.h:2394
DashPatternLineEndingRule
Dash pattern line ending rules.
Definition: qgis.h:1908
VertexMarkerType
Editing vertex markers, used for showing vertices during a edit operation.
Definition: qgis.h:901
HistoryProviderBackend
History provider backends.
Definition: qgis.h:2074
SublayerPromptMode
Specifies how to handle layer sources with multiple sublayers.
Definition: qgis.h:825
TextVerticalAlignment
Text vertical alignment.
Definition: qgis.h:1683
RelationshipCardinality
Relationship cardinality.
Definition: qgis.h:2458
GradientType
Gradient types.
Definition: qgis.h:1824
VectorProfileType
Types of elevation profiles to generate for vector sources.
Definition: qgis.h:2262
GpsFeatureType
Babel command flags.
Definition: qgis.h:1081
VectorLayerTypeFlag
Vector layer type flags.
Definition: qgis.h:167
MakeValidMethod
Algorithms to use when repairing invalid geometries.
Definition: qgis.h:1187
VectorTemporalLimitMode
Mode for the handling of the limits of the filtering timeframe for vector features.
Definition: qgis.h:1389
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:886
Q_DECLARE_FLAGS(GeometryValidityFlags, GeometryValidityFlag) SIP_MONKEYPATCH_FLAGS_UNNEST(QgsGeometry
Geometry validity flags.
ProjectFileFormat
Flags which control project read behavior.
Definition: qgis.h:2331
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:2250
LabelPlacementEngineVersion
Labeling placement engine version.
Definition: qgis.h:1602
RendererUsage
Usage of the renderer.
Definition: qgis.h:2035
BabelFormatCapability
GPS information component.
Definition: qgis.h:1048
GpsConnectionType
GPS connection types.
Definition: qgis.h:928
GpsConnectionStatus
GPS connection status.
Definition: qgis.h:942
BetweenLineConstraint
Between line constraints which can be enabled.
Definition: qgis.h:2183
MetadataDateType
Date types for metadata.
Definition: qgis.h:2622
TextHorizontalAlignment
Text horizontal alignment.
Definition: qgis.h:1664
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:2196
HttpMethod
Different methods of HTTP requests.
Definition: qgis.h:438
SymbolCoordinateReference
Symbol coordinate reference modes.
Definition: qgis.h:1839
TextRendererFlag
Flags which control the behavior of rendering text.
Definition: qgis.h:1998
SelectGeometryRelationship
Geometry relationship test to apply for selecting features.
Definition: qgis.h:853
CrsAxisDirection
Data provider flags.
Definition: qgis.h:1258
LabelOverlapHandling
Label overlap handling.
Definition: qgis.h:546
CoordinateTransformationFlag
Flags which adjust the coordinate transformations behave.
Definition: qgis.h:1473
TextComponent
Text components.
Definition: qgis.h:1648
TransformDirection
Flags for raster layer temporal capabilities.
Definition: qgis.h:1461
LightSourceType
Light source types for 3D scenes.
Definition: qgis.h:2238
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:1493
SelectBehavior
Specifies how a selection should be applied.
Definition: qgis.h:839
Utility class that encapsulates an action based on vector attributes.
Definition: qgsaction.h:37
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
Encapsulates information relating to a GPS position fix.
Stores global configuration for labeling engine.
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:105
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:2800
Object * operator->()
Returns pointer to blocked QObject.
Definition: qgis.h:2818
~QgsSignalBlocker()
Definition: qgis.h:2812
QgsSignalBlocker(Object *object)
Constructor for QgsSignalBlocker.
Definition: qgis.h:2807
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:3417
const double DEFAULT_LINE_WIDTH
Definition: qgis.h:3455
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:3309
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:3138
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
Definition: qgis.h:2854
QString qgsMapJoinValues(const QMap< Key, Value > &map, const QString &separator)
Joins all the map values into a single string with each element separated by the given separator.
Definition: qgis.h:3002
QString qgsEnumValueToKey(const T &value, bool *returnOk=nullptr)
Returns the value for the given key of an enum.
Definition: qgis.h:3119
QString qgsFlagValueToKeys(const T &value, bool *returnOk=nullptr)
Returns the value for the given keys of a flag.
Definition: qgis.h:3177
const long GEO_EPSG_CRS_ID
Magic number for a geographic coord sys in EpsgCrsId ID format.
Definition: qgis.h:3441
QString qgsMapJoinKeys(const QMap< Key, Value > &map, const QString &separator)
Joins all the map keys into a single string with each element separated by the given separator.
Definition: qgis.h:2985
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:3199
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:3470
const QMap< T, QString > qgsEnumMap()
Returns a map of all enum entries.
Definition: qgis.h:3102
bool qgsFloatNear(float a, float b, float epsilon=4 *FLT_EPSILON)
Compare two floats (but allow some difference)
Definition: qgis.h:2932
QString qgsSetJoin(const QSet< T > &set, const QString &separator)
Joins all the set values into a single string with each element separated by the given separator.
Definition: qgis.h:3019
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:3085
double qgsRound(double number, int places)
Returns a double number, rounded (as close as possible) to the specified number of places.
Definition: qgis.h:2969
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
Definition: qgis.h:2915
CONSTLATIN1STRING geoProj4()
PROJ4 string that represents a geographic coord sys.
Definition: qgis.h:3405
bool qgsNanCompatibleEquals(double a, double b)
Compare two doubles, treating nan values as equal.
Definition: qgis.h:2899
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition: qgis.h:2841
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:3458
QMap< QString, QString > QgsStringMap
Definition: qgis.h:3460
#define CONSTLATIN1STRING
Definition: qgis.h:3358
CONSTLATIN1STRING geoWkt()
Wkt string that represents a geographic coord sys.
Definition: qgis.h:3397
bool qgsDoubleNearSig(double a, double b, int significantDigits=10)
Compare two doubles using specified number of significant digits.
Definition: qgis.h:2944
const int USER_CRS_START_ID
Magick number that determines whether a projection crsid is a system (srs.db) or user (~/....
Definition: qgis.h:3447
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:3435
#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:3323
CONSTLATIN1STRING geoEpsgCrsAuthId()
Geographic coord sys from EPSG authority.
Definition: qgis.h:3411
const long GEOCRS_ID
Magic number for a geographic coord sys in QGIS srs.db tbl_srs.srs_id.
Definition: qgis.h:3438
const double DEFAULT_POINT_SIZE
Magic number that determines the default point size for point symbols.
Definition: qgis.h:3454
#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