101 static char **qtgui_ArgvToC( PyObject *argvlist,
int &argc )
105 argc = PyList_GET_SIZE( argvlist );
109 if ( ( argv = (
char ** )sipMalloc( 2 * ( argc + 1 ) *
sizeof(
char * ) ) ) == NULL )
113 for (
int a = 0; a < argc; ++a )
117 if ( ( arg = PyBytes_AsString( PyList_GET_ITEM( argvlist, a ) ) ) == NULL ||
118 ( argv[a] = (
char * )sipMalloc( strlen( arg ) + 1 ) ) == NULL )
121 strcpy( argv[a], arg );
122 argv[a + argc + 1] = argv[a];
125 argv[argc + argc + 1] = argv[argc] = NULL;
132 static void qtgui_UpdatePyArgv( PyObject *argvlist,
int argc,
char **argv )
134 for (
int a = 0, na = 0; a < argc; ++a )
137 if ( argv[na] == argv[a + argc + 1] )
140 PyList_SetSlice( argvlist, na, na + 1, NULL );
178 QgsApplication(
int &argc,
char **argv,
bool GUIenabled,
const QString &profileFolder = QString(),
const QString &platformName =
"external" );
189 QgsApplication( SIP_PYLIST argv,
bool GUIenabled, QString profileFolder = QString(), QString platformName =
"external" ) / PostHook = __pyQtQAppHook__ / [(
int &argc,
char **argv,
bool GUIenabled,
const QString &profileFolder = QString(),
const QString &platformName =
"desktop" )];
197 if ( ( argv = qtgui_ArgvToC( a0, argc ) ) == NULL )
202 static int nargc = argc;
204 sipCpp =
new sipQgsApplication( nargc, argv, a1, *a2, *a3 );
207 qtgui_UpdatePyArgv( a0, argc, argv );
227 static void init( QString profileFolder = QString() )
SIP_SKIP;
230 bool event( QEvent *event ) override;
233 bool notify( QObject *receiver, QEvent *event ) override;
236 static
void setFileOpenEventReceiver( QObject *receiver );
248 static
void setThemeName( const QString &themeName );
254 static QString resolvePkgPath();
263 static QString themeName();
272 static
void setUITheme( const QString &themeName );
280 static QHash<QString, QString> uiThemes();
283 static QString authorsFilePath();
290 static QString contributorsFilePath();
297 static QString developersMapFilePath();
300 static QString sponsorsFilePath();
303 static QString donorsFilePath();
306 static QString serverResourcesPath();
311 static QString translatorsFilePath();
316 static QString licenceFilePath();
319 static QString i18nPath();
324 static QString metadataPath();
327 static QString qgisMasterDatabaseFilePath();
330 static QString qgisSettingsDirPath();
333 static QString qgisUserDatabaseFilePath();
336 static QString qgisAuthDatabaseFilePath();
339 static QString splashPath();
342 static QString iconsPath();
345 static QString srsDatabaseFilePath();
352 static
void setSvgPaths( const QStringList &svgPaths );
355 static QStringList svgPaths();
360 static QStringList layoutTemplatePaths();
363 static QMap<QString, QString> systemEnvVars();
366 static QString prefixPath();
369 static QString pluginPath();
372 static QString pkgDataPath();
375 static QString activeThemePath();
378 static QString defaultThemePath();
384 static QString iconPath( const QString &iconFile );
393 static QIcon getThemeIcon( const QString &name, const QColor &fillColor = QColor(), const QColor &strokeColor = QColor() );
416 static QCursor getThemeCursor( Cursor cursor );
426 static QPixmap getThemePixmap(
const QString &name,
const QColor &foreColor = QColor(),
const QColor &backColor = QColor(),
int size = 16 );
429 static QString userStylePath();
436 static QRegularExpression shortNameRegularExpression();
442 static QString userLoginName();
448 static QString userFullName();
454 static QString osName();
463 static int systemMemorySizeMb();
469 static QString platform();
483 static QString applicationFullName();
488 static QString locale();
496 static void setLocale(
const QLocale &locale );
499 static QString userThemesFolder();
502 static QString defaultStylePath();
505 static QString defaultThemesFolder();
508 static QString libraryPath();
511 static QString libexecPath();
519 static QString qmlImportPath();
522 static void setPrefixPath(
const QString &prefixPath,
bool useDefaultPaths =
false );
525 static void setPluginPath(
const QString &pluginPath );
528 static void setPkgDataPath(
const QString &pkgDataPath );
531 static void setDefaultSvgPaths(
const QStringList &pathList );
534 static void setAuthDatabaseDirPath(
const QString &authDbDirPath );
537 static void initQgis();
540 static bool createDatabase( QString *errorMessage =
nullptr );
543 static bool createThemeFolder();
546 static void exitQgis();
549 static QString appIconPath();
559 static endian_t endian();
581 static QString showSettings();
590 static void registerOgrDrivers();
593 static QString absolutePathToRelativePath(
const QString &apath,
const QString &targetPath );
595 static QString relativePathToAbsolutePath(
const QString &rpath,
const QString &targetPath );
599#if defined(_MSC_VER) && !defined(USING_NMAKE) && !defined(USING_NINJA)
600 static QString cfgIntDir()
SIP_SKIP;
603 static QString buildSourcePath();
605 static QString buildOutputPath();
612 static void skipGdalDriver(
const QString &driver );
619 static void restoreGdalDriver(
const QString &driver );
625 static QStringList skippedGdalDrivers();
633 static void applyGdalSkippedDrivers();
639 static void registerGdalDriversFromSettings();
647 static QStringList deferredSkippedGdalDrivers();
655 static void setSkippedGdalDrivers(
const QStringList &skippedGdalDrivers,
656 const QStringList &deferredSkippedGdalDrivers );
661 static int maxThreads();
667 static void setMaxThreads(
int maxThreads );
883 static QgsAnnotationRegistry *annotationRegistry()
SIP_SKIP;
967 static QString nullRepresentation();
972 static
void setNullRepresentation( const QString &nullRepresentation );
980 static QVariantMap customVariables();
988 static
void setCustomVariables( const QVariantMap &customVariables );
994 static
void setCustomVariable( const QString &name, const QVariant &value );
1005 static
int scaleIconSize(
int standardSize,
bool applyDevicePixelRatio = false );
1015 int maxConcurrentConnectionsPerPool() const;
1022 static
void setTranslation( const QString &translation );
1029 QString translation() const;
1055 bool x11EventFilter( XEvent *event );
1093 static void copyPath(
const QString &src,
const QString &dst );
1094 static QObject *
ABISYM( mFileOpenEventReceiver );
1096 static bool ABISYM( mInitialized );
1099 static bool ABISYM( mRunningFromBuildDir );
1103 static int ABISYM( sMaxThreads );
1105 QMap<QString, QIcon> mIconCache;
1106 QMap<Cursor, QCursor> mCursorCache;
1108 QTranslator *mQgisTranslator =
nullptr;
1109 QTranslator *mQtTranslator =
nullptr;
1110 QTranslator *mQtBaseTranslator =
nullptr;
1115 struct ApplicationMembers
1122 QgsAnnotationRegistry *mAnnotationRegistry =
nullptr;
1162 QString mNullRepresentation;
1163 QStringList mSvgPathCache;
1164 bool mSvgPathCacheValid =
false;
1166 ApplicationMembers();
1167 ~ApplicationMembers();
1171 ApplicationMembers *mApplicationMembers =
nullptr;
1173 static ApplicationMembers *sApplicationMembers;
1177 static ApplicationMembers *members();
1179 static void invalidateCaches();
1185 void installTranslators()
SIP_SKIP;
1187 friend class TestQgsApplication;