104 static char **qtgui_ArgvToC( PyObject *argvlist,
int &argc )
108 argc = PyList_GET_SIZE( argvlist );
112 if ( ( argv = (
char ** )sipMalloc( 2 * ( argc + 1 ) *
sizeof(
char * ) ) ) == NULL )
116 for (
int a = 0; a < argc; ++a )
120 if ( ( arg = PyBytes_AsString( PyList_GET_ITEM( argvlist, a ) ) ) == NULL ||
121 ( argv[a] = (
char * )sipMalloc( strlen( arg ) + 1 ) ) == NULL )
124 strcpy( argv[a], arg );
125 argv[a + argc + 1] = argv[a];
128 argv[argc + argc + 1] = argv[argc] = NULL;
135 static void qtgui_UpdatePyArgv( PyObject *argvlist,
int argc,
char **argv )
137 for (
int a = 0, na = 0; a < argc; ++a )
140 if ( argv[na] == argv[a + argc + 1] )
143 PyList_SetSlice( argvlist, na, na + 1, NULL );
181 QgsApplication(
int &argc,
char **argv,
bool GUIenabled,
const QString &profileFolder = QString(),
const QString &platformName =
"external" );
192 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" )];
200 if ( ( argv = qtgui_ArgvToC( a0, argc ) ) == NULL )
205 static int nargc = argc;
207 sipCpp =
new sipQgsApplication( nargc, argv, a1, *a2, *a3 );
210 qtgui_UpdatePyArgv( a0, argc, argv );
230 static void init( QString profileFolder = QString() )
SIP_SKIP;
233 bool event( QEvent *event ) override;
236 bool notify( QObject *receiver, QEvent *event ) override;
239 static
void setFileOpenEventReceiver( QObject *receiver );
251 static
void setThemeName( const QString &themeName );
257 static QString resolvePkgPath();
266 static QString themeName();
275 static
void setUITheme( const QString &themeName );
283 static QHash<QString, QString> uiThemes();
286 static QString authorsFilePath();
293 static QString contributorsFilePath();
300 static QString developersMapFilePath();
303 static QString sponsorsFilePath();
306 static QString donorsFilePath();
309 static QString serverResourcesPath();
314 static QString translatorsFilePath();
319 static QString licenceFilePath();
322 static QString i18nPath();
327 static QString metadataPath();
330 static QString qgisMasterDatabaseFilePath();
333 static QString qgisSettingsDirPath();
336 static QString qgisUserDatabaseFilePath();
342 Q_DECL_DEPRECATED static QString qgisAuthDatabaseFilePath()
SIP_DEPRECATED;
351 static QString qgisAuthDatabaseUri();
354 static QString splashPath();
357 static QString iconsPath();
360 static QString srsDatabaseFilePath();
367 static
void setSvgPaths( const QStringList &svgPaths );
370 static QStringList svgPaths();
375 static QStringList layoutTemplatePaths();
378 static QMap<QString, QString> systemEnvVars();
381 static QString prefixPath();
384 static QString pluginPath();
387 static QString pkgDataPath();
390 static QString activeThemePath();
393 static QString defaultThemePath();
399 static QString iconPath( const QString &iconFile );
408 static QIcon getThemeIcon( const QString &name, const QColor &fillColor = QColor(), const QColor &strokeColor = QColor() );
431 static QCursor getThemeCursor( Cursor cursor );
441 static QPixmap getThemePixmap(
const QString &name,
const QColor &foreColor = QColor(),
const QColor &backColor = QColor(),
int size = 16 );
444 static QString userStylePath();
451 static QRegularExpression shortNameRegularExpression();
457 static QString userLoginName();
463 static QString userFullName();
469 static QString osName();
478 static int systemMemorySizeMb();
484 static QString platform();
498 static QString applicationFullName();
503 static QString locale();
511 static void setLocale(
const QLocale &locale );
514 static QString userThemesFolder();
517 static QString defaultStylePath();
520 static QString defaultThemesFolder();
523 static QString libraryPath();
526 static QString libexecPath();
534 static QString qmlImportPath();
537 static void setPrefixPath(
const QString &prefixPath,
bool useDefaultPaths =
false );
540 static void setPluginPath(
const QString &pluginPath );
543 static void setPkgDataPath(
const QString &pkgDataPath );
546 static void setDefaultSvgPaths(
const QStringList &pathList );
549 static void setAuthDatabaseDirPath(
const QString &authDbDirPath );
552 static void initQgis();
555 static bool createDatabase( QString *errorMessage =
nullptr );
558 static bool createThemeFolder();
561 static void exitQgis();
564 static QString appIconPath();
574 static endian_t endian();
596 static QString showSettings();
605 static void registerOgrDrivers();
608 static QString absolutePathToRelativePath(
const QString &apath,
const QString &targetPath );
610 static QString relativePathToAbsolutePath(
const QString &rpath,
const QString &targetPath );
614#if defined(_MSC_VER) && !defined(USING_NMAKE) && !defined(USING_NINJA)
615 static QString cfgIntDir()
SIP_SKIP;
618 static QString buildSourcePath();
620 static QString buildOutputPath();
627 static void skipGdalDriver(
const QString &driver );
634 static void restoreGdalDriver(
const QString &driver );
640 static QStringList skippedGdalDrivers();
648 static void applyGdalSkippedDrivers();
654 static void registerGdalDriversFromSettings();
662 static QStringList deferredSkippedGdalDrivers();
670 static void setSkippedGdalDrivers(
const QStringList &skippedGdalDrivers,
671 const QStringList &deferredSkippedGdalDrivers );
676 static int maxThreads();
682 static void setMaxThreads(
int maxThreads );
904 static QgsAnnotationRegistry *annotationRegistry()
SIP_SKIP;
1003 static QString nullRepresentation();
1015 static
void setNullRepresentation( const QString &nullRepresentation );
1023 static QVariantMap customVariables();
1031 static
void setCustomVariables( const QVariantMap &customVariables );
1037 static
void setCustomVariable( const QString &name, const QVariant &value );
1048 static
int scaleIconSize(
int standardSize,
bool applyDevicePixelRatio = false );
1058 int maxConcurrentConnectionsPerPool() const;
1065 static
void setTranslation( const QString &translation );
1072 QString translation() const;
1098 bool x11EventFilter( XEvent *event );
1138 static void copyPath(
const QString &src,
const QString &dst );
1139 static QObject *
ABISYM( mFileOpenEventReceiver );
1141 static bool ABISYM( mInitialized );
1144 static bool ABISYM( mRunningFromBuildDir );
1148 static int ABISYM( sMaxThreads );
1150 QMap<QString, QIcon> mIconCache;
1151 QMap<Cursor, QCursor> mCursorCache;
1153 QTranslator *mQgisTranslator =
nullptr;
1154 QTranslator *mQtTranslator =
nullptr;
1155 QTranslator *mQtBaseTranslator =
nullptr;
1160 struct ApplicationMembers
1167 QgsAnnotationRegistry *mAnnotationRegistry =
nullptr;
1209 QString mNullRepresentation;
1210 QStringList mSvgPathCache;
1211 bool mSvgPathCacheValid =
false;
1213 ApplicationMembers();
1214 ~ApplicationMembers();
1218 ApplicationMembers *mApplicationMembers =
nullptr;
1220 static ApplicationMembers *sApplicationMembers;
1224 static ApplicationMembers *members();
1226 static void invalidateCaches();
1232 void installTranslators()
SIP_SKIP;
1234 friend class TestQgsApplication;