28 #include "qgis_core.h"
37 int QgisEvent = QEvent::User + 1;
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); \
81 static QString version();
88 static int versionInt();
95 static QString releaseName();
105 static QString devVersion();
122 Q_ENUM( MessageLevel )
143 ARGB32_Premultiplied = 13
159 Q_ENUM( CaptureTechnique )
170 Q_ENUM( VectorLayerTypeFlag )
172 Q_DECLARE_FLAGS( VectorLayerTypeFlags, VectorLayerTypeFlag )
173 Q_FLAG( VectorLayerTypeFlags )
187 Q_ENUM( PythonMacroMode )
199 Q_ENUM( FeatureCountState )
224 Q_ENUM( ScaleMethod )
241 Q_ENUM( SettingsType )
249 SaveFormerValue = 1 << 1,
250 SaveEnumFlagAsInt = 1 << 2,
252 Q_ENUM( SettingsOption )
253 Q_DECLARE_FLAGS( SettingsOptions, SettingsOption )
254 Q_FLAG( SettingsOptions )
264 AdvancedConfiguration = 3,
266 Q_ENUM( SnappingMode )
282 Q_ENUM( SnappingType )
285 Q_FLAG( SnappingTypes )
296 Q_ENUM( SymbolRenderHint )
299 Q_FLAG( SymbolRenderHints )
308 RendererShouldUseSymbolLevels = 1 << 0,
312 Q_DECLARE_FLAGS( SymbolFlags, SymbolFlag )
313 Q_FLAG( SymbolFlags )
322 FlagIncludeCrosshairsForMarkerSymbols = 1 << 0,
324 Q_ENUM( SymbolPreviewFlag )
327 Q_FLAG( SymbolPreviewFlags )
336 DisableFeatureClipping = 1 << 0,
338 Q_ENUM( SymbolLayerFlag )
340 Q_DECLARE_FLAGS( SymbolLayerFlags, SymbolLayerFlag )
341 Q_FLAG( SymbolLayerFlags )
360 Q_ENUM( BrowserItemType )
373 Q_ENUM( BrowserItemState )
389 ItemRepresentsFile = 1 << 6,
390 RefreshChildrenWhenItemIsRefreshed = 1 << 7,
392 Q_ENUM( BrowserItemCapability )
395 Q_FLAG( BrowserItemCapabilities )
418 Q_ENUM( BrowserLayerType )
431 Q_ENUM( BrowserDirectoryMonitoring )
464 Q_ENUM( VectorExportResult )
472 SubsetStringFilter = 1 << 1,
473 GeometryColumn = 1 << 2,
474 PrimaryKeys = 1 << 3,
475 UnstableFeatureIds = 1 << 4
477 Q_ENUM( SqlLayerDefinitionCapability )
479 Q_DECLARE_FLAGS( SqlLayerDefinitionCapabilities, SqlLayerDefinitionCapability )
480 Q_FLAG( SqlLayerDefinitionCapabilities )
499 Q_ENUM( SqlKeywordCategory )
526 Q_ENUM( ActionStart )
538 Q_ENUM( UnplacedLabelVisibility )
548 AllowOverlapIfRequired,
549 AllowOverlapAtNoCost,
551 Q_ENUM( LabelOverlapHandling )
568 OrderedPositionsAroundPoint,
572 Q_ENUM( LabelPlacement )
597 Q_ENUM( LabelPredefinedPointPosition )
612 Q_ENUM( LabelOffsetType )
633 Q_ENUM( LabelQuadrantPosition )
648 Q_ENUM( UpsideDownLabelHandling )
665 Q_ENUM( LabelMultiLineAlignment )
675 ResolveGeometryType = 1 << 1,
676 CountFeatures = 1 << 2,
677 IncludeSystemTables = 1 << 3,
680 Q_DECLARE_FLAGS( SublayerQueryFlags, SublayerQueryFlag )
681 Q_ENUM( SublayerQueryFlag )
682 Q_FLAG( SublayerQueryFlags )
691 SystemTable = 1 << 0,
694 Q_DECLARE_FLAGS( SublayerFlags, SublayerFlag )
695 Q_ENUM( SublayerFlag )
696 Q_FLAG( SublayerFlags )
714 Q_ENUM( RasterPipeInterfaceRole )
727 Q_ENUM( RasterResamplingStage )
738 TooManyVerticesInFace,
744 Q_ENUM( MeshEditingErrorType )
756 Q_ENUM( FilePathType )
766 AskExcludingRasterBands,
770 Q_ENUM( SublayerPromptMode )
784 Q_ENUM( SelectBehavior )
796 FetchFeatureFailed = 3,
799 Q_ENUM( VectorEditResult )
808 SemiTransparentCircle,
812 Q_ENUM( VertexMarkerType )
826 Q_ENUM( ContentStatus )
846 Q_ENUM( GpsQualityIndicator )
862 Q_DECLARE_FLAGS( BabelFormatCapabilities, BabelFormatCapability )
863 Q_ENUM( BabelFormatCapability )
864 Q_FLAG( BabelFormatCapabilities )
874 QuoteFilePaths = 1 << 0,
877 Q_DECLARE_FLAGS( BabelCommandFlags, BabelCommandFlag )
878 Q_ENUM( BabelCommandFlag )
879 Q_FLAG( BabelCommandFlags )
892 Q_ENUM( GpsFeatureType )
904 NothingHappened = 1000,
906 InvalidInputGeometryType,
908 SelectionIsGreaterThanOne,
912 AddPartSelectedGeometryNotFound,
913 AddPartNotMultiGeometry,
917 AddRingCrossesExistingRings,
918 AddRingNotInExistingFeature,
920 SplitCannotSplitPoint,
922 Q_ENUM( GeometryOperationResult )
936 Q_FLAG( GeometryValidityFlags )
947 Q_ENUM( GeometryValidationEngine )
972 Q_ENUM( EndCapStyle )
998 Q_ENUM( SpatialFilterType )
1007 IncludeMetadataFile = 1 << 0,
1008 IncludeStyleFile = 1 << 1,
1011 Q_DECLARE_FLAGS( FileOperationFlags, FileOperationFlag )
1012 Q_ENUM( FileOperationFlag )
1013 Q_FLAG( FileOperationFlags )
1022 UsersCannotToggleEditing = 1 << 0,
1023 IsBasemapLayer = 1 << 1,
1026 Q_DECLARE_FLAGS( MapLayerProperties, MapLayerProperty )
1027 Q_ENUM( MapLayerProperty )
1028 Q_FLAG( MapLayerProperties )
1037 IsBasemapSource = 1 << 1,
1040 Q_DECLARE_FLAGS( DataProviderFlags, DataProviderFlag )
1041 Q_ENUM( DataProviderFlag )
1042 Q_FLAG( DataProviderFlags )
1094 Q_ENUM( CrsAxisDirection )
1107 Q_ENUM( CoordinateOrder )
1116 ScaleDependentBoundingBox = 1 << 0,
1119 Q_DECLARE_FLAGS( AnnotationItemFlags, AnnotationItemFlag )
1120 Q_ENUM( AnnotationItemFlag )
1121 Q_FLAG( AnnotationItemFlags )
1130 FlagNoCreationTools = 1 << 0,
1133 Q_DECLARE_FLAGS( AnnotationItemGuiFlags, AnnotationItemGuiFlag )
1134 Q_ENUM( AnnotationItemGuiFlag )
1135 Q_FLAG( AnnotationItemGuiFlags )
1146 Q_ENUM( AnnotationItemNodeType )
1159 Q_ENUM( AnnotationItemEditOperationResult )
1175 Q_ENUM( VectorTemporalMode )
1184 IncludeBeginExcludeEnd = 0,
1185 IncludeBeginIncludeEnd,
1187 Q_ENUM( VectorTemporalLimitMode )
1198 StoresFeatureDateTimeStartAndEndInSeparateFields
SIP_MONKEYPATCH_COMPAT_NAME( ProviderStoresFeatureDateTimeStartAndEndInSeparateFields ),
1200 Q_ENUM( VectorDataProviderTemporalMode )
1213 Q_ENUM( RasterTemporalMode )
1222 MatchUsingWholeRange,
1223 MatchExactUsingStartOfRange,
1224 MatchExactUsingEndOfRange,
1225 FindClosestMatchToStartOfRange,
1226 FindClosestMatchToEndOfRange
1228 Q_ENUM( TemporalIntervalMatchMethod )
1237 RequestedTimesMustExactlyMatchAllAvailableTemporalRanges = 1 << 0,
1239 Q_ENUM( RasterTemporalCapabilityFlag )
1246 Q_DECLARE_FLAGS( RasterTemporalCapabilityFlags, RasterTemporalCapabilityFlag )
1247 Q_ENUM( RasterTemporalCapabilityFlags )
1259 Q_ENUM( TransformDirection )
1268 BallparkTransformsAreAppropriate = 1 << 0,
1269 IgnoreImpossibleTransformations = 1 << 1,
1271 Q_ENUM( CoordinateTransformationFlag )
1278 Q_DECLARE_FLAGS( CoordinateTransformationFlags, CoordinateTransformationFlag )
1279 Q_ENUM( CoordinateTransformationFlags )
1288 Antialiasing = 0x01,
1289 DrawEditingInfo = 0x02,
1290 ForceVectorOutput = 0x04,
1291 UseAdvancedEffects = 0x08,
1292 DrawLabeling = 0x10,
1293 UseRenderingOptimization = 0x20,
1294 DrawSelection = 0x40,
1295 DrawSymbolBounds = 0x80,
1296 RenderMapTile = 0x100,
1297 RenderPartialOutput = 0x200,
1298 RenderPreviewJob = 0x400,
1299 RenderBlocking = 0x800,
1300 LosslessImageRendering = 0x1000,
1301 Render3DMap = 0x2000,
1302 HighQualityImageTransforms = 0x4000,
1303 SkipSymbolRendering = 0x8000,
1308 Q_FLAG( MapSettingsFlags )
1317 DrawEditingInfo = 0x01,
1318 ForceVectorOutput = 0x02,
1319 UseAdvancedEffects = 0x04,
1320 UseRenderingOptimization = 0x08,
1321 DrawSelection = 0x10,
1322 DrawSymbolBounds = 0x20,
1323 RenderMapTile = 0x40,
1324 Antialiasing = 0x80,
1325 RenderPartialOutput = 0x100,
1326 RenderPreviewJob = 0x200,
1327 RenderBlocking = 0x400,
1328 RenderSymbolPreview = 0x800,
1329 LosslessImageRendering = 0x1000,
1330 ApplyScalingWorkaroundForTextRendering = 0x2000,
1331 Render3DMap = 0x4000,
1332 ApplyClipAfterReprojection = 0x8000,
1333 RenderingSubSymbol = 0x10000,
1334 HighQualityImageTransforms = 0x20000,
1335 SkipSymbolRendering = 0x40000,
1340 Q_FLAG( RenderContextFlags )
1354 Q_ENUM( TextRenderFormat )
1368 Q_ENUM( RenderSubcomponentProperty )
1379 Q_ENUM( VertexType )
1395 EquilateralTriangle,
1420 Q_ENUM( MarkerShape )
1433 LastVertex = 1 << 2,
1434 FirstVertex = 1 << 3,
1435 CentralPoint = 1 << 4,
1436 CurvePoint = 1 << 5,
1437 SegmentCenter = 1 << 6,
1438 InnerVertices = 1 << 7,
1440 Q_ENUM( MarkerLinePlacement )
1441 Q_DECLARE_FLAGS( MarkerLinePlacements, MarkerLinePlacement )
1442 Q_FLAG( MarkerLinePlacements )
1456 Q_ENUM( GradientColorSource )
1471 Q_ENUM( GradientType )
1485 Q_ENUM( SymbolCoordinateReference )
1501 Q_ENUM( GradientSpread )
1515 Q_ENUM( PointCountMethod )
1529 Q_ENUM( MarkerClipMode )
1542 Q_ENUM( LineClipMode )
1557 Q_ENUM( DashPatternLineEndingRule )
1566 ScaleBothDashAndGap,
1570 Q_ENUM( DashPatternSizeAdjustment )
1584 Q_ENUM( GraduatedMethod )
1615 ForceFirstLetterToCapital = 4,
1618 UpperCamelCase = 1005,
1619 AllSmallCaps = 1006,
1621 Q_ENUM( Capitalization )
1632 Q_ENUM( TextRendererFlag )
1633 Q_DECLARE_FLAGS( TextRendererFlags, TextRendererFlag )
1634 Q_FLAG( TextRendererFlags )
1658 Q_ENUM( AngularDirection )
1671 Q_ENUM( RendererUsage )
1680 Sync3DTo2D = 1 << 0,
1681 Sync2DTo3D = 1 << 1,
1683 Q_ENUM( ViewSyncModeFlag )
1684 Q_DECLARE_FLAGS( ViewSyncModeFlags, ViewSyncModeFlag )
1693 LocalProfile = 1 << 0,
1696 Q_ENUM( HistoryProviderBackend )
1697 Q_DECLARE_FLAGS( HistoryProviderBackends, HistoryProviderBackend )
1698 Q_FLAG( HistoryProviderBackends )
1710 Q_ENUM( CrsDefinitionFormat )
1726 Q_ENUM( FieldDomainSplitPolicy )
1742 Q_ENUM( FieldDomainMergePolicy )
1755 Q_ENUM( FieldDomainType )
1765 AutomaticGroups = 1,
1768 Q_ENUM( TransactionMode )
1781 Q_ENUM( AltitudeClamping )
1793 Q_ENUM( AltitudeBinding )
1806 Q_ENUM( BetweenLineConstraint )
1819 Q_ENUM( LineExtensionSide )
1828 EvaluateDefaultValuesOnProviderSide = 1 << 0,
1829 TrustStoredLayerStatistics = 1 << 1,
1830 RememberLayerEditStatusBetweenSessions = 1 << 2,
1831 RememberAttributeTableWindowsBetweenSessions = 1 << 3,
1833 Q_ENUM( ProjectFlag )
1834 Q_DECLARE_FLAGS( ProjectFlags, ProjectFlag )
1835 Q_FLAG( ProjectFlags )
1844 ShowContextMenu = 1 << 0,
1846 Q_ENUM( PlotToolFlag )
1847 Q_DECLARE_FLAGS( PlotToolFlags, PlotToolFlag )
1848 Q_FLAG( PlotToolFlags )
1860 Q_ENUM( LightSourceType )
1893 RespectsMaximumErrorMapUnit = 1 << 0,
1894 RespectsDistanceRange = 1 << 1,
1895 RespectsElevationRange = 1 << 2,
1897 Q_ENUM( ProfileGeneratorFlag )
1898 Q_DECLARE_FLAGS( ProfileGeneratorFlags, ProfileGeneratorFlag )
1899 Q_FLAG( ProfileGeneratorFlags )
1911 Q_ENUM( PointCloudSymbol )
1924 Q_ENUM( PointCloudDrawOrder )
1936 AvoidIntersectionsCurrentLayer,
1937 AvoidIntersectionsLayers,
1939 Q_ENUM( AvoidIntersectionsMode )
1953 Q_ENUM( ProjectFileFormat )
1969 DontLoadProjectStyles = 1 << 5,
1971 Q_ENUM( ProjectReadFlag )
1981 Q_FLAG( ProjectReadFlags )
1987 static const
double DEFAULT_SEARCH_RADIUS_MM;
1990 static const
float DEFAULT_MAPTOPIXEL_THRESHOLD;
1998 static const QColor DEFAULT_HIGHLIGHT_COLOR;
2004 static const
double DEFAULT_HIGHLIGHT_BUFFER_MM;
2010 static const
double DEFAULT_HIGHLIGHT_MIN_WIDTH_MM;
2018 static const
double SCALE_PRECISION;
2025 static const
double DEFAULT_Z_COORDINATE;
2032 static const
double DEFAULT_M_COORDINATE;
2039 static const
double UI_SCALE_FACTOR;
2045 static const
double DEFAULT_SNAP_TOLERANCE;
2058 static QString defaultProjectScales();
2065 static
int geosVersionInt();
2072 static
int geosVersionMajor();
2079 static
int geosVersionMinor();
2086 static
int geosVersionPatch();
2093 static QString geosVersion();
2132 #define cast_to_fptr(f) f
2154 , mPreviousState( object->blockSignals( true ) )
2159 mObject->blockSignals( mPreviousState );
2167 Object *mObject =
nullptr;
2168 bool mPreviousState;
2192 CORE_EXPORT uint
qHash(
const QVariant &variant );
2206 const double roundFactor = std::pow( 10, -
precision );
2207 str = QString::number(
static_cast< long long >( std::round( a / roundFactor ) * roundFactor ) );
2212 if (
str.contains( QLatin1Char(
'.' ) ) )
2215 int idx =
str.length() - 1;
2216 while (
str.at( idx ) ==
'0' && idx > 1 )
2220 if ( idx <
str.length() - 1 )
2221 str.truncate(
str.at( idx ) ==
'.' ? idx : idx + 1 );
2231 if (
str == QLatin1String(
"-0" ) )
2233 return QLatin1String(
"0" );
2246 const bool aIsNan = std::isnan( a );
2247 const bool bIsNan = std::isnan( b );
2248 if ( aIsNan || bIsNan )
2249 return aIsNan && bIsNan;
2260 inline bool qgsDoubleNear(
double a,
double b,
double epsilon = 4 * std::numeric_limits<double>::epsilon() )
2262 const bool aIsNan = std::isnan( a );
2263 const bool bIsNan = std::isnan( b );
2264 if ( aIsNan || bIsNan )
2265 return aIsNan && bIsNan;
2267 const double diff = a - b;
2268 return diff > -epsilon && diff <= epsilon;
2277 inline bool qgsFloatNear(
float a,
float b,
float epsilon = 4 * FLT_EPSILON )
2279 const bool aIsNan = std::isnan( a );
2280 const bool bIsNan = std::isnan( b );
2281 if ( aIsNan || bIsNan )
2282 return aIsNan && bIsNan;
2284 const float diff = a - b;
2285 return diff > -epsilon && diff <= epsilon;
2291 const bool aIsNan = std::isnan( a );
2292 const bool bIsNan = std::isnan( b );
2293 if ( aIsNan || bIsNan )
2294 return aIsNan && bIsNan;
2302 const double ar = std::frexp( a, &aexp );
2303 const double br = std::frexp( b, &bexp );
2305 return aexp == bexp &&
2316 const double m = ( number < 0.0 ) ? -1.0 : 1.0;
2317 const double scaleFactor = std::pow( 10.0, places );
2318 return ( std::round( number * m * scaleFactor ) / scaleFactor ) * m;
2350 template<
typename To,
typename From>
inline To down_cast( From *f )
2353 ( std::is_base_of<From,
2354 typename std::remove_pointer<To>::type>::value ),
2355 "target type not derived from source type" );
2356 Q_ASSERT( f ==
nullptr ||
dynamic_cast<To
>( f ) !=
nullptr );
2357 return static_cast<To
>( f );
2361 QSet<T> listToSet(
const QList<T> &list )
2363 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
2364 return list.toSet();
2366 return QSet<T>( list.begin(), list.end() );
2371 QList<T> setToList(
const QSet<T> &set )
2373 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
2374 return set.toList();
2376 return QList<T>( set.begin(), set.end() );
2381 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
2384 template<>
struct hash<QString>
2386 std::size_t operator()(
const QString &s )
const noexcept
2388 return (
size_t )
qHash( s );
2403 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2404 Q_ASSERT( metaEnum.isValid() );
2406 for (
int idx = 0; idx < metaEnum.keyCount(); ++idx )
2408 enumList.append(
static_cast<T
>( metaEnum.value( idx ) ) );
2420 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2421 Q_ASSERT( metaEnum.isValid() );
2422 QMap<T, QString> enumMap;
2423 for (
int idx = 0; idx < metaEnum.keyCount(); ++idx )
2425 enumMap.insert(
static_cast<T
>( metaEnum.value( idx ) ), QString( metaEnum.key( idx ) ) );
2437 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2438 Q_ASSERT( metaEnum.isValid() );
2439 const char *key = metaEnum.valueToKey(
static_cast<int>( value ) );
2442 *returnOk = key ? true :
false;
2444 return QString::fromUtf8( key );
2454 template<
class T> T
qgsEnumKeyToValue(
const QString &key,
const T &defaultValue,
bool tryValueAsKey =
true,
bool *returnOk =
nullptr )
SIP_SKIP
2456 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2457 Q_ASSERT( metaEnum.isValid() );
2459 T v =
static_cast<T
>( metaEnum.keyToValue( key.toUtf8().data(), &ok ) );
2471 if ( tryValueAsKey )
2473 bool canConvert =
false;
2474 const int intValue = key.toInt( &canConvert );
2475 if ( canConvert && metaEnum.valueToKey( intValue ) )
2481 return static_cast<T
>( intValue );
2485 return defaultValue;
2495 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2496 Q_ASSERT( metaEnum.isValid() );
2497 int intValue =
static_cast<int>( value );
2498 const QByteArray ba = metaEnum.valueToKeys( intValue );
2501 const int intValueCheck = metaEnum.keysToValue( ba );
2502 bool ok = intValue == intValueCheck;
2505 return ok ? QString::fromUtf8( ba ) : QString();
2515 template<
class T> T
qgsFlagKeysToValue(
const QString &keys,
const T &defaultValue,
bool tryValueAsKey =
true,
bool *returnOk =
nullptr )
SIP_SKIP
2517 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
2518 Q_ASSERT( metaEnum.isValid() );
2520 T v =
static_cast<T
>( metaEnum.keysToValue( keys.toUtf8().constData(), &ok ) );
2532 if ( tryValueAsKey )
2534 bool canConvert =
false;
2535 const int intValue = keys.toInt( &canConvert );
2538 const QByteArray keys = metaEnum.valueToKeys( intValue );
2539 const int intValueCheck = metaEnum.keysToValue( keys );
2540 if ( intValue == intValueCheck )
2546 return T( intValue );
2551 return defaultValue;
2607 CORE_EXPORT
bool qgsVariantEqual(
const QVariant &lhs,
const QVariant &rhs );
2617 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
2625 inline bool operator> (
const QVariant &v1,
const QVariant &v2 )
2639 inline bool operator< (
const QVariant &v1,
const QVariant &v2 )
2646 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
2651 template<> CORE_EXPORT
bool qMapLessThanKey<QVariantList>(
const QVariantList &key1,
const QVariantList &key2 )
SIP_SKIP;
2654 CORE_EXPORT QString
qgsVsiPrefix(
const QString &path );
2672 #define CONSTLATIN1STRING inline const QLatin1String
2674 #define CONSTLATIN1STRING constexpr QLatin1String
2678 class ScopedIntIncrementor
2682 ScopedIntIncrementor(
int *variable )
2683 : mVariable( variable )
2688 ScopedIntIncrementor(
const ScopedIntIncrementor &other ) =
delete;
2689 ScopedIntIncrementor &operator=(
const ScopedIntIncrementor &other ) =
delete;
2696 mVariable =
nullptr;
2699 ~ScopedIntIncrementor()
2705 int *mVariable =
nullptr;
2715 return QLatin1String(
2716 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]] )"""
2723 return QLatin1String(
"+proj=longlat +datum=WGS84 +no_defs" );
2729 return QLatin1String(
"EPSG:4326" );
2735 return QLatin1String(
"NONE" );
2741 const int PREVIEW_JOB_DELAY_MS = 250;
2744 const int MAXIMUM_LAYER_PREVIEW_TIME_MS = 250;
2789 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
2791 #define Q_NOWARN_DEPRECATED_PUSH \
2792 _Pragma("GCC diagnostic push") \
2793 _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
2794 #define Q_NOWARN_DEPRECATED_POP \
2795 _Pragma("GCC diagnostic pop");
2796 #define Q_NOWARN_UNREACHABLE_PUSH
2797 #define Q_NOWARN_UNREACHABLE_POP
2799 #elif defined(_MSC_VER)
2801 #define Q_NOWARN_DEPRECATED_PUSH \
2802 __pragma(warning(push)) \
2803 __pragma(warning(disable:4996))
2804 #define Q_NOWARN_DEPRECATED_POP \
2805 __pragma(warning(pop))
2806 #define Q_NOWARN_UNREACHABLE_PUSH \
2807 __pragma(warning(push)) \
2808 __pragma(warning(disable:4702))
2809 #define Q_NOWARN_UNREACHABLE_POP \
2810 __pragma(warning(pop))
2814 #define Q_NOWARN_DEPRECATED_PUSH
2815 #define Q_NOWARN_DEPRECATED_POP
2816 #define Q_NOWARN_UNREACHABLE_PUSH
2817 #define Q_NOWARN_UNREACHABLE_POP
2824 # define QGISEXTERN extern "C" __declspec( dllexport )
2826 # if defined(__GNUC__) || defined(__clang__)
2827 # define QGISEXTERN extern "C" __attribute__ ((visibility ("default")))
2829 # define QGISEXTERN extern "C"
2835 #if __cplusplus >= 201500
2836 #define FALLTHROUGH [[fallthrough]];
2837 #elif defined(__clang__)
2838 #define FALLTHROUGH [[clang::fallthrough]];
2839 #elif defined(__GNUC__) && __GNUC__ >= 7
2840 #define FALLTHROUGH [[gnu::fallthrough]];
2846 #if __cplusplus >= 201703L
2847 #define NODISCARD [[nodiscard]]
2848 #elif defined(__clang__)
2849 #define NODISCARD [[nodiscard]]
2850 #elif defined(_MSC_VER)
2852 #elif defined(__has_cpp_attribute)
2853 #if __has_cpp_attribute(nodiscard)
2854 #define NODISCARD [[nodiscard]]
2855 #elif __has_cpp_attribute(gnu::warn_unused_result)
2856 #define NODISCARD [[gnu::warn_unused_result]]
2858 #define NODISCARD Q_REQUIRED_RESULT
2861 #define NODISCARD Q_REQUIRED_RESULT
2864 #if __cplusplus >= 201703L
2865 #define MAYBE_UNUSED [[maybe_unused]]
2866 #elif defined(__clang__)
2867 #define MAYBE_UNUSED [[maybe_unused]]
2868 #elif defined(_MSC_VER)
2869 #define MAYBE_UNUSED
2870 #elif defined(__has_cpp_attribute)
2871 #if __has_cpp_attribute(gnu::unused)
2872 #define MAYBE_UNUSED [[gnu::unused]]
2874 #define MAYBE_UNUSED
2877 #define MAYBE_UNUSED
2886 #define BUILTIN_UNREACHABLE \
2888 #elif defined(__GNUC__) && !defined(__clang__)
2899 #define BUILTIN_UNREACHABLE \
2900 __builtin_unreachable();
2902 #define BUILTIN_UNREACHABLE
2912 QString CORE_EXPORT
geoWkt();
2921 QString CORE_EXPORT
geoNone();
The Qgis class provides global constants for use throughout the application.
SettingsOption
Settings options.
ProfileGeneratorFlag
Flags that control the way the QgsAbstractProfileGenerator operate.
GpsQualityIndicator
GPS signal quality indicator.
ProjectReadFlag
Flags which control project read behavior.
PointCloudSymbol
Rendering symbols for point cloud points.
GeometryValidityFlag
Geometry validity check flags.
MapLayerProperty
File operation flags.
BufferSide
Side of line to buffer.
RasterResamplingStage
Stage at which raster resampling occurs.
AltitudeClamping
Altitude clamping.
VectorTemporalMode
Vector layer temporal feature modes.
SublayerFlag
Sublayer query flags.
DashPatternSizeAdjustment
Dash pattern size adjustment options.
AnnotationItemNodeType
Annotation item GUI flags.
static const char * QGIS_DEV_VERSION
The development version.
AngularDirection
Angular directions.
ContentStatus
Status for fetched or stored content.
SnappingType
SnappingTypeFlag defines on what object the snapping is performed.
MarkerLinePlacement
Defines how/where the symbols should be placed on a line.
GeometryOperationResult
Success or failure of a geometry operation.
BrowserItemState
Browser item states.
MarkerClipMode
Marker clipping modes.
AnnotationItemFlag
Flags for annotation items.
RenderSubcomponentProperty
Rendering subcomponent properties.
SymbolRenderHint
Flags controlling behavior of symbols during rendering.
CaptureTechnique
Capture technique.
BrowserItemCapability
Browser item capabilities.
LineClipMode
Line clipping modes.
BrowserDirectoryMonitoring
Browser directory item monitoring switches.
LabelOffsetType
Behavior modifier for label offset and distance, only applies in some label placement modes.
GradientColorSource
Gradient color sources.
LabelPlacement
Placement modes which determine how label candidates are generated for a feature.
VectorExportResult
Vector layer export result codes.
RasterTemporalCapabilityFlag
Flags for raster layer temporal capabilities.
SymbolLayerFlag
Flags controlling behavior of symbol layers.
GradientSpread
Gradient spread options, which control how gradients are rendered outside of their start and end poin...
ScaleMethod
Scale methods.
FilePathType
File path types.
PointCountMethod
Methods which define the number of points randomly filling a polygon.
VertexType
Types of vertex.
DataProviderFlag
Map layer properties.
GeometryValidationEngine
Available engines for validating geometries.
TransactionMode
Transaction mode.
Q_ENUM(ScaleToTileZoomLevelMethod)
ViewSyncModeFlag
Synchronization of 2D map canvas and 3D view.
FileOperationFlag
File operation flags.
Q_ENUM(VectorProfileType)
FieldDomainMergePolicy
Merge policy for field domains.
MessageLevel
Level for messages This will be used both for message log and message bar in application.
SqlKeywordCategory
SQL layer definition capabilities.
GraduatedMethod
Methods for modifying symbols by range in a graduated symbol renderer.
MeshEditingErrorType
Type of error that can occur during mesh frame editing.
FieldDomainSplitPolicy
Split policy for field domains.
AnnotationItemEditOperationResult
Results from an edit operation on an annotation item.
ActionStart
Enum to determine when an operation would begin.
AvoidIntersectionsMode
Flags which control how intersections of pre-existing feature are handled when digitizing new feature...
MarkerShape
Marker shapes.
Capitalization
String capitalization options.
TemporalIntervalMatchMethod
Method to use when resolving a temporal range to a data provider layer or band.
LabelQuadrantPosition
Label quadrant positions.
ScaleToTileZoomLevelMethod
Available methods for converting map scales to tile zoom levels.
SublayerQueryFlag
Flags which control how data providers will scan for sublayers in a dataset.
PythonMacroMode
Vector layer type flags.
UnplacedLabelVisibility
Unplaced label visibility.
CrsDefinitionFormat
CRS definition formats.
SpatialFilterType
Feature request spatial filter types.
ProjectFlag
Flags which control the behavior of QgsProjects.
BrowserItemType
Symbol layer flags.
SettingsType
Types of settings entries.
RasterTemporalMode
Raster layer temporal modes.
JoinStyle
Join styles for buffers.
PointCloudDrawOrder
Pointcloud rendering order for 2d views.
BrowserLayerType
Browser item layer types.
AltitudeBinding
Altitude binding.
LabelMultiLineAlignment
Text alignment for multi-line labels.
VectorDataProviderTemporalMode
Vector data provider temporal handling modes.
TextRenderFormat
Options for rendering text.
DataType
Raster data types.
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.
CoordinateOrder
Order of coordinates.
EndCapStyle
End cap styles for buffers.
BabelCommandFlag
Babel GPS format capabilities.
FieldDomainType
Types of field domain.
RenderContextFlag
Flags which affect rendering operations.
RasterPipeInterfaceRole
Sublayer flags.
SymbolPreviewFlag
Symbol flags.
AnnotationItemGuiFlag
Annotation item flags.
DashPatternLineEndingRule
Dash pattern line ending rules.
VertexMarkerType
Editing vertex markers, used for showing vertices during a edit operation.
HistoryProviderBackend
History provider backends.
SublayerPromptMode
Specifies how to handle layer sources with multiple sublayers.
GradientType
Gradient types.
VectorProfileType
Types of elevation profiles to generate for vector sources.
GpsFeatureType
Babel command flags.
VectorLayerTypeFlag
Vector layer type flags.
VectorTemporalLimitMode
Mode for the handling of the limits of the filtering timeframe for vector features.
SqlLayerDefinitionCapability
SqlLayerDefinitionCapability enum lists the arguments supported by the provider when creating SQL que...
VectorEditResult
Specifies the result of a vector layer edit operation.
Q_DECLARE_FLAGS(GeometryValidityFlags, GeometryValidityFlag) SIP_MONKEYPATCH_FLAGS_UNNEST(QgsGeometry
Geometry validity flags.
ProjectFileFormat
Flags which control project read behavior.
SnappingMode
SnappingMode defines on which layer the snapping is performed.
ProfileSurfaceSymbology
Surface symbology type for elevation profile plots.
RendererUsage
Usage of the renderer.
BabelFormatCapability
Babel GPS format capabilities.
BetweenLineConstraint
Between line constraints which can be enabled.
SymbolFlag
Flags controlling behavior of symbols.
LineExtensionSide
Designates whether the line extension constraint is currently soft locked with the previous or next v...
HttpMethod
Different methods of HTTP requests.
SymbolCoordinateReference
Symbol coordinate reference modes.
TextRendererFlag
Flags which control the behavior of rendering text.
CrsAxisDirection
Data provider flags.
LabelOverlapHandling
Label overlap handling.
CoordinateTransformationFlag
Flags which adjust the coordinate transformations behave.
TransformDirection
Flags for raster layer temporal capabilities.
LightSourceType
Light source types for 3D scenes.
LabelPredefinedPointPosition
Positions for labels when using the Qgis::LabelPlacement::OrderedPositionsAroundPoint placement mode.
UpsideDownLabelHandling
Handling techniques for upside down labels.
Q_DECLARE_FLAGS(MapSettingsFlags, MapSettingsFlag) SIP_MONKEYPATCH_FLAGS_UNNEST(QgsMapSettings
Map settings flags.
MapSettingsFlag
Coordinate transformation flags.
SelectBehavior
Specifies how a selection should be applied.
This class represents a coordinate reference system (CRS).
Abstract base class for curved geometry type.
Base class for all items in the model.
A geometry is the spatial representation of a feature.
Item that represents a layer that can be opened with one of the providers.
Base class for all map layer types.
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,...
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.
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.
QgsSignalBlocker(Object *object)
Constructor for QgsSignalBlocker.
Object * operator->()
Returns pointer to blocked QObject.
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.
Base class for templated line symbols, e.g.
This is the class is providing tolerance value in map unit values.
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.
QgsMapLayerType
Types of layers that can be added to a map.
@ 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
CONSTLATIN1STRING geoNone()
Constant that holds the string representation for "No ellips/No CRS".
const double DEFAULT_LINE_WIDTH
CORE_EXPORT uint qHash(const QVariant &variant)
Hash for QVariant.
bool operator>(const QVariant &v1, const QVariant &v2)
Compares two QVariant values and returns whether the first is greater than the second.
CORE_EXPORT QString qgsVsiPrefix(const QString &path)
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...
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.
void CORE_EXPORT * qgsMalloc(size_t size)
Allocates size bytes and returns a pointer to the allocated memory.
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
QString qgsEnumValueToKey(const T &value, bool *returnOk=nullptr)
Returns the value for the given key of an enum.
QString qgsFlagValueToKeys(const T &value, bool *returnOk=nullptr)
Returns the value for the given keys of a flag.
const QMap< T, QString > qgsEnumMap()
Returns a map of all enum entries.
const long GEO_EPSG_CRS_ID
Magic number for a geographic coord sys in EpsgCrsId ID format.
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.
CORE_EXPORT bool qgsVariantGreaterThan(const QVariant &lhs, const QVariant &rhs)
Compares two QVariant values and returns whether the first is greater than the second.
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...
bool qgsFloatNear(float a, float b, float epsilon=4 *FLT_EPSILON)
Compare two floats (but allow some difference)
const QList< T > qgsEnumList()
Returns a list all enum entries.
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...
double qgsRound(double number, int places)
Returns a double number, rounded (as close as possible) to the specified number of places.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
CONSTLATIN1STRING geoProj4()
PROJ4 string that represents a geographic coord sys.
bool qgsNanCompatibleEquals(double a, double b)
Compare two doubles, treating nan values as equal.
const double DEFAULT_SEGMENT_EPSILON
Default snapping tolerance for segments.
QMap< QString, QString > QgsStringMap
#define CONSTLATIN1STRING
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
CONSTLATIN1STRING geoWkt()
Wkt string that represents a geographic coord sys.
bool qgsDoubleNearSig(double a, double b, int significantDigits=10)
Compare two doubles using specified number of significant digits.
const int USER_CRS_START_ID
Magick number that determines whether a projection crsid is a system (srs.db) or user (~/....
void CORE_EXPORT qgsFree(void *ptr)
Frees the memory space pointed to by ptr.
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...
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...
CORE_EXPORT bool qgsVariantLessThan(const QVariant &lhs, const QVariant &rhs)
Compares two QVariant values and returns whether the first is less than the second.
const long GEOSRID
Magic number for a geographic coord sys in POSTGIS SRID.
#define QHASH_FOR_CLASS_ENUM(T)
bool operator<(const QVariant &v1, const QVariant &v2)
Compares two QVariant values and returns whether the first is less than the second.
CONSTLATIN1STRING geoEpsgCrsAuthId()
Geographic coord sys from EPSG authority.
const long GEOCRS_ID
Magic number for a geographic coord sys in QGIS srs.db tbl_srs.srs_id.
const double DEFAULT_POINT_SIZE
Magic number that determines the default point size for point symbols.
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
#define SIP_MONKEYPATCH_FLAGS_UNNEST(OUTSIDE_CLASS, FORMERNAME)
#define SIP_MONKEYPATCH_SCOPEENUM
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)
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.
Utility class for identifying a unique vertex within a geometry.