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 );
228 static void init( QString profileFolder = QString() )
SIP_SKIP;
231 bool event( QEvent *event ) override;
234 bool notify( QObject *receiver, QEvent *event ) override;
237 static
void setFileOpenEventReceiver( QObject *receiver );
249 static
void setThemeName( const QString &themeName );
255 static QString resolvePkgPath();
264 static QString themeName();
273 static
void setUITheme( const QString &themeName );
281 static QHash<QString, QString> uiThemes();
284 static QString authorsFilePath();
291 static QString contributorsFilePath();
299 static QString developersMapFilePath();
302 static QString sponsorsFilePath();
305 static QString donorsFilePath();
308 static QString serverResourcesPath();
313 static QString translatorsFilePath();
318 static QString licenceFilePath();
321 static QString i18nPath();
327 static QString metadataPath();
330 static QString qgisMasterDatabaseFilePath();
333 static QString qgisSettingsDirPath();
336 static QString qgisUserDatabaseFilePath();
339 static QString qgisAuthDatabaseFilePath();
342 static QString splashPath();
345 static QString iconsPath();
348 static QString srsDatabaseFilePath();
355 static
void setSvgPaths( const QStringList &svgPaths );
358 static QStringList svgPaths();
364 static QStringList layoutTemplatePaths();
367 static QMap<QString, QString> systemEnvVars();
370 static QString prefixPath();
373 static QString pluginPath();
376 static QString pkgDataPath();
379 static QString activeThemePath();
382 static QString defaultThemePath();
388 static QString iconPath( const QString &iconFile );
397 static QIcon getThemeIcon( const QString &name, const QColor &fillColor = QColor(), const QColor &strokeColor = QColor() );
420 static QCursor getThemeCursor( Cursor cursor );
430 static QPixmap getThemePixmap(
const QString &name,
const QColor &foreColor = QColor(),
const QColor &backColor = QColor(),
int size = 16 );
433 static QString userStylePath();
440 static QRegularExpression shortNameRegularExpression();
447 static QString userLoginName();
454 static QString userFullName();
461 static QString osName();
470 static int systemMemorySizeMb();
477 static QString platform();
491 static QString applicationFullName();
497 static QString locale();
505 static void setLocale(
const QLocale &locale );
508 static QString userThemesFolder();
511 static QString defaultStylePath();
514 static QString defaultThemesFolder();
517 static QString libraryPath();
520 static QString libexecPath();
528 static QString qmlImportPath();
531 static void setPrefixPath(
const QString &prefixPath,
bool useDefaultPaths =
false );
534 static void setPluginPath(
const QString &pluginPath );
537 static void setPkgDataPath(
const QString &pkgDataPath );
540 static void setDefaultSvgPaths(
const QStringList &pathList );
543 static void setAuthDatabaseDirPath(
const QString &authDbDirPath );
546 static void initQgis();
549 static bool createDatabase( QString *errorMessage =
nullptr );
552 static bool createThemeFolder();
555 static void exitQgis();
558 static QString appIconPath();
568 static endian_t endian();
590 static QString showSettings();
599 static void registerOgrDrivers();
602 static QString absolutePathToRelativePath(
const QString &apath,
const QString &targetPath );
604 static QString relativePathToAbsolutePath(
const QString &rpath,
const QString &targetPath );
608#if defined(_MSC_VER) && !defined(USING_NMAKE) && !defined(USING_NINJA)
609 static QString cfgIntDir()
SIP_SKIP;
612 static QString buildSourcePath();
614 static QString buildOutputPath();
621 static void skipGdalDriver(
const QString &driver );
628 static void restoreGdalDriver(
const QString &driver );
634 static QStringList skippedGdalDrivers();
642 static void applyGdalSkippedDrivers();
648 static void registerGdalDriversFromSettings();
656 static QStringList deferredSkippedGdalDrivers();
664 static void setSkippedGdalDrivers(
const QStringList &skippedGdalDrivers,
665 const QStringList &deferredSkippedGdalDrivers );
671 static int maxThreads();
678 static void setMaxThreads(
int maxThreads );
910 static QgsAnnotationRegistry *annotationRegistry()
SIP_SKIP;
997 static QString nullRepresentation();
1002 static
void setNullRepresentation( const QString &nullRepresentation );
1011 static QVariantMap customVariables();
1020 static
void setCustomVariables( const QVariantMap &customVariables );
1027 static
void setCustomVariable( const QString &name, const QVariant &value );
1038 static
int scaleIconSize(
int standardSize,
bool applyDevicePixelRatio = false );
1048 int maxConcurrentConnectionsPerPool() const;
1055 static
void setTranslation( const QString &translation );
1062 QString translation() const;
1088 bool x11EventFilter( XEvent *event );
1127 static void copyPath(
const QString &src,
const QString &dst );
1128 static QObject *
ABISYM( mFileOpenEventReceiver );
1130 static bool ABISYM( mInitialized );
1133 static bool ABISYM( mRunningFromBuildDir );
1138 static int ABISYM( sMaxThreads );
1140 QMap<QString, QIcon> mIconCache;
1141 QMap<Cursor, QCursor> mCursorCache;
1143 QTranslator *mQgisTranslator =
nullptr;
1144 QTranslator *mQtTranslator =
nullptr;
1145 QTranslator *mQtBaseTranslator =
nullptr;
1150 struct ApplicationMembers
1157 QgsAnnotationRegistry *mAnnotationRegistry =
nullptr;
1197 QString mNullRepresentation;
1198 QStringList mSvgPathCache;
1199 bool mSvgPathCacheValid =
false;
1201 ApplicationMembers();
1202 ~ApplicationMembers();
1206 ApplicationMembers *mApplicationMembers =
nullptr;
1208 static ApplicationMembers *sApplicationMembers;
1212 static ApplicationMembers *members();
1214 static void invalidateCaches();
1220 void installTranslators()
SIP_SKIP;
1222 friend class TestQgsApplication;