QGIS API Documentation 3.99.0-Master (a8882ad4560)
Loading...
Searching...
No Matches
qgis.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgis.cpp
3
4 -------------------
5 begin : 2007
6 copyright : (C) 2007 by Gary E. Sherman
8***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18#include "qgis.h"
19
20#include "moc_qgis.cpp"
21
22#ifndef QGSVERSION
23#include "qgsversion.h"
24#endif
25#include <QCoreApplication>
26#include <QColor>
27#include <QDate>
28#include <QTime>
29#include <QLocale>
30#include <QDateTime>
31#include "qgsconfig.h"
32#include "qgslogger.h"
33#include "qgsgdalutils.h"
34#include "qgswkbtypes.h"
35
36#include <gdal.h>
37#include <geos_c.h>
38#include <ogr_api.h>
39
40#ifdef WITH_GEOGRAPHICLIB
41#include <GeographicLib/Constants.hpp>
42#endif
43
44#define qgis_xstr(x) qgis_str(x)
45#define qgis_str(x) #x
46
47// Version constants
48//
49
50// development version
51const char *Qgis::QGIS_DEV_VERSION = QGSVERSION;
52
53const double Qgis::DEFAULT_SEARCH_RADIUS_MM = 2.;
54
55const float Qgis::DEFAULT_MAPTOPIXEL_THRESHOLD = 1.0f;
56
57const QColor Qgis::DEFAULT_HIGHLIGHT_COLOR = QColor( 255, 0, 0, 128 );
58
59const double Qgis::DEFAULT_HIGHLIGHT_BUFFER_MM = 0.5;
60
62
63const double Qgis::SCALE_PRECISION = 0.9999999999;
64
65const double Qgis::DEFAULT_Z_COORDINATE = 0.0;
66
67const double Qgis::DEFAULT_M_COORDINATE = 0.0;
68
69const double Qgis::DEFAULT_SNAP_TOLERANCE = 12.0;
70
72
73const int Qgis::USER_CRS_START_ID = 100000;
74const double Qgis::DEFAULT_POINT_SIZE = 2.0;
75const double Qgis::DEFAULT_LINE_WIDTH = 0.26;
76const double Qgis::DEFAULT_SEGMENT_EPSILON = 1e-8;
77
78const int Qgis::PREVIEW_JOB_DELAY_MS = 250;
80
81#ifdef Q_OS_WIN
82const double Qgis::UI_SCALE_FACTOR = 1.5;
83#else
84const double Qgis::UI_SCALE_FACTOR = 1;
85#endif
86
87double qgsPermissiveToDouble( QString string, bool &ok )
88{
89 //remove any thousands separators
90 string.remove( QLocale().groupSeparator() );
91 return QLocale().toDouble( string, &ok );
92}
93
94int qgsPermissiveToInt( QString string, bool &ok )
95{
96 //remove any thousands separators
97 string.remove( QLocale().groupSeparator() );
98 return QLocale().toInt( string, &ok );
99}
100
101qlonglong qgsPermissiveToLongLong( QString string, bool &ok )
102{
103 //remove any thousands separators
104 string.remove( QLocale().groupSeparator() );
105 return QLocale().toLongLong( string, &ok );
106}
107
108void *qgsMalloc( size_t size )
109{
110 if ( size == 0 )
111 {
112 QgsDebugError( u"Zero size requested"_s );
113 return nullptr;
114 }
115
116 if ( ( size >> ( 8 * sizeof( size ) - 1 ) ) != 0 )
117 {
118 QgsDebugError( u"qgsMalloc - bad size requested: %1"_s.arg( size ) );
119 return nullptr;
120 }
121
122 void *p = malloc( size );
123 if ( !p )
124 {
125 QgsDebugError( u"Allocation of %1 bytes failed."_s.arg( size ) );
126 }
127 return p;
128}
129
130void qgsFree( void *ptr )
131{
132 free( ptr );
133}
134
135int qgsVariantCompare( const QVariant &lhs, const QVariant &rhs, bool strictTypeCheck )
136{
137 // invalid < NULL < any value
138 if ( !lhs.isValid() )
139 {
140 return rhs.isValid() ? -1 : 0;
141 }
142 else if ( lhs.isNull() )
143 {
144 if ( !rhs.isValid() )
145 return 1;
146 if ( rhs.isNull() )
147 return 0;
148 return -1;
149 }
150 else if ( !rhs.isValid() || rhs.isNull() )
151 {
152 return 1;
153 }
154
155 if ( strictTypeCheck && lhs.userType() != rhs.userType() )
156 {
157 return lhs.userType() < rhs.userType() ? -1 : 1;
158 }
159
160 // both valid
161 switch ( lhs.userType() )
162 {
163 case QMetaType::Type::Int:
164 case QMetaType::Type::Char:
165 case QMetaType::Type::Short:
166 {
167 switch ( rhs.userType() )
168 {
169 case QMetaType::Type::Int:
170 case QMetaType::Type::Char:
171 case QMetaType::Type::Short:
172 {
173 const int lhsInt = lhs.toInt();
174 const int rhsInt = rhs.toInt();
175 return lhsInt < rhsInt ? -1 : ( lhsInt == rhsInt ? 0 : 1 );
176 }
177
178 case QMetaType::Type::Long:
179 case QMetaType::Type::LongLong:
180 {
181 const long long lhsInt = lhs.toLongLong();
182 const long long rhsInt = rhs.toLongLong();
183 return lhsInt < rhsInt ? -1 : ( lhsInt == rhsInt ? 0 : 1 );
184 }
185
186 case QMetaType::Type::Double:
187 case QMetaType::Type::Float:
188 {
189 const double lhsDouble = static_cast< double >( lhs.toInt() );
190 const double rhsDouble = rhs.toDouble();
191
192 // consider NaN < any non-NaN
193 const bool lhsIsNan = std::isnan( lhsDouble );
194 const bool rhsIsNan = std::isnan( rhsDouble );
195 if ( lhsIsNan )
196 {
197 return rhsIsNan ? 0 : -1;
198 }
199 else if ( rhsIsNan )
200 {
201 return 1;
202 }
203
204 return lhsDouble < rhsDouble ? -1 : ( lhsDouble == rhsDouble ? 0 : 1 );
205 }
206
207 case QMetaType::Type::QString:
208 {
209 bool ok = false;
210 const double rhsDouble = rhs.toDouble( &ok );
211 if ( ok )
212 {
213 const double lhsDouble = static_cast< double >( lhs.toInt() );
214 return lhsDouble < rhsDouble ? -1 : ( lhsDouble == rhsDouble ? 0 : 1 );
215 }
216 break;
217 }
218
219 default:
220 break;
221 }
222 break;
223 }
224
225 case QMetaType::Type::UInt:
226 case QMetaType::Type::UChar:
227 case QMetaType::Type::UShort:
228 {
229 switch ( rhs.userType() )
230 {
231 case QMetaType::Type::UInt:
232 case QMetaType::Type::UChar:
233 case QMetaType::Type::UShort:
234 {
235 const uint lhsUInt = lhs.toUInt();
236 const uint rhsUInt = rhs.toUInt();
237 return lhsUInt < rhsUInt ? -1 : ( lhsUInt == rhsUInt ? 0 : 1 );
238 }
239
240 case QMetaType::Type::ULong:
241 case QMetaType::Type::ULongLong:
242 {
243 const qulonglong lhsInt = lhs.toULongLong();
244 const qulonglong rhsInt = rhs.toULongLong();
245 return lhsInt < rhsInt ? -1 : ( lhsInt == rhsInt ? 0 : 1 );
246 }
247
248 case QMetaType::Type::Double:
249 case QMetaType::Type::Float:
250 {
251 const double lhsDouble = static_cast< double >( lhs.toUInt() );
252 const double rhsDouble = rhs.toDouble();
253
254 // consider NaN < any non-NaN
255 const bool lhsIsNan = std::isnan( lhsDouble );
256 const bool rhsIsNan = std::isnan( rhsDouble );
257 if ( lhsIsNan )
258 {
259 return rhsIsNan ? 0 : -1;
260 }
261 else if ( rhsIsNan )
262 {
263 return 1;
264 }
265
266 return lhsDouble < rhsDouble ? -1 : ( lhsDouble == rhsDouble ? 0 : 1 );
267 }
268
269 case QMetaType::Type::QString:
270 {
271 bool ok = false;
272 const double rhsDouble = rhs.toDouble( &ok );
273 if ( ok )
274 {
275 const double lhsDouble = static_cast< double >( lhs.toUInt() );
276 return lhsDouble < rhsDouble ? -1 : ( lhsDouble == rhsDouble ? 0 : 1 );
277 }
278 break;
279 }
280
281 default:
282 break;
283 }
284 break;
285 }
286
287 case QMetaType::Type::LongLong:
288 case QMetaType::Type::Long:
289 {
290 switch ( rhs.userType() )
291 {
292 case QMetaType::Type::Int:
293 case QMetaType::Type::Char:
294 case QMetaType::Type::Short:
295 case QMetaType::Type::LongLong:
296 case QMetaType::Type::Long:
297 {
298 const qlonglong lhsLongLong = lhs.toLongLong();
299 const qlonglong rhsLongLong = rhs.toLongLong();
300 return lhsLongLong < rhsLongLong ? -1 : ( lhsLongLong == rhsLongLong ? 0 : 1 );
301 }
302
303 case QMetaType::Type::Double:
304 case QMetaType::Type::Float:
305 {
306 const double lhsDouble = static_cast< double >( lhs.toLongLong() );
307 const double rhsDouble = rhs.toDouble();
308
309 // consider NaN < any non-NaN
310 const bool lhsIsNan = std::isnan( lhsDouble );
311 const bool rhsIsNan = std::isnan( rhsDouble );
312 if ( lhsIsNan )
313 {
314 return rhsIsNan ? 0 : -1;
315 }
316 else if ( rhsIsNan )
317 {
318 return 1;
319 }
320
321 return lhsDouble < rhsDouble ? -1 : ( lhsDouble == rhsDouble ? 0 : 1 );
322 }
323
324 case QMetaType::Type::QString:
325 {
326 bool ok = false;
327 const double rhsDouble = rhs.toDouble( &ok );
328 if ( ok )
329 {
330 const double lhsDouble = static_cast< double >( lhs.toLongLong() );
331 return lhsDouble < rhsDouble ? -1 : ( lhsDouble == rhsDouble ? 0 : 1 );
332 }
333 break;
334 }
335
336 default:
337 break;
338 }
339 break;
340 }
341
342 case QMetaType::Type::ULongLong:
343 case QMetaType::Type::ULong:
344 {
345 switch ( rhs.userType() )
346 {
347 case QMetaType::Type::UInt:
348 case QMetaType::Type::UChar:
349 case QMetaType::Type::UShort:
350 case QMetaType::Type::ULongLong:
351 case QMetaType::Type::ULong:
352 {
353 const qulonglong lhsULongLong = lhs.toULongLong();
354 const qulonglong rhsULongLong = rhs.toULongLong();
355 return lhsULongLong < rhsULongLong ? -1 : ( lhsULongLong == rhsULongLong ? 0 : 1 );
356 }
357
358 default:
359 break;
360 }
361 break;
362 }
363
364 case QMetaType::Type::Double:
365 {
366 switch ( rhs.userType() )
367 {
368 case QMetaType::Type::Int:
369 case QMetaType::Type::Char:
370 case QMetaType::Type::Short:
371 case QMetaType::Type::Double:
372 case QMetaType::Type::Float:
373 case QMetaType::Type::LongLong:
374 case QMetaType::Type::Long:
375 case QMetaType::Type::ULongLong:
376 case QMetaType::Type::ULong:
377 case QMetaType::Type::QString:
378 {
379 const double lhsDouble = lhs.toDouble();
380 bool rhsIsDoubleCompatible = false;
381 const double rhsDouble = rhs.toDouble( &rhsIsDoubleCompatible );
382 if ( rhsIsDoubleCompatible )
383 {
384 // consider NaN < any non-NaN
385 const bool lhsIsNan = std::isnan( lhsDouble );
386 const bool rhsIsNan = std::isnan( rhsDouble );
387 if ( lhsIsNan )
388 {
389 return rhsIsNan ? 0 : -1;
390 }
391 else if ( rhsIsNan )
392 {
393 return 1;
394 }
395
396 return lhsDouble < rhsDouble ? -1 : ( lhsDouble == rhsDouble ? 0 : 1 );
397 }
398 break;
399 }
400
401 default:
402 break;
403 }
404 break;
405 }
406
407 case QMetaType::Type::Float:
408 {
409 switch ( rhs.userType() )
410 {
411 case QMetaType::Type::Int:
412 case QMetaType::Type::Char:
413 case QMetaType::Type::Short:
414 case QMetaType::Type::Double:
415 case QMetaType::Type::Float:
416 case QMetaType::Type::LongLong:
417 case QMetaType::Type::Long:
418 case QMetaType::Type::ULongLong:
419 case QMetaType::Type::ULong:
420 case QMetaType::Type::QString:
421 {
422 const float lhsFloat = lhs.toFloat();
423 bool rhsIsFloatCompatible = false;
424 const float rhsFloat = rhs.toFloat( &rhsIsFloatCompatible );
425 if ( rhsIsFloatCompatible )
426 {
427 // consider NaN < any non-NaN
428 const bool lhsIsNan = std::isnan( lhsFloat );
429 const bool rhsIsNan = std::isnan( rhsFloat );
430 if ( lhsIsNan )
431 {
432 return rhsIsNan ? 0 : -1;
433 }
434 else if ( rhsIsNan )
435 {
436 return 1;
437 }
438
439 return lhsFloat < rhsFloat ? -1 : ( lhsFloat == rhsFloat ? 0 : 1 );
440 }
441 break;
442 }
443 default:
444 break;
445 }
446 break;
447 }
448
449 case QMetaType::Type::QChar:
450 {
451 if ( rhs.userType() == QMetaType::Type::QChar )
452 {
453 const QChar lhsChar = lhs.toChar();
454 const QChar rhsChar = rhs.toChar();
455 return lhsChar < rhsChar ? -1 : ( lhsChar == rhsChar ? 0 : 1 );
456 }
457 break;
458 }
459
460 case QMetaType::Type::QDate:
461 {
462 if ( rhs.userType() == QMetaType::Type::QDate )
463 {
464 const QDate lhsDate = lhs.toDate();
465 const QDate rhsDate = rhs.toDate();
466 return lhsDate < rhsDate ? -1 : ( lhsDate == rhsDate ? 0 : 1 );
467 }
468 break;
469 }
470
471 case QMetaType::Type::QTime:
472 {
473 if ( rhs.userType() == QMetaType::Type::QTime )
474 {
475 const QTime lhsTime = lhs.toTime();
476 const QTime rhsTime = rhs.toTime();
477 return lhsTime < rhsTime ? -1 : ( lhsTime == rhsTime ? 0 : 1 );
478 }
479 break;
480 }
481
482 case QMetaType::Type::QDateTime:
483 {
484 if ( rhs.userType() == QMetaType::Type::QDateTime )
485 {
486 const QDateTime lhsTime = lhs.toDateTime();
487 const QDateTime rhsTime = rhs.toDateTime();
488 return lhsTime < rhsTime ? -1 : ( lhsTime == rhsTime ? 0 : 1 );
489 }
490 break;
491 }
492
493 case QMetaType::Type::Bool:
494 {
495 if ( rhs.userType() == QMetaType::Type::Bool )
496 {
497 const bool lhsBool = lhs.toBool();
498 const bool rhsBool = rhs.toBool();
499 return lhsBool == rhsBool ? 0 : ( lhsBool ? 1 : -1 );
500 }
501 break;
502 }
503
504 case QMetaType::Type::QVariantList:
505 {
506 if ( rhs.userType() == QMetaType::Type::QVariantList )
507 {
508 const QList<QVariant> &lhsl = lhs.toList();
509 const QList<QVariant> &rhsl = rhs.toList();
510
511 int i, n = std::min( lhsl.size(), rhsl.size() );
512 for ( i = 0; i < n && lhsl[i].userType() == rhsl[i].userType() && qgsVariantCompare( lhsl[i], rhsl[i] ) == 0; i++ )
513 ;
514
515 if ( i == n )
516 return lhsl.size() < rhsl.size() ? -1 : ( lhsl.size() > rhsl.size() ? 1 : 0 );
517 else
518 return qgsVariantCompare( lhsl[i], rhsl[i] );
519 }
520 break;
521 }
522
523 case QMetaType::Type::QStringList:
524 {
525 if ( rhs.userType() == QMetaType::Type::QStringList )
526 {
527 const QStringList &lhsl = lhs.toStringList();
528 const QStringList &rhsl = rhs.toStringList();
529
530 int i, n = std::min( lhsl.size(), rhsl.size() );
531 for ( i = 0; i < n && lhsl[i] == rhsl[i]; i++ )
532 ;
533
534 if ( i == n )
535 return lhsl.size() < rhsl.size() ? -1 : ( lhsl.size() > rhsl.size() ? 1 : 0 );
536 else
537 return lhsl[i] < rhsl[i] ? -1 : ( lhsl[i] == rhsl[i] ? 0 : 1 );
538 }
539 break;
540 }
541
542 case QMetaType::Type::QString:
543 {
544 switch ( rhs.userType() )
545 {
546 case QMetaType::Type::Int:
547 case QMetaType::Type::Char:
548 case QMetaType::Type::Short:
549 case QMetaType::Type::Double:
550 case QMetaType::Type::Float:
551 case QMetaType::Type::LongLong:
552 case QMetaType::Type::Long:
553 case QMetaType::Type::ULongLong:
554 case QMetaType::Type::ULong:
555 {
556 // try string to numeric conversion
557 bool lhsIsDoubleCompatible = false;
558 const double lhsDouble = lhs.toDouble( &lhsIsDoubleCompatible );
559 if ( lhsIsDoubleCompatible )
560 {
561 const double rhsDouble = rhs.toDouble();
562 // consider NaN < any non-NaN
563 const bool lhsIsNan = std::isnan( lhsDouble );
564 const bool rhsIsNan = std::isnan( rhsDouble );
565 if ( lhsIsNan )
566 {
567 return rhsIsNan ? 0 : -1;
568 }
569 else if ( rhsIsNan )
570 {
571 return 1;
572 }
573
574 return lhsDouble < rhsDouble ? -1 : ( lhsDouble == rhsDouble ? 0 : 1 );
575 }
576 break;
577 }
578
579 default:
580 break;
581 }
582
583 break;
584 }
585
586 default:
587 break;
588 }
589 return std::clamp( QString::localeAwareCompare( lhs.toString(), rhs.toString() ), -1, 1 );
590}
591
592bool qgsVariantLessThan( const QVariant &lhs, const QVariant &rhs )
593{
594 return qgsVariantCompare( lhs, rhs ) < 0;
595}
596
597bool qgsVariantGreaterThan( const QVariant &lhs, const QVariant &rhs )
598{
599 return qgsVariantCompare( lhs, rhs ) > 0;
600}
601
602QString qgsVsiPrefix( const QString &path )
603{
604 return QgsGdalUtils::vsiPrefixForPath( path );
605}
606
607uint qHash( const QVariant &variant )
608{
609 if ( !variant.isValid() || variant.isNull() )
610 return std::numeric_limits<uint>::max();
611
612 switch ( variant.userType() )
613 {
614 case QMetaType::Type::Int:
615 return qHash( variant.toInt() );
616 case QMetaType::Type::UInt:
617 return qHash( variant.toUInt() );
618 case QMetaType::Type::Bool:
619 return qHash( variant.toBool() );
620 case QMetaType::Type::Double:
621 return qHash( variant.toDouble() );
622 case QMetaType::Type::LongLong:
623 return qHash( variant.toLongLong() );
624 case QMetaType::Type::ULongLong:
625 return qHash( variant.toULongLong() );
626 case QMetaType::Type::QString:
627 return qHash( variant.toString() );
628 case QMetaType::Type::QChar:
629 return qHash( variant.toChar() );
630 case QMetaType::Type::QVariantList:
631 return qHash( variant.toList() );
632 case QMetaType::Type::QStringList:
633 return qHash( variant.toStringList() );
634 case QMetaType::Type::QByteArray:
635 return qHash( variant.toByteArray() );
636 case QMetaType::Type::QDate:
637 return qHash( variant.toDate() );
638 case QMetaType::Type::QTime:
639 return qHash( variant.toTime() );
640 case QMetaType::Type::QDateTime:
641 return qHash( variant.toDateTime() );
642 case QMetaType::Type::QUrl:
643 case QMetaType::Type::QLocale:
644 case QMetaType::Type::QRegularExpression:
645 return qHash( variant.toString() );
646 default:
647 break;
648 }
649
650 return std::numeric_limits<uint>::max();
651}
652
653bool qgsVariantEqual( const QVariant &lhs, const QVariant &rhs )
654{
655 if ( lhs.isNull() == rhs.isNull() )
656 {
657 if ( lhs.type() == QVariant::String && rhs.type() == QVariant::String )
658 {
659 const QString lhsString = lhs.toString();
660 const QString rhsString = rhs.toString();
661 return lhsString.isNull() == rhsString.isNull()
662 && lhsString.isEmpty() == rhsString.isEmpty()
663 && lhsString == rhsString;
664 }
665 if ( lhs == rhs )
666 return true;
667 }
668
669 return ( lhs.isNull() && rhs.isNull() && lhs.isValid() && rhs.isValid() );
670}
671
673{
674 return QStringLiteral( "1:1000000,1:500000,1:250000,1:100000,1:50000,1:25000,"
675 "1:10000,1:5000,1:2500,1:1000,1:500" );
676}
677
679{
680 return QString::fromUtf8( VERSION );
681}
682
684{
685 // Version number used for comparing versions using the
686 // "Check QGIS Version" function
687 return VERSION_INT;
688}
689
691{
692 return QString::fromUtf8( RELEASE_NAME );
693}
694
696{
697 return QString::fromUtf8( QGIS_DEV_VERSION );
698}
699
701{
702 return GEOSversion();
703}
704
706{
707#ifdef WITH_SFCGAL
708 return true;
709#else
710 return false;
711#endif
712}
713
715{
716#ifdef WITH_SFCGAL
717 return SFCGAL_VERSION_MAJOR_INT * 10000 + SFCGAL_VERSION_MINOR_INT * 100 + SFCGAL_VERSION_PATCH_INT;
718#else
719 throw QgsNotSupportedException( QObject::tr( "This operation requires a QGIS build based SFCGAL." ) );
720#endif
721}
722
724{
725#ifdef WITH_GEOGRAPHICLIB
726 return true;
727#else
728 return false;
729#endif
730}
731
733{
734#ifdef WITH_GEOGRAPHICLIB
735 return GEOGRAPHICLIB_VERSION_MAJOR * 10000 + GEOGRAPHICLIB_VERSION_MINOR * 100 + GEOGRAPHICLIB_VERSION_PATCH;
736#else
737 throw QgsNotSupportedException( u"GeographicLib is not available on this system"_s );
738#endif
739}
740
742{
743 return false;
744}
745
747{
748 static const int version = u"%1%2%3"_s
749 .arg( GEOS_VERSION_MAJOR, 2, 10, QChar( '0' ) )
750 .arg( GEOS_VERSION_MINOR, 2, 10, QChar( '0' ) )
751 .arg( geosVersionPatch(), 2, 10, QChar( '0' ) ).toInt()
752 ;
753 return version;
754}
755
757{
758 return GEOS_VERSION_MAJOR;
759}
760
762{
763 return GEOS_VERSION_MINOR;
764}
765
767{
768 static const int version = atoi( qgis_xstr( GEOS_VERSION_PATCH ) );
769 return version;
770}
static const Qgis::MapToolUnit DEFAULT_SNAP_UNITS
Default snapping distance units.
Definition qgis.h:6497
MapToolUnit
Type of unit of tolerance value from settings.
Definition qgis.h:5041
@ Pixels
Pixels unit of tolerance.
Definition qgis.h:5043
static const double DEFAULT_LINE_WIDTH
The default width (in millimeters) for line symbols.
Definition qgis.h:6508
static const double DEFAULT_HIGHLIGHT_MIN_WIDTH_MM
Default highlight line/stroke minimum width in mm.
Definition qgis.h:6459
static QString version()
Version string.
Definition qgis.cpp:678
static const int PREVIEW_JOB_DELAY_MS
Delay between the scheduling of 2 preview jobs.
Definition qgis.h:6514
static const double DEFAULT_Z_COORDINATE
Default Z coordinate value.
Definition qgis.h:6474
static const char * QGIS_DEV_VERSION
The development version.
Definition qgis.h:87
static QString geosVersion()
GEOS string version linked.
Definition qgis.cpp:700
static const double DEFAULT_SNAP_TOLERANCE
Default snapping distance tolerance.
Definition qgis.h:6492
static int geographicLibVersion()
Returns the version of the GeographicLib library if QGIS is built with GeographicLib support.
Definition qgis.cpp:732
static const double DEFAULT_M_COORDINATE
Default M coordinate value.
Definition qgis.h:6481
static const double DEFAULT_HIGHLIGHT_BUFFER_MM
Default highlight buffer in mm.
Definition qgis.h:6454
static int geosVersionPatch()
GEOS Patch version number linked.
Definition qgis.cpp:766
static const QColor DEFAULT_HIGHLIGHT_COLOR
Default highlight color.
Definition qgis.h:6449
static Q_DECL_DEPRECATED const double SCALE_PRECISION
Fudge factor used to compare two scales.
Definition qgis.h:6468
static const int MAXIMUM_LAYER_PREVIEW_TIME_MS
Maximum rendering time for a layer of a preview job.
Definition qgis.h:6517
static Q_DECL_DEPRECATED bool hasQtWebkit()
Returns false.
Definition qgis.cpp:741
static QString devVersion()
The development version.
Definition qgis.cpp:695
static QString releaseName()
Release name.
Definition qgis.cpp:690
static QString defaultProjectScales()
A string with default project scales.
Definition qgis.cpp:672
static bool hasGeographicLib()
Returns true if the QGIS build contains GeographicLib.
Definition qgis.cpp:723
static const float DEFAULT_MAPTOPIXEL_THRESHOLD
Default threshold between map coordinates and device coordinates for map2pixel simplification.
Definition qgis.h:6442
static int geosVersionMajor()
GEOS Major version number linked.
Definition qgis.cpp:756
static bool hasSfcgal()
Returns true if the QGIS build contains SFCGAL.
Definition qgis.cpp:705
static int sfcgalVersionInt()
Returns the version of the SFCGAL library if QGIS is built with SFCGAL.
Definition qgis.cpp:714
static const double DEFAULT_SEARCH_RADIUS_MM
Identify search radius in mm.
Definition qgis.h:6439
static const double DEFAULT_SEGMENT_EPSILON
Default snapping tolerance for segments.
Definition qgis.h:6511
static int versionInt()
Version number used for comparing versions using the "Check QGIS Version" function.
Definition qgis.cpp:683
static const int USER_CRS_START_ID
Minimum ID number for a user-defined projection.
Definition qgis.h:6502
static int geosVersionMinor()
GEOS Minor version number linked.
Definition qgis.cpp:761
static int geosVersionInt()
GEOS version number linked.
Definition qgis.cpp:746
static const double UI_SCALE_FACTOR
UI scaling factor.
Definition qgis.h:6487
static const double DEFAULT_POINT_SIZE
The default size (in millimeters) for point marker symbols.
Definition qgis.h:6505
static QString vsiPrefixForPath(const QString &path)
Returns a the vsi prefix which corresponds to a file path, or an empty string if the path is not asso...
Custom exception class which is raised when an operation is not supported.
#define qgis_xstr(x)
Definition qgis.cpp:44
void * qgsMalloc(size_t size)
Allocates size bytes and returns a pointer to the allocated memory.
Definition qgis.cpp:108
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:101
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:653
uint qHash(const QVariant &variant)
Hash for QVariant.
Definition qgis.cpp:607
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:87
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:94
void qgsFree(void *ptr)
Frees the memory space pointed to by ptr.
Definition qgis.cpp:130
QString qgsVsiPrefix(const QString &path)
Returns a the vsi prefix which corresponds to a file path, or an empty string if the path is not asso...
Definition qgis.cpp:602
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:592
int qgsVariantCompare(const QVariant &lhs, const QVariant &rhs, bool strictTypeCheck)
Compares two QVariant values.
Definition qgis.cpp:135
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:597
#define QgsDebugError(str)
Definition qgslogger.h:59