QGIS API Documentation  3.19.0-Master (393d60bf25)
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 #include <QMetaEnum>
22 #include <cfloat>
23 #include <memory>
24 #include <cmath>
25 
26 #include "qgstolerance.h"
27 #include "qgis_core.h"
28 #include "qgis_sip.h"
29 
30 #ifdef SIP_RUN
31 % ModuleHeaderCode
32 #include <qgis.h>
33 % End
34 
35 % ModuleCode
36 int QgisEvent = QEvent::User + 1;
37 % End
38 #endif
39 
40 
45 class CORE_EXPORT Qgis
46 {
47  Q_GADGET
48  public:
49 
55  static QString version();
56 
62  static int versionInt();
63 
69  static QString releaseName();
70 
72  static const char *QGIS_DEV_VERSION;
73 
79  static QString devVersion();
80 
81  // Enumerations
82  //
83 
89  {
90  Info = 0,
91  Warning = 1,
92  Critical = 2,
93  Success = 3,
94  None = 4
95  };
96 
101  enum DataType
102  {
103  UnknownDataType = 0,
104  Byte = 1,
105  UInt16 = 2,
106  Int16 = 3,
107  UInt32 = 4,
108  Int32 = 5,
109  Float32 = 6,
110  Float64 = 7,
111  CInt16 = 8,
112  CInt32 = 9,
113  CFloat32 = 10,
114  CFloat64 = 11,
115  ARGB32 = 12,
116  ARGB32_Premultiplied = 13
117  };
118  Q_ENUM( DataType )
119 
120 
125  {
126  Never = 0,
127  Ask = 1,
128  SessionOnly = 2,
129  Always = 3,
131  };
132  Q_ENUM( PythonMacroMode )
133 
134 
138  static const double DEFAULT_SEARCH_RADIUS_MM;
139 
141  static const float DEFAULT_MAPTOPIXEL_THRESHOLD;
142 
149  static const QColor DEFAULT_HIGHLIGHT_COLOR;
150 
155  static const double DEFAULT_HIGHLIGHT_BUFFER_MM;
156 
161  static const double DEFAULT_HIGHLIGHT_MIN_WIDTH_MM;
162 
169  static const double SCALE_PRECISION;
170 
176  static const double DEFAULT_Z_COORDINATE;
177 
183  static const double UI_SCALE_FACTOR;
184 
189  static const double DEFAULT_SNAP_TOLERANCE;
190 
195  static const QgsTolerance::UnitType DEFAULT_SNAP_UNITS;
196 
202  static QString defaultProjectScales();
203 
209  static int geosVersionInt();
210 
216  static int geosVersionMajor();
217 
223  static int geosVersionMinor();
224 
230  static int geosVersionPatch();
231 
237  static QString geosVersion();
238 };
239 
240 // hack to workaround warnings when casting void pointers
241 // retrieved from QLibrary::resolve to function pointers.
242 // It's assumed that this works on all systems supporting
243 // QLibrary
244 #define cast_to_fptr(f) f
245 
246 
255 // based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
256 template<class Object> class QgsSignalBlocker SIP_SKIP SIP_SKIP // clazy:exclude=rule-of-three
257 {
258  public:
259 
264  explicit QgsSignalBlocker( Object *object )
265  : mObject( object )
266  , mPreviousState( object->blockSignals( true ) )
267  {}
268 
270  {
271  mObject->blockSignals( mPreviousState );
272  }
273 
275  Object *operator->() { return mObject; }
276 
277  private:
278 
279  Object *mObject = nullptr;
280  bool mPreviousState;
281 
282 };
283 
297 // based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
298 template<class Object> inline QgsSignalBlocker<Object> whileBlocking( Object *object ) SIP_SKIP SIP_SKIP
299 {
300  return QgsSignalBlocker<Object>( object );
301 }
302 
304 CORE_EXPORT uint qHash( const QVariant &variant );
305 
311 inline QString qgsDoubleToString( double a, int precision = 17 )
312 {
313  QString str = QString::number( a, 'f', precision );
314  if ( precision )
315  {
316  if ( str.contains( QLatin1Char( '.' ) ) )
317  {
318  // remove ending 0s
319  int idx = str.length() - 1;
320  while ( str.at( idx ) == '0' && idx > 1 )
321  {
322  idx--;
323  }
324  if ( idx < str.length() - 1 )
325  str.truncate( str.at( idx ) == '.' ? idx : idx + 1 );
326  }
327  }
328  // avoid printing -0
329  // see https://bugreports.qt.io/browse/QTBUG-71439
330  if ( str == QLatin1String( "-0" ) )
331  {
332  return QLatin1String( "0" );
333  }
334  return str;
335 }
336 
343 inline bool qgsDoubleNear( double a, double b, double epsilon = 4 * std::numeric_limits<double>::epsilon() )
344 {
345  if ( std::isnan( a ) || std::isnan( b ) )
346  return std::isnan( a ) && std::isnan( b ) ;
347 
348  const double diff = a - b;
349  return diff > -epsilon && diff <= epsilon;
350 }
351 
358 inline bool qgsFloatNear( float a, float b, float epsilon = 4 * FLT_EPSILON )
359 {
360  if ( std::isnan( a ) || std::isnan( b ) )
361  return std::isnan( a ) && std::isnan( b ) ;
362 
363  const float diff = a - b;
364  return diff > -epsilon && diff <= epsilon;
365 }
366 
368 inline bool qgsDoubleNearSig( double a, double b, int significantDigits = 10 )
369 {
370  if ( std::isnan( a ) || std::isnan( b ) )
371  return std::isnan( a ) && std::isnan( b ) ;
372 
373  // The most simple would be to print numbers as %.xe and compare as strings
374  // but that is probably too costly
375  // Then the fastest would be to set some bits directly, but little/big endian
376  // has to be considered (maybe TODO)
377  // Is there a better way?
378  int aexp, bexp;
379  double ar = std::frexp( a, &aexp );
380  double br = std::frexp( b, &bexp );
381 
382  return aexp == bexp &&
383  std::round( ar * std::pow( 10.0, significantDigits ) ) == std::round( br * std::pow( 10.0, significantDigits ) );
384 }
385 
391 inline double qgsRound( double number, int places )
392 {
393  double m = ( number < 0.0 ) ? -1.0 : 1.0;
394  double scaleFactor = std::pow( 10.0, places );
395  return ( std::round( number * m * scaleFactor ) / scaleFactor ) * m;
396 }
397 
398 
399 #ifndef SIP_RUN
400 
402 
412 namespace qgis
413 {
414 
427  template<typename To, typename From> inline To down_cast( From *f )
428  {
429  static_assert(
430  ( std::is_base_of<From,
431  typename std::remove_pointer<To>::type>::value ),
432  "target type not derived from source type" );
433  Q_ASSERT( f == nullptr || dynamic_cast<To>( f ) != nullptr );
434  return static_cast<To>( f );
435  }
436 
437  template<class T>
438  QSet<T> listToSet( const QList<T> &list )
439  {
440 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
441  return list.toSet();
442 #else
443  return QSet<T>( list.begin(), list.end() );
444 #endif
445  }
446 
447  template<class T>
448  QList<T> setToList( const QSet<T> &set )
449  {
450 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
451  return set.toList();
452 #else
453  return QList<T>( set.begin(), set.end() );
454 #endif
455  }
456 }
458 #endif
459 
465 template<class T> const QMap<T, QString> qgsEnumMap() SIP_SKIP
466 {
467  QMetaEnum metaEnum = QMetaEnum::fromType<T>();
468  Q_ASSERT( metaEnum.isValid() );
469  QMap<T, QString> enumMap;
470  for ( int idx = 0; idx < metaEnum.keyCount(); ++idx )
471  {
472  const char *enumKey = metaEnum.key( idx );
473  enumMap.insert( static_cast<T>( metaEnum.keyToValue( enumKey ) ), QString( enumKey ) );
474  }
475  return enumMap;
476 }
477 
482 template<class T> QString qgsEnumValueToKey( const T &value ) SIP_SKIP
483 {
484  QMetaEnum metaEnum = QMetaEnum::fromType<T>();
485  Q_ASSERT( metaEnum.isValid() );
486  return QString::fromUtf8( metaEnum.valueToKey( static_cast<int>( value ) ) );
487 }
488 
495 template<class T> T qgsEnumKeyToValue( const QString &key, const T &defaultValue, bool tryValueAsKey = true ) SIP_SKIP
496 {
497  QMetaEnum metaEnum = QMetaEnum::fromType<T>();
498  Q_ASSERT( metaEnum.isValid() );
499  bool ok = false;
500  T v = static_cast<T>( metaEnum.keyToValue( key.toUtf8().data(), &ok ) );
501  if ( ok )
502  {
503  return v;
504  }
505  else
506  {
507  // if conversion has failed, try with conversion from int value
508  if ( tryValueAsKey )
509  {
510  bool canConvert = false;
511  int intValue = key.toInt( &canConvert );
512  if ( canConvert && metaEnum.valueToKey( intValue ) )
513  {
514  return static_cast<T>( intValue );
515  }
516  }
517  }
518  return defaultValue;
519 }
520 
525 template<class T> QString qgsFlagValueToKeys( const T &value ) SIP_SKIP
526 {
527  QMetaEnum metaEnum = QMetaEnum::fromType<T>();
528  Q_ASSERT( metaEnum.isValid() );
529  return QString::fromUtf8( metaEnum.valueToKeys( static_cast<int>( value ) ) );
530 }
531 
537 template<class T> T qgsFlagKeysToValue( const QString &keys, const T &defaultValue ) SIP_SKIP
538 {
539  QMetaEnum metaEnum = QMetaEnum::fromType<T>();
540  Q_ASSERT( metaEnum.isValid() );
541  bool ok = false;
542  T v = static_cast<T>( metaEnum.keysToValue( keys.toUtf8().constData(), &ok ) );
543  if ( ok )
544  return v;
545  else
546  return defaultValue;
547 }
548 
549 
559 CORE_EXPORT double qgsPermissiveToDouble( QString string, bool &ok );
560 
570 CORE_EXPORT int qgsPermissiveToInt( QString string, bool &ok );
571 
581 CORE_EXPORT qlonglong qgsPermissiveToLongLong( QString string, bool &ok );
582 
592 CORE_EXPORT bool qgsVariantLessThan( const QVariant &lhs, const QVariant &rhs );
593 
602 CORE_EXPORT bool qgsVariantEqual( const QVariant &lhs, const QVariant &rhs );
603 
610 CORE_EXPORT bool qgsVariantGreaterThan( const QVariant &lhs, const QVariant &rhs );
611 
612 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
613 
620 inline bool operator> ( const QVariant &v1, const QVariant &v2 )
621 {
622  return qgsVariantGreaterThan( v1, v2 );
623 }
624 
634 inline bool operator< ( const QVariant &v1, const QVariant &v2 )
635 {
636  return qgsVariantLessThan( v1, v2 );
637 }
638 #endif
639 
640 
641 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
642 
646 template<> CORE_EXPORT bool qMapLessThanKey<QVariantList>( const QVariantList &key1, const QVariantList &key2 ) SIP_SKIP;
647 #endif
648 
649 CORE_EXPORT QString qgsVsiPrefix( const QString &path );
650 
656 void CORE_EXPORT *qgsMalloc( size_t size ) SIP_SKIP;
657 
665 void CORE_EXPORT *qgsCalloc( size_t nmemb, size_t size ) SIP_SKIP;
666 
671 void CORE_EXPORT qgsFree( void *ptr ) SIP_SKIP;
672 
673 #ifndef SIP_RUN
674 
675 #ifdef _MSC_VER
676 #define CONSTLATIN1STRING inline const QLatin1String
677 #else
678 #define CONSTLATIN1STRING constexpr QLatin1String
679 #endif
680 
686 {
687  return QLatin1String(
688  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]] )"""
689  );
690 }
691 
694 {
695  return QLatin1String( "+proj=longlat +datum=WGS84 +no_defs" );
696 }
697 
700 {
701  return QLatin1String( "EPSG:4326" );
702 }
703 
706 {
707  return QLatin1String( "NONE" );
708 }
709 
711 
713 const int PREVIEW_JOB_DELAY_MS = 250;
714 
716 const int MAXIMUM_LAYER_PREVIEW_TIME_MS = 250;
717 
719 
720 #endif
721 
723 const long GEOSRID = 4326;
724 
726 const long GEOCRS_ID = 3452;
727 
729 const long GEO_EPSG_CRS_ID = 4326;
730 
735 const int USER_CRS_START_ID = 100000;
736 
737 //
738 // Constants for point symbols
739 //
740 
742 const double DEFAULT_POINT_SIZE = 2.0;
743 const double DEFAULT_LINE_WIDTH = 0.26;
744 
746 const double DEFAULT_SEGMENT_EPSILON = 1e-8;
747 
748 typedef QMap<QString, QString> QgsStringMap SIP_SKIP;
749 
758 typedef unsigned long long qgssize;
759 
760 #ifndef SIP_RUN
761 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
762 
763 #define Q_NOWARN_DEPRECATED_PUSH \
764  _Pragma("GCC diagnostic push") \
765  _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
766 #define Q_NOWARN_DEPRECATED_POP \
767  _Pragma("GCC diagnostic pop");
768 #define Q_NOWARN_UNREACHABLE_PUSH
769 #define Q_NOWARN_UNREACHABLE_POP
770 
771 #elif defined(_MSC_VER)
772 
773 #define Q_NOWARN_DEPRECATED_PUSH \
774  __pragma(warning(push)) \
775  __pragma(warning(disable:4996))
776 #define Q_NOWARN_DEPRECATED_POP \
777  __pragma(warning(pop))
778 #define Q_NOWARN_UNREACHABLE_PUSH \
779  __pragma(warning(push)) \
780  __pragma(warning(disable:4702))
781 #define Q_NOWARN_UNREACHABLE_POP \
782  __pragma(warning(pop))
783 
784 #else
785 
786 #define Q_NOWARN_DEPRECATED_PUSH
787 #define Q_NOWARN_DEPRECATED_POP
788 #define Q_NOWARN_UNREACHABLE_PUSH
789 #define Q_NOWARN_UNREACHABLE_POP
790 
791 #endif
792 #endif
793 
794 #ifndef QGISEXTERN
795 #ifdef Q_OS_WIN
796 # define QGISEXTERN extern "C" __declspec( dllexport )
797 # ifdef _MSC_VER
798 // do not warn about C bindings returning QString
799 # pragma warning(disable:4190)
800 # endif
801 #else
802 # if defined(__GNUC__) || defined(__clang__)
803 # define QGISEXTERN extern "C" __attribute__ ((visibility ("default")))
804 # else
805 # define QGISEXTERN extern "C"
806 # endif
807 #endif
808 #endif
809 #endif
810 
811 #if __cplusplus >= 201500
812 #define FALLTHROUGH [[fallthrough]];
813 #elif defined(__clang__)
814 #define FALLTHROUGH [[clang::fallthrough]];
815 #elif defined(__GNUC__) && __GNUC__ >= 7
816 #define FALLTHROUGH [[gnu::fallthrough]];
817 #else
818 #define FALLTHROUGH
819 #endif
820 
821 // see https://infektor.net/posts/2017-01-19-using-cpp17-attributes-today.html#using-the-nodiscard-attribute
822 #if __cplusplus >= 201703L
823 #define NODISCARD [[nodiscard]]
824 #elif defined(__clang__)
825 #define NODISCARD [[nodiscard]]
826 #elif defined(_MSC_VER)
827 #define NODISCARD // no support
828 #elif defined(__has_cpp_attribute)
829 #if __has_cpp_attribute(nodiscard)
830 #define NODISCARD [[nodiscard]]
831 #elif __has_cpp_attribute(gnu::warn_unused_result)
832 #define NODISCARD [[gnu::warn_unused_result]]
833 #else
834 #define NODISCARD Q_REQUIRED_RESULT
835 #endif
836 #else
837 #define NODISCARD Q_REQUIRED_RESULT
838 #endif
839 
840 #if __cplusplus >= 201703L
841 #define MAYBE_UNUSED [[maybe_unused]]
842 #elif defined(__clang__)
843 #define MAYBE_UNUSED [[maybe_unused]]
844 #elif defined(_MSC_VER)
845 #define MAYBE_UNUSED // no support
846 #elif defined(__has_cpp_attribute)
847 #if __has_cpp_attribute(gnu::unused)
848 #define MAYBE_UNUSED [[gnu::unused]]
849 #else
850 #define MAYBE_UNUSED
851 #endif
852 #else
853 #define MAYBE_UNUSED
854 #endif
855 
856 #ifndef FINAL
857 #define FINAL final
858 #endif
859 
860 #ifdef SIP_RUN
861 
866 QString CORE_EXPORT geoWkt();
867 
869 QString CORE_EXPORT geoProj4();
870 
872 QString CORE_EXPORT geoEpsgCrsAuthId();
873 
875 QString CORE_EXPORT geoNone();
876 
877 #endif
The Qgis class provides global constants for use throughout the application.
Definition: qgis.h:46
static const char * QGIS_DEV_VERSION
The development version.
Definition: qgis.h:72
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition: qgis.h:89
PythonMacroMode
Authorisation to run Python Macros.
Definition: qgis.h:125
@ NotForThisSession
Macros will not be run for this session.
Definition: qgis.h:130
DataType
Raster data types.
Definition: qgis.h:102
RAII signal blocking class.
Definition: qgis.h:257
~QgsSignalBlocker()
Definition: qgis.h:269
QgsSignalBlocker(Object *object)
Constructor for QgsSignalBlocker.
Definition: qgis.h:264
Object * operator->()
Returns pointer to blocked QObject.
Definition: qgis.h:275
This is the class is providing tolerance value in map unit values.
Definition: qgstolerance.h:33
int significantDigits(const Qgis::DataType rasterDataType)
Returns the maximum number of significant digits a for the given rasterDataType.
CONSTLATIN1STRING geoNone()
Constant that holds the string representation for "No ellips/No CRS".
Definition: qgis.h:705
const double DEFAULT_LINE_WIDTH
Definition: qgis.h:743
CORE_EXPORT uint qHash(const QVariant &variant)
Hash for QVariant.
Definition: qgis.cpp:220
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:620
void CORE_EXPORT * qgsCalloc(size_t nmemb, size_t size)
Allocates memory for an array of nmemb elements of size bytes each and returns a pointer to the alloc...
Definition: qgis.cpp:102
CORE_EXPORT QString qgsVsiPrefix(const QString &path)
Definition: qgis.cpp:195
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:269
void CORE_EXPORT * qgsMalloc(size_t size)
Allocates size bytes and returns a pointer to the allocated memory.
Definition: qgis.cpp:87
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
Definition: qgis.h:311
QString qgsEnumValueToKey(const T &value)
Returns the value for the given key of an enum.
Definition: qgis.h:482
const QMap< T, QString > qgsEnumMap()
Returns a map of all enum entries.
Definition: qgis.h:465
const long GEO_EPSG_CRS_ID
Magic number for a geographic coord sys in EpsgCrsId ID format.
Definition: qgis.h:729
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:190
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:758
bool qgsFloatNear(float a, float b, float epsilon=4 *FLT_EPSILON)
Compare two floats (but allow some difference)
Definition: qgis.h:358
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:66
double qgsRound(double number, int places)
Returns a double number, rounded (as close as possible) to the specified number of places.
Definition: qgis.h:391
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
Definition: qgis.h:343
CONSTLATIN1STRING geoProj4()
PROJ4 string that represents a geographic coord sys.
Definition: qgis.h:693
T qgsFlagKeysToValue(const QString &keys, const T &defaultValue)
Returns the value corresponding to the given keys of a flag.
Definition: qgis.h:537
const double DEFAULT_SEGMENT_EPSILON
Default snapping tolerance for segments.
Definition: qgis.h:746
QMap< QString, QString > QgsStringMap
Definition: qgis.h:748
#define CONSTLATIN1STRING
Definition: qgis.h:678
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition: qgis.h:298
CONSTLATIN1STRING geoWkt()
Wkt string that represents a geographic coord sys.
Definition: qgis.h:685
bool qgsDoubleNearSig(double a, double b, int significantDigits=10)
Compare two doubles using specified number of significant digits.
Definition: qgis.h:368
const int USER_CRS_START_ID
Magick number that determines whether a projection crsid is a system (srs.db) or user (~/....
Definition: qgis.h:735
QString qgsFlagValueToKeys(const T &value)
Returns the value for the given keys of a flag.
Definition: qgis.h:525
void CORE_EXPORT qgsFree(void *ptr)
Frees the memory space pointed to by ptr.
Definition: qgis.cpp:117
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:80
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:73
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:122
const long GEOSRID
Magic number for a geographic coord sys in POSTGIS SRID.
Definition: qgis.h:723
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:634
CONSTLATIN1STRING geoEpsgCrsAuthId()
Geographic coord sys from EPSG authority.
Definition: qgis.h:699
const long GEOCRS_ID
Magic number for a geographic coord sys in QGIS srs.db tbl_srs.srs_id.
Definition: qgis.h:726
T qgsEnumKeyToValue(const QString &key, const T &defaultValue, bool tryValueAsKey=true)
Returns the value corresponding to the given key of an enum.
Definition: qgis.h:495
const double DEFAULT_POINT_SIZE
Magic number that determines the default point size for point symbols.
Definition: qgis.h:742
#define SIP_SKIP
Definition: qgis_sip.h:126
int precision