15 #ifndef QGSAPPLICATION_H 16 #define QGSAPPLICATION_H 18 #include "qgis_core.h" 19 #include <QApplication> 21 #include <QStringList> 24 #include "qgsconfig.h" 46 class QgsAnnotationRegistry;
80 static char **qtgui_ArgvToC( PyObject *argvlist,
int &argc )
84 argc = PyList_GET_SIZE( argvlist );
88 if ( ( argv = (
char ** )sipMalloc( 2 * ( argc + 1 ) *
sizeof(
char * ) ) ) == NULL )
92 for (
int a = 0; a < argc; ++a )
96 if ( ( arg = PyBytes_AsString( PyList_GET_ITEM( argvlist, a ) ) ) == NULL ||
97 ( argv[a] = (
char * )sipMalloc( strlen( arg ) + 1 ) ) == NULL )
100 strcpy( argv[a], arg );
101 argv[a + argc + 1] = argv[a];
104 argv[argc + argc + 1] = argv[argc] = NULL;
111 static void qtgui_UpdatePyArgv( PyObject *argvlist,
int argc,
char **argv )
113 for (
int a = 0, na = 0; a < argc; ++a )
116 if ( argv[na] == argv[a + argc + 1] )
119 PyList_SetSlice( argvlist, na, na + 1, NULL );
133 QgsApplication(
int &argc,
char **argv,
bool GUIenabled,
const QString &profileFolder = QString(),
const QString &platformName =
"desktop" );
135 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" )];
143 if ( ( argv = qtgui_ArgvToC( a0, argc ) ) == NULL )
148 static int nargc = argc;
150 sipCpp =
new sipQgsApplication( nargc, argv, a1, *a2, *a3 );
153 qtgui_UpdatePyArgv( a0, argc, argv );
174 static void init( QString profileFolder = QString() )
SIP_SKIP;
177 bool event( QEvent *event ) override;
180 bool notify( QObject *receiver, QEvent *event ) override;
183 static
void setFileOpenEventReceiver( QObject *receiver );
195 static
void setThemeName( const QString &themeName );
201 static QString resolvePkgPath();
210 static QString themeName();
219 static
void setUITheme( const QString &themeName );
227 static QHash<QString, QString> uiThemes();
230 static QString authorsFilePath();
236 static QString contributorsFilePath();
243 static QString developersMapFilePath();
246 static QString sponsorsFilePath();
249 static QString donorsFilePath();
252 static QString serverResourcesPath();
257 static QString translatorsFilePath();
262 static QString licenceFilePath();
265 static QString i18nPath();
271 static QString metadataPath();
274 static QString qgisMasterDatabaseFilePath();
277 static QString qgisSettingsDirPath();
280 static QString qgisUserDatabaseFilePath();
283 static QString qgisAuthDatabaseFilePath();
286 static QString splashPath();
289 static QString iconsPath();
292 static QString srsDatabaseFilePath();
295 static QStringList svgPaths();
301 static QStringList layoutTemplatePaths();
304 static QMap<QString, QString> systemEnvVars() {
return ABISYM( mSystemEnvVars ); }
307 static QString prefixPath();
310 static QString pluginPath();
313 static QString pkgDataPath();
316 static QString activeThemePath();
319 static QString defaultThemePath();
325 static QString iconPath(
const QString &iconFile );
331 static QIcon getThemeIcon(
const QString &name );
354 static QCursor getThemeCursor(
Cursor cursor );
360 static QPixmap getThemePixmap(
const QString &name );
363 static QString userStylePath();
366 static QRegExp shortNameRegExp();
373 static QString userLoginName();
380 static QString userFullName();
387 static QString osName();
394 static QString platform();
400 static QString locale();
403 static QString userThemesFolder();
406 static QString defaultStylePath();
409 static QString defaultThemesFolder();
412 static QString libraryPath();
415 static QString libexecPath();
423 static QString qmlImportPath();
426 static void setPrefixPath(
const QString &prefixPath,
bool useDefaultPaths =
false );
429 static void setPluginPath(
const QString &pluginPath );
432 static void setPkgDataPath(
const QString &pkgDataPath );
435 static void setDefaultSvgPaths(
const QStringList &pathList );
438 static void setAuthDatabaseDirPath(
const QString &authDbDirPath );
441 static void initQgis();
444 static bool createDatabase( QString *errorMessage =
nullptr );
447 static bool createThemeFolder();
450 static void exitQgis();
453 static QString appIconPath();
476 static QString reportStyleSheet();
481 static QString showSettings();
490 static void registerOgrDrivers();
493 static QString absolutePathToRelativePath(
const QString &apath,
const QString &targetPath );
495 static QString relativePathToAbsolutePath(
const QString &rpath,
const QString &targetPath );
499 #if defined(_MSC_VER) && !defined(USING_NMAKE) && !defined(USING_NINJA) 500 static QString cfgIntDir() {
return ABISYM( mCfgIntDir ); }
SIP_SKIP 502 static QString buildSourcePath() {
return ABISYM( mBuildSourcePath ); }
512 static void skipGdalDriver(
const QString &driver );
519 static void restoreGdalDriver(
const QString &driver );
533 static void applyGdalSkippedDrivers();
539 static void registerGdalDriversFromSettings();
555 static void setSkippedGdalDrivers(
const QStringList &skippedGdalDrivers,
556 const QStringList &deferredSkippedGdalDrivers );
567 static void setMaxThreads(
int maxThreads );
720 static QgsAnnotationRegistry *annotationRegistry()
SIP_SKIP;
760 static QString nullRepresentation();
765 static void setNullRepresentation(
const QString &nullRepresentation );
774 static QVariantMap customVariables();
783 static void setCustomVariables(
const QVariantMap &customVariables );
790 static void setCustomVariable(
const QString &name,
const QVariant &value );
800 int maxConcurrentConnectionsPerPool()
const;
807 static void setTranslation(
const QString &translation ) { sTranslation = translation; }
819 bool x11EventFilter( XEvent *event );
825 void preNotify( QObject *receiver, QEvent *event,
bool *done )
SIP_SKIP;
831 void customVariablesChanged();
837 void nullRepresentationChanged();
849 static void copyPath(
const QString &src,
const QString &dst );
850 static QObject *
ABISYM( mFileOpenEventReceiver );
851 static QStringList
ABISYM( mFileOpenEventList );
853 static QString
ABISYM( mProfilePath );
854 static QString
ABISYM( mUIThemeName );
855 static QString
ABISYM( mPrefixPath );
856 static QString
ABISYM( mPluginPath );
857 static QString
ABISYM( mPkgDataPath );
858 static QString
ABISYM( mLibraryPath );
859 static QString
ABISYM( mLibexecPath );
860 static QString
ABISYM( mQmlImportPath );
861 static QString
ABISYM( mThemeName );
862 static QStringList
ABISYM( mDefaultSvgPaths );
863 static QMap<QString, QString>
ABISYM( mSystemEnvVars );
865 static QString
ABISYM( mConfigPath );
867 static bool ABISYM( mInitialized );
870 static bool ABISYM( mRunningFromBuildDir );
872 static QString
ABISYM( mBuildSourcePath );
873 #if defined(_MSC_VER) && !defined(USING_NMAKE) && !defined(USING_NINJA) 874 static QString
ABISYM( mCfgIntDir );
877 static QString
ABISYM( mBuildOutputPath );
883 static QStringList
ABISYM( mGdalSkipList );
889 static QStringList sDeferredSkippedGdalDrivers;
893 static int ABISYM( mMaxThreads );
897 static QString
ABISYM( mAuthDbDirPath );
899 static QString sUserName;
900 static QString sUserFullName;
901 static QString sPlatformName;
902 static QString sTranslation;
904 QMap<QString, QIcon> mIconCache;
905 QMap<Cursor, QCursor> mCursorCache;
907 QTranslator *mQgisTranslator =
nullptr;
908 QTranslator *mQtTranslator =
nullptr;
913 struct ApplicationMembers
917 QgsAnnotationRegistry *mAnnotationRegistry =
nullptr;
942 QString mNullRepresentation;
944 ApplicationMembers();
945 ~ApplicationMembers();
949 ApplicationMembers *mApplicationMembers =
nullptr;
951 static ApplicationMembers *sApplicationMembers;
955 static ApplicationMembers *members();
957 static void invalidateCaches();
A QAbstractItemModel subclass for showing symbol and color ramp entities contained within a QgsStyle ...
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) ...
Manages storage of a set of bookmarks.
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 QStringList deferredSkippedGdalDrivers()
Returns the list of gdal drivers that have been disabled in the current session, and thus...
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
This class manages all known classification methods.
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...
Registry of available callout classes.
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.