102 static char **qtgui_ArgvToC( PyObject *argvlist,
int &argc )
106 argc = PyList_GET_SIZE( argvlist );
110 if ( ( argv = (
char ** )sipMalloc( 2 * ( argc + 1 ) *
sizeof(
char * ) ) ) == NULL )
114 for (
int a = 0; a < argc; ++a )
118 if ( ( arg = PyBytes_AsString( PyList_GET_ITEM( argvlist, a ) ) ) == NULL ||
119 ( argv[a] = (
char * )sipMalloc( strlen( arg ) + 1 ) ) == NULL )
122 strcpy( argv[a], arg );
123 argv[a + argc + 1] = argv[a];
126 argv[argc + argc + 1] = argv[argc] = NULL;
133 static void qtgui_UpdatePyArgv( PyObject *argvlist,
int argc,
char **argv )
135 for (
int a = 0, na = 0; a < argc; ++a )
138 if ( argv[na] == argv[a + argc + 1] )
141 PyList_SetSlice( argvlist, na, na + 1, NULL );
179 QgsApplication(
int &argc,
char **argv,
bool GUIenabled,
const QString &profileFolder = QString(),
const QString &platformName =
"external" );
190 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" )];
198 if ( ( argv = qtgui_ArgvToC( a0, argc ) ) == NULL )
203 static int nargc = argc;
205 sipCpp =
new sipQgsApplication( nargc, argv, a1, *a2, *a3 );
208 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();
298 static QString developersMapFilePath();
301 static QString sponsorsFilePath();
304 static QString donorsFilePath();
307 static QString serverResourcesPath();
312 static QString translatorsFilePath();
317 static QString licenceFilePath();
320 static QString i18nPath();
325 static QString metadataPath();
328 static QString qgisMasterDatabaseFilePath();
331 static QString qgisSettingsDirPath();
334 static QString qgisUserDatabaseFilePath();
337 static QString qgisAuthDatabaseFilePath();
340 static QString splashPath();
343 static QString iconsPath();
346 static QString srsDatabaseFilePath();
353 static
void setSvgPaths( const QStringList &svgPaths );
356 static QStringList svgPaths();
361 static QStringList layoutTemplatePaths();
364 static QMap<QString, QString> systemEnvVars();
367 static QString prefixPath();
370 static QString pluginPath();
373 static QString pkgDataPath();
376 static QString activeThemePath();
379 static QString defaultThemePath();
385 static QString iconPath( const QString &iconFile );
394 static QIcon getThemeIcon( const QString &name, const QColor &fillColor = QColor(), const QColor &strokeColor = QColor() );
417 static QCursor getThemeCursor( Cursor cursor );
427 static QPixmap getThemePixmap(
const QString &name,
const QColor &foreColor = QColor(),
const QColor &backColor = QColor(),
int size = 16 );
430 static QString userStylePath();
437 static QRegularExpression shortNameRegularExpression();
443 static QString userLoginName();
449 static QString userFullName();
455 static QString osName();
464 static int systemMemorySizeMb();
470 static QString platform();
484 static QString applicationFullName();
489 static QString locale();
497 static void setLocale(
const QLocale &locale );
500 static QString userThemesFolder();
503 static QString defaultStylePath();
506 static QString defaultThemesFolder();
509 static QString libraryPath();
512 static QString libexecPath();
520 static QString qmlImportPath();
523 static void setPrefixPath(
const QString &prefixPath,
bool useDefaultPaths =
false );
526 static void setPluginPath(
const QString &pluginPath );
529 static void setPkgDataPath(
const QString &pkgDataPath );
532 static void setDefaultSvgPaths(
const QStringList &pathList );
535 static void setAuthDatabaseDirPath(
const QString &authDbDirPath );
538 static void initQgis();
541 static bool createDatabase( QString *errorMessage =
nullptr );
544 static bool createThemeFolder();
547 static void exitQgis();
550 static QString appIconPath();
560 static endian_t endian();
582 static QString showSettings();
591 static void registerOgrDrivers();
594 static QString absolutePathToRelativePath(
const QString &apath,
const QString &targetPath );
596 static QString relativePathToAbsolutePath(
const QString &rpath,
const QString &targetPath );
600#if defined(_MSC_VER) && !defined(USING_NMAKE) && !defined(USING_NINJA)
601 static QString cfgIntDir()
SIP_SKIP;
604 static QString buildSourcePath();
606 static QString buildOutputPath();
613 static void skipGdalDriver(
const QString &driver );
620 static void restoreGdalDriver(
const QString &driver );
626 static QStringList skippedGdalDrivers();
634 static void applyGdalSkippedDrivers();
640 static void registerGdalDriversFromSettings();
648 static QStringList deferredSkippedGdalDrivers();
656 static void setSkippedGdalDrivers(
const QStringList &skippedGdalDrivers,
657 const QStringList &deferredSkippedGdalDrivers );
662 static int maxThreads();
668 static void setMaxThreads(
int maxThreads );
884 static QgsAnnotationRegistry *annotationRegistry()
SIP_SKIP;
974 static QString nullRepresentation();
979 static
void setNullRepresentation( const QString &nullRepresentation );
987 static QVariantMap customVariables();
995 static
void setCustomVariables( const QVariantMap &customVariables );
1001 static
void setCustomVariable( const QString &name, const QVariant &value );
1012 static
int scaleIconSize(
int standardSize,
bool applyDevicePixelRatio = false );
1022 int maxConcurrentConnectionsPerPool() const;
1029 static
void setTranslation( const QString &translation );
1036 QString translation() const;
1062 bool x11EventFilter( XEvent *event );
1100 static void copyPath(
const QString &src,
const QString &dst );
1101 static QObject *
ABISYM( mFileOpenEventReceiver );
1103 static bool ABISYM( mInitialized );
1106 static bool ABISYM( mRunningFromBuildDir );
1110 static int ABISYM( sMaxThreads );
1112 QMap<QString, QIcon> mIconCache;
1113 QMap<Cursor, QCursor> mCursorCache;
1115 QTranslator *mQgisTranslator =
nullptr;
1116 QTranslator *mQtTranslator =
nullptr;
1117 QTranslator *mQtBaseTranslator =
nullptr;
1122 struct ApplicationMembers
1129 QgsAnnotationRegistry *mAnnotationRegistry =
nullptr;
1170 QString mNullRepresentation;
1171 QStringList mSvgPathCache;
1172 bool mSvgPathCacheValid =
false;
1174 ApplicationMembers();
1175 ~ApplicationMembers();
1179 ApplicationMembers *mApplicationMembers =
nullptr;
1181 static ApplicationMembers *sApplicationMembers;
1185 static ApplicationMembers *members();
1187 static void invalidateCaches();
1193 void installTranslators()
SIP_SKIP;
1195 friend class TestQgsApplication;