QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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 
88  enum MessageLevel
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,
129  NotForThisSession,
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 
530 
540 CORE_EXPORT double qgsPermissiveToDouble( QString string, bool &ok );
541 
551 CORE_EXPORT int qgsPermissiveToInt( QString string, bool &ok );
552 
562 CORE_EXPORT qlonglong qgsPermissiveToLongLong( QString string, bool &ok );
563 
573 CORE_EXPORT bool qgsVariantLessThan( const QVariant &lhs, const QVariant &rhs );
574 
583 CORE_EXPORT bool qgsVariantEqual( const QVariant &lhs, const QVariant &rhs );
584 
585 
592 CORE_EXPORT bool qgsVariantGreaterThan( const QVariant &lhs, const QVariant &rhs );
593 
597 template<> CORE_EXPORT bool qMapLessThanKey<QVariantList>( const QVariantList &key1, const QVariantList &key2 ) SIP_SKIP;
598 
599 
600 CORE_EXPORT QString qgsVsiPrefix( const QString &path );
601 
607 void CORE_EXPORT *qgsMalloc( size_t size ) SIP_SKIP;
608 
616 void CORE_EXPORT *qgsCalloc( size_t nmemb, size_t size ) SIP_SKIP;
617 
622 void CORE_EXPORT qgsFree( void *ptr ) SIP_SKIP;
623 
624 #ifndef SIP_RUN
625 
626 #ifdef _MSC_VER
627 #define CONSTLATIN1STRING inline const QLatin1String
628 #else
629 #define CONSTLATIN1STRING constexpr QLatin1String
630 #endif
631 
637 {
638 #if PROJ_VERSION_MAJOR>=6
639  return QLatin1String(
640  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]] )"""
641  );
642 #else
643  return QLatin1String(
644  "GEOGCS[\"WGS 84\", "
645  " DATUM[\"WGS_1984\", "
646  " SPHEROID[\"WGS 84\",6378137,298.257223563, "
647  " AUTHORITY[\"EPSG\",\"7030\"]], "
648  " TOWGS84[0,0,0,0,0,0,0], "
649  " AUTHORITY[\"EPSG\",\"6326\"]], "
650  " PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]], "
651  " UNIT[\"DMSH\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]], "
652  " AXIS[\"Lat\",NORTH], "
653  " AXIS[\"Long\",EAST], "
654  " AUTHORITY[\"EPSG\",\"4326\"]]"
655  );
656 #endif
657 }
658 
661 {
662  return QLatin1String( "+proj=longlat +datum=WGS84 +no_defs" );
663 }
664 
667 {
668  return QLatin1String( "EPSG:4326" );
669 }
670 
673 {
674  return QLatin1String( "NONE" );
675 }
676 
678 
680 const int PREVIEW_JOB_DELAY_MS = 250;
681 
683 const int MAXIMUM_LAYER_PREVIEW_TIME_MS = 250;
684 
686 
687 #endif
688 
690 const long GEOSRID = 4326;
691 
693 const long GEOCRS_ID = 3452;
694 
696 const long GEO_EPSG_CRS_ID = 4326;
697 
701 const int USER_CRS_START_ID = 100000;
702 
703 //
704 // Constants for point symbols
705 //
706 
708 const double DEFAULT_POINT_SIZE = 2.0;
709 const double DEFAULT_LINE_WIDTH = 0.26;
710 
712 const double DEFAULT_SEGMENT_EPSILON = 1e-8;
713 
714 typedef QMap<QString, QString> QgsStringMap SIP_SKIP;
715 
723 typedef unsigned long long qgssize;
724 
725 #ifndef SIP_RUN
726 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
727 
728 #define Q_NOWARN_DEPRECATED_PUSH \
729  _Pragma("GCC diagnostic push") \
730  _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
731 #define Q_NOWARN_DEPRECATED_POP \
732  _Pragma("GCC diagnostic pop");
733 #define Q_NOWARN_UNREACHABLE_PUSH
734 #define Q_NOWARN_UNREACHABLE_POP
735 
736 #elif defined(_MSC_VER)
737 
738 #define Q_NOWARN_DEPRECATED_PUSH \
739  __pragma(warning(push)) \
740  __pragma(warning(disable:4996))
741 #define Q_NOWARN_DEPRECATED_POP \
742  __pragma(warning(pop))
743 #define Q_NOWARN_UNREACHABLE_PUSH \
744  __pragma(warning(push)) \
745  __pragma(warning(disable:4702))
746 #define Q_NOWARN_UNREACHABLE_POP \
747  __pragma(warning(pop))
748 
749 #else
750 
751 #define Q_NOWARN_DEPRECATED_PUSH
752 #define Q_NOWARN_DEPRECATED_POP
753 #define Q_NOWARN_UNREACHABLE_PUSH
754 #define Q_NOWARN_UNREACHABLE_POP
755 
756 #endif
757 #endif
758 
759 #ifndef QGISEXTERN
760 #ifdef Q_OS_WIN
761 # define QGISEXTERN extern "C" __declspec( dllexport )
762 # ifdef _MSC_VER
763 // do not warn about C bindings returning QString
764 # pragma warning(disable:4190)
765 # endif
766 #else
767 # if defined(__GNUC__) || defined(__clang__)
768 # define QGISEXTERN extern "C" __attribute__ ((visibility ("default")))
769 # else
770 # define QGISEXTERN extern "C"
771 # endif
772 #endif
773 #endif
774 #endif
775 
776 #if __cplusplus >= 201500
777 #define FALLTHROUGH [[fallthrough]];
778 #elif defined(__clang__)
779 #define FALLTHROUGH [[clang::fallthrough]];
780 #elif defined(__GNUC__) && __GNUC__ >= 7
781 #define FALLTHROUGH [[gnu::fallthrough]];
782 #else
783 #define FALLTHROUGH
784 #endif
785 
786 // see https://infektor.net/posts/2017-01-19-using-cpp17-attributes-today.html#using-the-nodiscard-attribute
787 #if __cplusplus >= 201703L
788 #define NODISCARD [[nodiscard]]
789 #elif defined(__clang__)
790 #define NODISCARD [[nodiscard]]
791 #elif defined(_MSC_VER)
792 #define NODISCARD // no support
793 #elif defined(__has_cpp_attribute)
794 #if __has_cpp_attribute(nodiscard)
795 #define NODISCARD [[nodiscard]]
796 #elif __has_cpp_attribute(gnu::warn_unused_result)
797 #define NODISCARD [[gnu::warn_unused_result]]
798 #else
799 #define NODISCARD Q_REQUIRED_RESULT
800 #endif
801 #else
802 #define NODISCARD Q_REQUIRED_RESULT
803 #endif
804 
805 #if __cplusplus >= 201703L
806 #define MAYBE_UNUSED [[maybe_unused]]
807 #elif defined(__clang__)
808 #define MAYBE_UNUSED [[maybe_unused]]
809 #elif defined(_MSC_VER)
810 #define MAYBE_UNUSED // no support
811 #elif defined(__has_cpp_attribute)
812 #if __has_cpp_attribute(gnu::unused)
813 #define MAYBE_UNUSED [[gnu::unused]]
814 #else
815 #define MAYBE_UNUSED
816 #endif
817 #else
818 #define MAYBE_UNUSED
819 #endif
820 
821 #ifndef FINAL
822 #define FINAL final
823 #endif
824 
825 #ifdef SIP_RUN
826 
831 QString CORE_EXPORT geoWkt();
832 
834 QString CORE_EXPORT geoProj4();
835 
837 QString CORE_EXPORT geoEpsgCrsAuthId();
838 
840 QString CORE_EXPORT geoNone();
841 
842 #endif
qgsEnumKeyToValue
T qgsEnumKeyToValue(const QString &key, const T &defaultValue)
Returns the value corresponding to the given key of an enum.
Definition: qgis.h:518
geoWkt
CONSTLATIN1STRING geoWkt()
Wkt string that represents a geographic coord sys.
Definition: qgis.h:636
Qgis::DataType
DataType
Raster data types.
Definition: qgis.h:114
qMapLessThanKey< QVariantList >
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
USER_CRS_START_ID
const int USER_CRS_START_ID
Magick number that determines whether a projection crsid is a system (srs.db) or user (~/....
Definition: qgis.h:701
GEOCRS_ID
const long GEOCRS_ID
Magic number for a geographic coord sys in QGIS srs.db tbl_srs.srs_id.
Definition: qgis.h:693
qHash
CORE_EXPORT uint qHash(const QVariant &variant)
Hash for QVariant.
Definition: qgis.cpp:219
QgsSignalBlocker::QgsSignalBlocker
QgsSignalBlocker(Object *object)
Constructor for QgsSignalBlocker.
Definition: qgis.h:228
qgsDoubleNearSig
bool qgsDoubleNearSig(double a, double b, int significantDigits=10)
Compare two doubles using specified number of significant digits.
Definition: qgis.h:340
CONSTLATIN1STRING
#define CONSTLATIN1STRING
Definition: qgis.h:629
qgstolerance.h
qgsVariantGreaterThan
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
qgis.h
geoEpsgCrsAuthId
CONSTLATIN1STRING geoEpsgCrsAuthId()
Geographic coord sys from EPSG authority.
Definition: qgis.h:666
GEO_EPSG_CRS_ID
const long GEO_EPSG_CRS_ID
Magic number for a geographic coord sys in EpsgCrsId ID format.
Definition: qgis.h:696
DEFAULT_POINT_SIZE
const double DEFAULT_POINT_SIZE
Magic number that determines the default point size for point symbols.
Definition: qgis.h:708
QgsSignalBlocker
Definition: qgis.h:220
DEFAULT_SEGMENT_EPSILON
const double DEFAULT_SEGMENT_EPSILON
Default snapping tolerance for segments.
Definition: qgis.h:712
geoProj4
CONSTLATIN1STRING geoProj4()
PROJ4 string that represents a geographic coord sys.
Definition: qgis.h:660
qgsFree
void CORE_EXPORT qgsFree(void *ptr)
Frees the memory space pointed to by ptr.
Definition: qgis.cpp:116
qgsDoubleToString
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
Definition: qgis.h:275
qgsPermissiveToLongLong
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
precision
int precision
Definition: qgswfsgetfeature.cpp:103
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
qgsVsiPrefix
CORE_EXPORT QString qgsVsiPrefix(const QString &path)
Definition: qgis.cpp:194
QgsTolerance::UnitType
UnitType
Type of unit of tolerance value from settings.
Definition: qgstolerance.h:40
qgsFloatNear
bool qgsFloatNear(float a, float b, float epsilon=4 *FLT_EPSILON)
Compare two floats (but allow some difference)
Definition: qgis.h:330
QgsSignalBlocker::~QgsSignalBlocker
~QgsSignalBlocker()
Definition: qgis.h:233
qgsVariantEqual
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
qgsEnumMap
const QMap< T, QString > qgsEnumMap()
Returns a map of all enum entries.
Definition: qgis.h:489
whileBlocking
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition: qgis.h:262
geoNone
CONSTLATIN1STRING geoNone()
Constant that holds the string representation for "No ellips/No CRS".
Definition: qgis.h:672
GEOSRID
const long GEOSRID
Magic number for a geographic coord sys in POSTGIS SRID.
Definition: qgis.h:690
qgsDoubleNear
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
qgsRound
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
DEFAULT_LINE_WIDTH
const double DEFAULT_LINE_WIDTH
Definition: qgis.h:709
qgis_sip.h
QgsSignalBlocker::operator->
Object * operator->()
Returns pointer to blocked QObject.
Definition: qgis.h:239
qgsVariantLessThan
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
qgsPermissiveToInt
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
QgsStringMap
QMap< QString, QString > QgsStringMap
Definition: qgis.h:714
Qgis::MessageLevel
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition: qgis.h:101
qgsPermissiveToDouble
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
qgsMalloc
void CORE_EXPORT * qgsMalloc(size_t size)
Allocates size bytes and returns a pointer to the allocated memory.
Definition: qgis.cpp:86
Qgis
Definition: qgis.h:45
qgsCalloc
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
qgsEnumValueToKey
QString qgsEnumValueToKey(const T &value)
Returns the value for the given key of an enum.
Definition: qgis.h:506
Qgis::PythonMacroMode
PythonMacroMode
Authorisation to run Python Macros.
Definition: qgis.h:136
qgssize
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:723