QGIS API Documentation  3.15.0-Master (dbe1ef8aa2)
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 
124  {
125  Never = 0,
126  Ask = 1,
127  SessionOnly = 2,
128  Always = 3,
130  };
131  Q_ENUM( PythonMacroMode )
132 
133 
137  static const double DEFAULT_SEARCH_RADIUS_MM;
138 
140  static const float DEFAULT_MAPTOPIXEL_THRESHOLD;
141 
148  static const QColor DEFAULT_HIGHLIGHT_COLOR;
149 
154  static const double DEFAULT_HIGHLIGHT_BUFFER_MM;
155 
160  static const double DEFAULT_HIGHLIGHT_MIN_WIDTH_MM;
161 
168  static const double SCALE_PRECISION;
169 
175  static const double DEFAULT_Z_COORDINATE;
176 
182  static const double UI_SCALE_FACTOR;
183 
188  static const double DEFAULT_SNAP_TOLERANCE;
189 
194  static const QgsTolerance::UnitType DEFAULT_SNAP_UNITS;
195 
201  static QString defaultProjectScales();
202 };
203 
204 // hack to workaround warnings when casting void pointers
205 // retrieved from QLibrary::resolve to function pointers.
206 // It's assumed that this works on all systems supporting
207 // QLibrary
208 #define cast_to_fptr(f) f
209 
210 
219 // based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
220 template<class Object> class QgsSignalBlocker SIP_SKIP SIP_SKIP // clazy:exclude=rule-of-three
221 {
222  public:
223 
228  explicit QgsSignalBlocker( Object *object )
229  : mObject( object )
230  , mPreviousState( object->blockSignals( true ) )
231  {}
232 
234  {
235  mObject->blockSignals( mPreviousState );
236  }
237 
239  Object *operator->() { return mObject; }
240 
241  private:
242 
243  Object *mObject = nullptr;
244  bool mPreviousState;
245 
246 };
247 
261 // based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
262 template<class Object> inline QgsSignalBlocker<Object> whileBlocking( Object *object ) SIP_SKIP SIP_SKIP
263 {
264  return QgsSignalBlocker<Object>( object );
265 }
266 
268 CORE_EXPORT uint qHash( const QVariant &variant );
269 
275 inline QString qgsDoubleToString( double a, int precision = 17 )
276 {
277  if ( precision )
278  {
279  QString str = QString::number( a, 'f', precision );
280  if ( str.contains( QLatin1Char( '.' ) ) )
281  {
282  // remove ending 0s
283  int idx = str.length() - 1;
284  while ( str.at( idx ) == '0' && idx > 1 )
285  {
286  idx--;
287  }
288  if ( idx < str.length() - 1 )
289  str.truncate( str.at( idx ) == '.' ? idx : idx + 1 );
290  }
291  return str;
292  }
293  else
294  {
295  // avoid printing -0
296  // see https://bugreports.qt.io/browse/QTBUG-71439
297  const QString str( QString::number( a, 'f', precision ) );
298  if ( str == QLatin1String( "-0" ) )
299  {
300  return QLatin1String( "0" );
301  }
302  else
303  {
304  return str;
305  }
306  }
307 }
308 
315 inline bool qgsDoubleNear( double a, double b, double epsilon = 4 * std::numeric_limits<double>::epsilon() )
316 {
317  if ( std::isnan( a ) || std::isnan( b ) )
318  return std::isnan( a ) && std::isnan( b ) ;
319 
320  const double diff = a - b;
321  return diff > -epsilon && diff <= epsilon;
322 }
323 
330 inline bool qgsFloatNear( float a, float b, float epsilon = 4 * FLT_EPSILON )
331 {
332  if ( std::isnan( a ) || std::isnan( b ) )
333  return std::isnan( a ) && std::isnan( b ) ;
334 
335  const float diff = a - b;
336  return diff > -epsilon && diff <= epsilon;
337 }
338 
340 inline bool qgsDoubleNearSig( double a, double b, int significantDigits = 10 )
341 {
342  if ( std::isnan( a ) || std::isnan( b ) )
343  return std::isnan( a ) && std::isnan( b ) ;
344 
345  // The most simple would be to print numbers as %.xe and compare as strings
346  // but that is probably too costly
347  // Then the fastest would be to set some bits directly, but little/big endian
348  // has to be considered (maybe TODO)
349  // Is there a better way?
350  int aexp, bexp;
351  double ar = std::frexp( a, &aexp );
352  double br = std::frexp( b, &bexp );
353 
354  return aexp == bexp &&
355  std::round( ar * std::pow( 10.0, significantDigits ) ) == std::round( br * std::pow( 10.0, significantDigits ) );
356 }
357 
363 inline double qgsRound( double number, int places )
364 {
365  double m = ( number < 0.0 ) ? -1.0 : 1.0;
366  double scaleFactor = std::pow( 10.0, places );
367  return ( std::round( number * m * scaleFactor ) / scaleFactor ) * m;
368 }
369 
370 
371 #ifndef SIP_RUN
372 
374 
384 namespace qgis
385 {
386  // as_const
387 
396  template <typename T> struct QgsAddConst { typedef const T Type; };
397 
398  template <typename T>
399  constexpr typename QgsAddConst<T>::Type &as_const( T &t ) noexcept { return t; }
400 
401  template <typename T>
402  void as_const( const T && ) = delete;
403 
404  // make_unique - from https://stackoverflow.com/a/17902439/1861260
405 
406  template<class T> struct _Unique_if
407  {
408  typedef std::unique_ptr<T> _Single_object;
409  };
410 
411  template<class T> struct _Unique_if<T[]>
412  {
413  typedef std::unique_ptr<T[]> _Unknown_bound;
414  };
415 
416  template<class T, size_t N> struct _Unique_if<T[N]>
417  {
418  typedef void _Known_bound;
419  };
420 
421  template<class T, class... Args>
422  typename _Unique_if<T>::_Single_object
423  make_unique( Args &&... args )
424  {
425  return std::unique_ptr<T>( new T( std::forward<Args>( args )... ) );
426  }
427 
428  template<class T>
429  typename _Unique_if<T>::_Unknown_bound
430  make_unique( size_t n )
431  {
432  typedef typename std::remove_extent<T>::type U;
433  return std::unique_ptr<T>( new U[n]() );
434  }
435 
436  template<class T, class... Args>
437  typename _Unique_if<T>::_Known_bound
438  make_unique( Args &&... ) = delete;
439 
452  template<typename... Args> struct overload
453  {
454  template<typename C, typename R>
455  static constexpr auto of( R( C::*pmf )( Args... ) ) -> decltype( pmf )
456  {
457  return pmf;
458  }
459  };
460 
461  template<class T>
462  QSet<T> listToSet( const QList<T> &list )
463  {
464 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
465  return list.toSet();
466 #else
467  return QSet<T>( list.begin(), list.end() );
468 #endif
469  }
470 
471  template<class T>
472  QList<T> setToList( const QSet<T> &set )
473  {
474 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
475  return set.toList();
476 #else
477  return QList<T>( set.begin(), set.end() );
478 #endif
479  }
480 }
482 #endif
483 
489 template<class T> const QMap<T, QString> qgsEnumMap() SIP_SKIP
490 {
491  QMetaEnum metaEnum = QMetaEnum::fromType<T>();
492  Q_ASSERT( metaEnum.isValid() );
493  QMap<T, QString> enumMap;
494  for ( int idx = 0; idx < metaEnum.keyCount(); ++idx )
495  {
496  const char *enumKey = metaEnum.key( idx );
497  enumMap.insert( static_cast<T>( metaEnum.keyToValue( enumKey ) ), QString( enumKey ) );
498  }
499  return enumMap;
500 }
501 
506 template<class T> QString qgsEnumValueToKey( const T &value ) SIP_SKIP
507 {
508  QMetaEnum metaEnum = QMetaEnum::fromType<T>();
509  Q_ASSERT( metaEnum.isValid() );
510  return QString::fromUtf8( metaEnum.valueToKey( static_cast<int>( value ) ) );
511 }
512 
518 template<class T> T qgsEnumKeyToValue( const QString &key, const T &defaultValue ) SIP_SKIP
519 {
520  QMetaEnum metaEnum = QMetaEnum::fromType<T>();
521  Q_ASSERT( metaEnum.isValid() );
522  bool ok = false;
523  T v = static_cast<T>( metaEnum.keyToValue( key.toUtf8().data(), &ok ) );
524  if ( ok )
525  return v;
526  else
527  return defaultValue;
528 }
529 
534 template<class T> QString qgsFlagValueToKeys( const T &value ) SIP_SKIP
535 {
536  QMetaEnum metaEnum = QMetaEnum::fromType<T>();
537  Q_ASSERT( metaEnum.isValid() );
538  return QString::fromUtf8( metaEnum.valueToKeys( static_cast<int>( value ) ) );
539 }
540 
546 template<class T> T qgsFlagKeysToValue( const QString &keys, const T &defaultValue ) SIP_SKIP
547 {
548  QMetaEnum metaEnum = QMetaEnum::fromType<T>();
549  Q_ASSERT( metaEnum.isValid() );
550  bool ok = false;
551  T v = static_cast<T>( metaEnum.keysToValue( keys.toUtf8().constData(), &ok ) );
552  if ( ok )
553  return v;
554  else
555  return defaultValue;
556 }
557 
558 
568 CORE_EXPORT double qgsPermissiveToDouble( QString string, bool &ok );
569 
579 CORE_EXPORT int qgsPermissiveToInt( QString string, bool &ok );
580 
590 CORE_EXPORT qlonglong qgsPermissiveToLongLong( QString string, bool &ok );
591 
601 CORE_EXPORT bool qgsVariantLessThan( const QVariant &lhs, const QVariant &rhs );
602 
611 CORE_EXPORT bool qgsVariantEqual( const QVariant &lhs, const QVariant &rhs );
612 
613 
620 CORE_EXPORT bool qgsVariantGreaterThan( const QVariant &lhs, const QVariant &rhs );
621 
625 template<> CORE_EXPORT bool qMapLessThanKey<QVariantList>( const QVariantList &key1, const QVariantList &key2 ) SIP_SKIP;
626 
627 
628 CORE_EXPORT QString qgsVsiPrefix( const QString &path );
629 
635 void CORE_EXPORT *qgsMalloc( size_t size ) SIP_SKIP;
636 
644 void CORE_EXPORT *qgsCalloc( size_t nmemb, size_t size ) SIP_SKIP;
645 
650 void CORE_EXPORT qgsFree( void *ptr ) SIP_SKIP;
651 
652 #ifndef SIP_RUN
653 
654 #ifdef _MSC_VER
655 #define CONSTLATIN1STRING inline const QLatin1String
656 #else
657 #define CONSTLATIN1STRING constexpr QLatin1String
658 #endif
659 
665 {
666 #if PROJ_VERSION_MAJOR>=6
667  return QLatin1String(
668  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]] )"""
669  );
670 #else
671  return QLatin1String(
672  "GEOGCS[\"WGS 84\", "
673  " DATUM[\"WGS_1984\", "
674  " SPHEROID[\"WGS 84\",6378137,298.257223563, "
675  " AUTHORITY[\"EPSG\",\"7030\"]], "
676  " TOWGS84[0,0,0,0,0,0,0], "
677  " AUTHORITY[\"EPSG\",\"6326\"]], "
678  " PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]], "
679  " UNIT[\"DMSH\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]], "
680  " AXIS[\"Lat\",NORTH], "
681  " AXIS[\"Long\",EAST], "
682  " AUTHORITY[\"EPSG\",\"4326\"]]"
683  );
684 #endif
685 }
686 
689 {
690  return QLatin1String( "+proj=longlat +datum=WGS84 +no_defs" );
691 }
692 
695 {
696  return QLatin1String( "EPSG:4326" );
697 }
698 
701 {
702  return QLatin1String( "NONE" );
703 }
704 
706 
708 const int PREVIEW_JOB_DELAY_MS = 250;
709 
711 const int MAXIMUM_LAYER_PREVIEW_TIME_MS = 250;
712 
714 
715 #endif
716 
718 const long GEOSRID = 4326;
719 
721 const long GEOCRS_ID = 3452;
722 
724 const long GEO_EPSG_CRS_ID = 4326;
725 
729 const int USER_CRS_START_ID = 100000;
730 
731 //
732 // Constants for point symbols
733 //
734 
736 const double DEFAULT_POINT_SIZE = 2.0;
737 const double DEFAULT_LINE_WIDTH = 0.26;
738 
740 const double DEFAULT_SEGMENT_EPSILON = 1e-8;
741 
742 typedef QMap<QString, QString> QgsStringMap SIP_SKIP;
743 
751 typedef unsigned long long qgssize;
752 
753 #ifndef SIP_RUN
754 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
755 
756 #define Q_NOWARN_DEPRECATED_PUSH \
757  _Pragma("GCC diagnostic push") \
758  _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
759 #define Q_NOWARN_DEPRECATED_POP \
760  _Pragma("GCC diagnostic pop");
761 #define Q_NOWARN_UNREACHABLE_PUSH
762 #define Q_NOWARN_UNREACHABLE_POP
763 
764 #elif defined(_MSC_VER)
765 
766 #define Q_NOWARN_DEPRECATED_PUSH \
767  __pragma(warning(push)) \
768  __pragma(warning(disable:4996))
769 #define Q_NOWARN_DEPRECATED_POP \
770  __pragma(warning(pop))
771 #define Q_NOWARN_UNREACHABLE_PUSH \
772  __pragma(warning(push)) \
773  __pragma(warning(disable:4702))
774 #define Q_NOWARN_UNREACHABLE_POP \
775  __pragma(warning(pop))
776 
777 #else
778 
779 #define Q_NOWARN_DEPRECATED_PUSH
780 #define Q_NOWARN_DEPRECATED_POP
781 #define Q_NOWARN_UNREACHABLE_PUSH
782 #define Q_NOWARN_UNREACHABLE_POP
783 
784 #endif
785 #endif
786 
787 #ifndef QGISEXTERN
788 #ifdef Q_OS_WIN
789 # define QGISEXTERN extern "C" __declspec( dllexport )
790 # ifdef _MSC_VER
791 // do not warn about C bindings returning QString
792 # pragma warning(disable:4190)
793 # endif
794 #else
795 # if defined(__GNUC__) || defined(__clang__)
796 # define QGISEXTERN extern "C" __attribute__ ((visibility ("default")))
797 # else
798 # define QGISEXTERN extern "C"
799 # endif
800 #endif
801 #endif
802 #endif
803 
804 #if __cplusplus >= 201500
805 #define FALLTHROUGH [[fallthrough]];
806 #elif defined(__clang__)
807 #define FALLTHROUGH [[clang::fallthrough]];
808 #elif defined(__GNUC__) && __GNUC__ >= 7
809 #define FALLTHROUGH [[gnu::fallthrough]];
810 #else
811 #define FALLTHROUGH
812 #endif
813 
814 // see https://infektor.net/posts/2017-01-19-using-cpp17-attributes-today.html#using-the-nodiscard-attribute
815 #if __cplusplus >= 201703L
816 #define NODISCARD [[nodiscard]]
817 #elif defined(__clang__)
818 #define NODISCARD [[nodiscard]]
819 #elif defined(_MSC_VER)
820 #define NODISCARD // no support
821 #elif defined(__has_cpp_attribute)
822 #if __has_cpp_attribute(nodiscard)
823 #define NODISCARD [[nodiscard]]
824 #elif __has_cpp_attribute(gnu::warn_unused_result)
825 #define NODISCARD [[gnu::warn_unused_result]]
826 #else
827 #define NODISCARD Q_REQUIRED_RESULT
828 #endif
829 #else
830 #define NODISCARD Q_REQUIRED_RESULT
831 #endif
832 
833 #if __cplusplus >= 201703L
834 #define MAYBE_UNUSED [[maybe_unused]]
835 #elif defined(__clang__)
836 #define MAYBE_UNUSED [[maybe_unused]]
837 #elif defined(_MSC_VER)
838 #define MAYBE_UNUSED // no support
839 #elif defined(__has_cpp_attribute)
840 #if __has_cpp_attribute(gnu::unused)
841 #define MAYBE_UNUSED [[gnu::unused]]
842 #else
843 #define MAYBE_UNUSED
844 #endif
845 #else
846 #define MAYBE_UNUSED
847 #endif
848 
849 #ifndef FINAL
850 #define FINAL final
851 #endif
852 
853 #ifdef SIP_RUN
854 
859 QString CORE_EXPORT geoWkt();
860 
862 QString CORE_EXPORT geoProj4();
863 
865 QString CORE_EXPORT geoEpsgCrsAuthId();
866 
868 QString CORE_EXPORT geoNone();
869 
870 #endif
CORE_EXPORT QString qgsVsiPrefix(const QString &path)
Definition: qgis.cpp:194
int precision
static const char * QGIS_DEV_VERSION
The development version.
Definition: qgis.h:72
bool qgsFloatNear(float a, float b, float epsilon=4 *FLT_EPSILON)
Compare two floats (but allow some difference)
Definition: qgis.h:330
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:265
QString qgsEnumValueToKey(const T &value)
Returns the value for the given key of an enum.
Definition: qgis.h:506
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
Definition: qgis.h:315
CONSTLATIN1STRING geoWkt()
Wkt string that represents a geographic coord sys.
Definition: qgis.h:664
CONSTLATIN1STRING geoNone()
Constant that holds the string representation for "No ellips/No CRS".
Definition: qgis.h:700
DataType
Raster data types.
Definition: qgis.h:101
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:101
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition: qgis.h:88
QMap< QString, QString > QgsStringMap
Definition: qgis.h:742
~QgsSignalBlocker()
Definition: qgis.h:233
The Qgis class provides global constants for use throughout the application.
Definition: qgis.h:45
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:121
CORE_EXPORT bool qMapLessThanKey< QVariantList >(const QVariantList &key1, const QVariantList &key2)
Compares two QVariantList values and returns whether the first is less than the second.
Definition: qgis.cpp:299
QgsSignalBlocker(Object *object)
Constructor for QgsSignalBlocker.
Definition: qgis.h:228
#define CONSTLATIN1STRING
Definition: qgis.h:657
T qgsEnumKeyToValue(const QString &key, const T &defaultValue)
Returns the value corresponding to the given key of an enum.
Definition: qgis.h:518
const double DEFAULT_SEGMENT_EPSILON
Default snapping tolerance for segments.
Definition: qgis.h:740
Macros will not be run for this session.
Definition: qgis.h:129
#define SIP_SKIP
Definition: qgis_sip.h:126
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
Definition: qgis.h:275
This is the class is providing tolerance value in map unit values.
Definition: qgstolerance.h:32
const long GEOCRS_ID
Magic number for a geographic coord sys in QGIS srs.db tbl_srs.srs_id.
Definition: qgis.h:721
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:65
RAII signal blocking class.
Definition: qgis.h:220
T qgsFlagKeysToValue(const QString &keys, const T &defaultValue)
Returns the value corresponding to the given keys of a flag.
Definition: qgis.h:546
void CORE_EXPORT qgsFree(void *ptr)
Frees the memory space pointed to by ptr.
Definition: qgis.cpp:116
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:79
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:751
const double DEFAULT_POINT_SIZE
Magic number that determines the default point size for point symbols.
Definition: qgis.h:736
CONSTLATIN1STRING geoProj4()
PROJ4 string that represents a geographic coord sys.
Definition: qgis.h:688
const int USER_CRS_START_ID
Magick number that determines whether a projection crsid is a system (srs.db) or user (~/...
Definition: qgis.h:729
const QMap< T, QString > qgsEnumMap()
Returns a map of all enum entries.
Definition: qgis.h:489
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition: qgis.h:262
const long GEOSRID
Magic number for a geographic coord sys in POSTGIS SRID.
Definition: qgis.h:718
double qgsRound(double number, int places)
Returns a double number, rounded (as close as possible) to the specified number of places...
Definition: qgis.h:363
bool qgsDoubleNearSig(double a, double b, int significantDigits=10)
Compare two doubles using specified number of significant digits.
Definition: qgis.h:340
const double DEFAULT_LINE_WIDTH
Definition: qgis.h:737
PythonMacroMode
Authorisation to run Python Macros.
Definition: qgis.h:123
CORE_EXPORT uint qHash(const QVariant &variant)
Hash for QVariant.
Definition: qgis.cpp:219
QString qgsFlagValueToKeys(const T &value)
Returns the value for the given keys of a flag.
Definition: qgis.h:534
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:72
CONSTLATIN1STRING geoEpsgCrsAuthId()
Geographic coord sys from EPSG authority.
Definition: qgis.h:694
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:189
void CORE_EXPORT * qgsMalloc(size_t size)
Allocates size bytes and returns a pointer to the allocated memory.
Definition: qgis.cpp:86
Object * operator->()
Returns pointer to blocked QObject.
Definition: qgis.h:239
const long GEO_EPSG_CRS_ID
Magic number for a geographic coord sys in EpsgCrsId ID format.
Definition: qgis.h:724