15 #ifndef QGSAPPLICATION_H 16 #define QGSAPPLICATION_H 18 #include "qgis_core.h" 19 #include <QApplication> 21 #include <QStringList> 24 #include "qgsconfig.h" 45 class QgsAnnotationRegistry;
76 static char **qtgui_ArgvToC( PyObject *argvlist,
int &argc )
80 argc = PyList_GET_SIZE( argvlist );
84 if ( ( argv = (
char ** )sipMalloc( 2 * ( argc + 1 ) *
sizeof(
char * ) ) ) == NULL )
88 for (
int a = 0; a < argc; ++a )
92 if ( ( arg = PyBytes_AsString( PyList_GET_ITEM( argvlist, a ) ) ) == NULL ||
93 ( argv[a] = (
char * )sipMalloc( strlen( arg ) + 1 ) ) == NULL )
96 strcpy( argv[a], arg );
97 argv[a + argc + 1] = argv[a];
100 argv[argc + argc + 1] = argv[argc] = NULL;
107 static void qtgui_UpdatePyArgv( PyObject *argvlist,
int argc,
char **argv )
109 for (
int a = 0, na = 0; a < argc; ++a )
112 if ( argv[na] == argv[a + argc + 1] )
115 PyList_SetSlice( argvlist, na, na + 1, NULL );
129 QgsApplication(
int &argc,
char **argv,
bool GUIenabled,
const QString &profileFolder = QString(),
const QString &platformName =
"desktop" );
131 QgsApplication( SIP_PYLIST argv,
bool GUIenabled, QString profileFolder = QString(), QString platformName =
"desktop" ) / PostHook = __pyQtQAppHook__ / [(
int &argc,
char **argv,
bool GUIenabled,
const QString &profileFolder = QString(),
const QString &platformName =
"desktop" )];
139 if ( ( argv = qtgui_ArgvToC( a0, argc ) ) == NULL )
144 static int nargc = argc;
146 sipCpp =
new sipQgsApplication( nargc, argv, a1, *a2, *a3 );
149 qtgui_UpdatePyArgv( a0, argc, argv );
170 static void init( QString profileFolder = QString() )
SIP_SKIP;
173 bool event( QEvent *event ) override;
176 bool notify( QObject *receiver, QEvent *event ) override;
179 static
void setFileOpenEventReceiver( QObject *receiver );
191 static
void setThemeName( const QString &themeName );
197 static QString resolvePkgPath();
206 static QString themeName();
215 static
void setUITheme( const QString &themeName );
223 static QHash<QString, QString> uiThemes();
226 static QString authorsFilePath();
232 static QString contributorsFilePath();
239 static QString developersMapFilePath();
242 static QString sponsorsFilePath();
245 static QString donorsFilePath();
248 static QString serverResourcesPath();
253 static QString translatorsFilePath();
258 static QString licenceFilePath();
261 static QString i18nPath();
267 static QString metadataPath();
270 static QString qgisMasterDatabaseFilePath();
273 static QString qgisSettingsDirPath();
276 static QString qgisUserDatabaseFilePath();
279 static QString qgisAuthDatabaseFilePath();
282 static QString splashPath();
285 static QString iconsPath();
288 static QString srsDatabaseFilePath();
291 static QStringList svgPaths();
297 static QStringList layoutTemplatePaths();
300 static QMap<QString, QString> systemEnvVars() {
return ABISYM( mSystemEnvVars ); }
303 static QString prefixPath();
306 static QString pluginPath();
309 static QString pkgDataPath();
312 static QString activeThemePath();
315 static QString defaultThemePath();
321 static QString iconPath(
const QString &iconFile );
327 static QIcon getThemeIcon(
const QString &name );
350 static QCursor getThemeCursor(
Cursor cursor );
356 static QPixmap getThemePixmap(
const QString &name );
359 static QString userStylePath();
362 static QRegExp shortNameRegExp();
369 static QString userLoginName();
376 static QString userFullName();
383 static QString osName();
390 static QString platform();
396 static QString locale();
399 static QString userThemesFolder();
402 static QString defaultStylePath();
405 static QString defaultThemesFolder();
408 static QString libraryPath();
411 static QString libexecPath();
419 static QString qmlImportPath();
422 static void setPrefixPath(
const QString &prefixPath,
bool useDefaultPaths =
false );
425 static void setPluginPath(
const QString &pluginPath );
428 static void setPkgDataPath(
const QString &pkgDataPath );
431 static void setDefaultSvgPaths(
const QStringList &pathList );
434 static void setAuthDatabaseDirPath(
const QString &authDbDirPath );
437 static void initQgis();
440 static bool createDatabase( QString *errorMessage =
nullptr );
443 static bool createThemeFolder();
446 static void exitQgis();
449 static QString appIconPath();
472 static QString reportStyleSheet();
477 static QString showSettings();
486 static void registerOgrDrivers();
489 static QString absolutePathToRelativePath(
const QString &apath,
const QString &targetPath );
491 static QString relativePathToAbsolutePath(
const QString &rpath,
const QString &targetPath );
495 #if defined(_MSC_VER) && !defined(USING_NMAKE) && !defined(USING_NINJA) 496 static QString cfgIntDir() {
return ABISYM( mCfgIntDir ); }
SIP_SKIP 498 static QString buildSourcePath() {
return ABISYM( mBuildSourcePath ); }
508 static void skipGdalDriver(
const QString &driver );
515 static void restoreGdalDriver(
const QString &driver );
528 static void applyGdalSkippedDrivers();
539 static void setMaxThreads(
int maxThreads );
665 static QgsAnnotationRegistry *annotationRegistry()
SIP_SKIP;
705 static QString nullRepresentation();
710 static void setNullRepresentation(
const QString &nullRepresentation );
719 static QVariantMap customVariables();
728 static void setCustomVariables(
const QVariantMap &customVariables );
735 static void setCustomVariable(
const QString &name,
const QVariant &value );
745 int maxConcurrentConnectionsPerPool()
const;
752 static void setTranslation(
const QString &translation ) { sTranslation = translation; }
764 bool x11EventFilter( XEvent *event );
770 void preNotify( QObject *receiver, QEvent *event,
bool *done )
SIP_SKIP;
776 void customVariablesChanged();
782 void nullRepresentationChanged();
794 static void copyPath(
const QString &src,
const QString &dst );
795 static QObject *
ABISYM( mFileOpenEventReceiver );
796 static QStringList
ABISYM( mFileOpenEventList );
798 static QString
ABISYM( mProfilePath );
799 static QString
ABISYM( mUIThemeName );
800 static QString
ABISYM( mPrefixPath );
801 static QString
ABISYM( mPluginPath );
802 static QString
ABISYM( mPkgDataPath );
803 static QString
ABISYM( mLibraryPath );
804 static QString
ABISYM( mLibexecPath );
805 static QString
ABISYM( mQmlImportPath );
806 static QString
ABISYM( mThemeName );
807 static QStringList
ABISYM( mDefaultSvgPaths );
808 static QMap<QString, QString>
ABISYM( mSystemEnvVars );
810 static QString
ABISYM( mConfigPath );
812 static bool ABISYM( mInitialized );
815 static bool ABISYM( mRunningFromBuildDir );
817 static QString
ABISYM( mBuildSourcePath );
818 #if defined(_MSC_VER) && !defined(USING_NMAKE) && !defined(USING_NINJA) 819 static QString
ABISYM( mCfgIntDir );
822 static QString
ABISYM( mBuildOutputPath );
828 static QStringList
ABISYM( mGdalSkipList );
832 static int ABISYM( mMaxThreads );
836 static QString
ABISYM( mAuthDbDirPath );
838 static QString sUserName;
839 static QString sUserFullName;
840 static QString sPlatformName;
841 static QString sTranslation;
843 QMap<QString, QIcon> mIconCache;
844 QMap<Cursor, QCursor> mCursorCache;
846 QTranslator *mQgisTranslator =
nullptr;
847 QTranslator *mQtTranslator =
nullptr;
852 struct ApplicationMembers
856 QgsAnnotationRegistry *mAnnotationRegistry =
nullptr;
877 QString mNullRepresentation;
879 ApplicationMembers();
880 ~ApplicationMembers();
884 ApplicationMembers *mApplicationMembers =
nullptr;
886 static ApplicationMembers *sApplicationMembers;
888 static ApplicationMembers *members();
Singleton offering an interface to manage the authentication configuration database and to utilize co...
This class keeps a list of data item providers that may add items to the browser tree.
Extends QApplication to provide access to QGIS specific resources such as theme paths, database paths etc.
Cursor
The Cursor enum defines constants for QGIS custom cursors.
Registry of color schemes.
A registry of plugin layers types.
A cache for images / pictures derived from svg files.
Registry for raster renderers.
User profile contains information about the user profile folders on the machine.
Precisely identify a point on the canvas.
static QStringList skippedGdalDrivers()
Returns the list of gdal drivers that should be skipped (based on GDAL_SKIP environment variable) ...
This class keeps a list of QgsAbstractValidityCheck checks which can be used when performing validity...
static bool isRunningFromBuildDir()
Indicates whether running from build directory (not installed)
static int maxThreads()
Gets maximum concurrent thread count.
endian_t
Constants for endian-ness.
Keeps track of available 3D renderers.
Registry of available symbol layer classes.
Registry for temporary fetched files.
static QString buildOutputPath()
Returns path to the build output directory. Valid only when running from build directory.
#define SIP_KEEPREFERENCE
A registry for known page sizes.
static const char * QGIS_ORGANIZATION_NAME
Task manager for managing a set of long-running QgsTask tasks.
Used for the collecting of strings from projects for translation and creation of ts files...
#define SIP_IF_FEATURE(feature)
Identify: obtain information about the object.
Registry for various processing components, including providers, algorithms and various parameters an...
static const char * QGIS_ORGANIZATION_DOMAIN
Registry of available layout item types.
A class to register / unregister existing GPS connections such that the information is available to a...
QObject * ABISYM(QgsApplication::mFileOpenEventReceiver)
A cache for images derived from raster files.
Registry of storage backends that QgsProject may use.
The action scope registry is an application wide registry that contains a list of available action sc...
static const char * QGIS_APPLICATION_NAME
static void setTranslation(const QString &translation)
Set translation.
User profile manager is used to manager list, and manage user profiles on the users machine...
Interface for logging messages from QGIS in GUI independent way.
Select and capture a point or a feature.
Registry of available paint effects.