15 #ifndef QGSAPPLICATION_H
16 #define QGSAPPLICATION_H
18 #include "qgis_core.h"
19 #include <QApplication>
21 #include <QStringList>
25 #include "qgsconfig.h"
50 class QgsAnnotationRegistry;
91 static char **qtgui_ArgvToC( PyObject *argvlist,
int &argc )
95 argc = PyList_GET_SIZE( argvlist );
99 if ( ( argv = (
char ** )sipMalloc( 2 * ( argc + 1 ) *
sizeof(
char * ) ) ) == NULL )
103 for (
int a = 0; a < argc; ++a )
107 if ( ( arg = PyBytes_AsString( PyList_GET_ITEM( argvlist, a ) ) ) == NULL ||
108 ( argv[a] = (
char * )sipMalloc( strlen( arg ) + 1 ) ) == NULL )
111 strcpy( argv[a], arg );
112 argv[a + argc + 1] = argv[a];
115 argv[argc + argc + 1] = argv[argc] = NULL;
122 static void qtgui_UpdatePyArgv( PyObject *argvlist,
int argc,
char **argv )
124 for (
int a = 0, na = 0; a < argc; ++a )
127 if ( argv[na] == argv[a + argc + 1] )
130 PyList_SetSlice( argvlist, na, na + 1, NULL );
158 QgsApplication(
int &argc,
char **argv,
bool GUIenabled,
const QString &profileFolder = QString(),
const QString &platformName =
"desktop" );
160 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" )];
168 if ( ( argv = qtgui_ArgvToC( a0, argc ) ) == NULL )
173 static int nargc = argc;
175 sipCpp =
new sipQgsApplication( nargc, argv, a1, *a2, *a3 );
178 qtgui_UpdatePyArgv( a0, argc, argv );
199 static void init( QString profileFolder = QString() )
SIP_SKIP;
202 bool event( QEvent *event ) override;
205 bool notify( QObject *receiver, QEvent *event ) override;
208 static
void setFileOpenEventReceiver( QObject *receiver );
220 static
void setThemeName( const QString &themeName );
226 static QString resolvePkgPath();
235 static QString themeName();
244 static
void setUITheme( const QString &themeName );
252 static QHash<QString, QString> uiThemes();
255 static QString authorsFilePath();
262 static QString contributorsFilePath();
270 static QString developersMapFilePath();
273 static QString sponsorsFilePath();
276 static QString donorsFilePath();
279 static QString serverResourcesPath();
284 static QString translatorsFilePath();
289 static QString licenceFilePath();
292 static QString i18nPath();
298 static QString metadataPath();
301 static QString qgisMasterDatabaseFilePath();
304 static QString qgisSettingsDirPath();
307 static QString qgisUserDatabaseFilePath();
310 static QString qgisAuthDatabaseFilePath();
313 static QString splashPath();
316 static QString iconsPath();
319 static QString srsDatabaseFilePath();
326 static
void setSvgPaths( const QStringList &svgPaths );
329 static QStringList svgPaths();
335 static QStringList layoutTemplatePaths();
338 static QMap<QString, QString> systemEnvVars();
341 static QString prefixPath();
344 static QString pluginPath();
347 static QString pkgDataPath();
350 static QString activeThemePath();
353 static QString defaultThemePath();
359 static QString iconPath( const QString &iconFile );
365 static QIcon getThemeIcon( const QString &name );
388 static QCursor getThemeCursor( Cursor cursor );
398 static QPixmap getThemePixmap(
const QString &name,
const QColor &foreColor = QColor(),
const QColor &backColor = QColor(),
int size = 16 );
401 static QString userStylePath();
404 static QRegExp shortNameRegExp();
411 static QString userLoginName();
418 static QString userFullName();
425 static QString osName();
432 static QString platform();
438 static QString locale();
441 static QString userThemesFolder();
444 static QString defaultStylePath();
447 static QString defaultThemesFolder();
450 static QString libraryPath();
453 static QString libexecPath();
461 static QString qmlImportPath();
464 static void setPrefixPath(
const QString &prefixPath,
bool useDefaultPaths =
false );
467 static void setPluginPath(
const QString &pluginPath );
470 static void setPkgDataPath(
const QString &pkgDataPath );
473 static void setDefaultSvgPaths(
const QStringList &pathList );
476 static void setAuthDatabaseDirPath(
const QString &authDbDirPath );
479 static void initQgis();
482 static bool createDatabase( QString *errorMessage =
nullptr );
485 static bool createThemeFolder();
488 static void exitQgis();
491 static QString appIconPath();
501 static endian_t endian();
523 static QString showSettings();
532 static void registerOgrDrivers();
535 static QString absolutePathToRelativePath(
const QString &apath,
const QString &targetPath );
537 static QString relativePathToAbsolutePath(
const QString &rpath,
const QString &targetPath );
541 #if defined(_MSC_VER) && !defined(USING_NMAKE) && !defined(USING_NINJA)
542 static QString cfgIntDir()
SIP_SKIP;
545 static QString buildSourcePath();
547 static QString buildOutputPath();
554 static void skipGdalDriver(
const QString &driver );
561 static void restoreGdalDriver(
const QString &driver );
567 static QStringList skippedGdalDrivers();
575 static void applyGdalSkippedDrivers();
581 static void registerGdalDriversFromSettings();
589 static QStringList deferredSkippedGdalDrivers();
597 static void setSkippedGdalDrivers(
const QStringList &skippedGdalDrivers,
598 const QStringList &deferredSkippedGdalDrivers );
604 static int maxThreads();
611 static void setMaxThreads(
int maxThreads );
798 static QgsAnnotationRegistry *annotationRegistry()
SIP_SKIP;
873 static QString nullRepresentation();
878 static
void setNullRepresentation( const QString &nullRepresentation );
887 static QVariantMap customVariables();
896 static
void setCustomVariables( const QVariantMap &customVariables );
903 static
void setCustomVariable( const QString &name, const QVariant &value );
914 static
int scaleIconSize(
int standardSize,
bool applyDevicePixelRatio = false );
924 int maxConcurrentConnectionsPerPool() const;
931 static
void setTranslation( const QString &translation );
943 bool x11EventFilter( XEvent *event );
973 static void copyPath(
const QString &src,
const QString &dst );
974 static QObject *
ABISYM( mFileOpenEventReceiver );
976 static bool ABISYM( mInitialized );
979 static bool ABISYM( mRunningFromBuildDir );
984 static int ABISYM( sMaxThreads );
986 QMap<QString, QIcon> mIconCache;
987 QMap<Cursor, QCursor> mCursorCache;
989 QTranslator *mQgisTranslator =
nullptr;
990 QTranslator *mQtTranslator =
nullptr;
995 struct ApplicationMembers
1001 QgsAnnotationRegistry *mAnnotationRegistry =
nullptr;
1033 QString mNullRepresentation;
1034 QStringList mSvgPathCache;
1035 bool mSvgPathCacheValid =
false;
1037 ApplicationMembers();
1038 ~ApplicationMembers();
1042 ApplicationMembers *mApplicationMembers =
nullptr;
1044 static ApplicationMembers *sApplicationMembers;
1048 static ApplicationMembers *members();
1050 static void invalidateCaches();
Keeps track of available 3D renderers.
Registry of available 3D symbol classes.
The action scope registry is an application wide registry that contains a list of available action sc...
Registry of available annotation item types.
Extends QApplication to provide access to QGIS specific resources such as theme paths,...
endian_t
Constants for endian-ness.
void customVariablesChanged()
Emitted whenever a custom global variable changes.
StyleSheetType
The StyleSheetType enum represents the stylesheet type that a widget supports.
@ WebBrowser
StyleSheet for Qt GUI widgets (based on QLabel or QTextBrowser), supports basic CSS and Qt extensions...
static const char * QGIS_APPLICATION_NAME
static const char * QGIS_ORGANIZATION_DOMAIN
void preNotify(QObject *receiver, QEvent *event, bool *done)
static const char * QGIS_ORGANIZATION_NAME
Cursor
The Cursor enum defines constants for QGIS custom cursors.
@ CrossHair
Precisely identify a point on the canvas.
@ Identify
Identify: obtain information about the object.
@ Select
Select a rectangle.
@ CapturePoint
Select and capture a point or a feature.
@ Sampler
Color/Value picker.
void requestForTranslatableObjects(QgsTranslationContext *translationContext)
Emitted when project strings which require translation are being collected for inclusion in a ....
void nullRepresentationChanged()
This string is used to represent the value NULL throughout QGIS.
static bool isRunningFromBuildDir()
Indicates whether running from build directory (not installed)
Singleton offering an interface to manage the authentication configuration database and to utilize co...
Manages storage of a set of bookmarks.
Registry of available callout classes.
This class manages all known classification methods.
Registry of color schemes.
A registry for saved data provider connections, allowing retrieval of saved connections by name and p...
A registry for known coordinate reference system (CRS) definitions, including any user-defined CRSes.
This class keeps a list of data item providers that may add items to the browser tree.
A class to register / unregister existing GPS connections such that the information is available to a...
A cache for images derived from raster files.
Registry of available layout item types.
A registry class to hold localized data paths which can be used for basemaps, logos,...
Interface for logging messages from QGIS in GUI independent way.
Registry for temporary fetched files.
A registry for known page sizes.
Registry of available paint effects.
A registry of plugin layers types.
Registry of 2D renderers for point clouds.
Registry for various processing components, including providers, algorithms and various parameters an...
Registry of storage backends that QgsProject may use.
Registry for raster renderers.
Provides a method of recording run time profiles of operations, allowing easy recording of their over...
The QgsScaleBarRendererRegistry manages registered scalebar renderers.
A cache for source strings that returns a local file path containing the source content.
A QAbstractItemModel subclass for showing symbol and color ramp entities contained within a QgsStyle ...
A cache for images / pictures derived from SVG files.
Registry of available symbol layer classes.
Task manager for managing a set of long-running QgsTask tasks.
Tile download manager handles downloads of map tiles for the purpose of map rendering.
Used for the collecting of strings from projects for translation and creation of ts files.
User profile manager is used to manager list, and manage user profiles on the users machine.
User profile contains information about the user profile folders on the machine.
This class keeps a list of QgsAbstractValidityCheck checks which can be used when performing validity...
int scaleIconSize(int standardSize)
Scales an icon size to compensate for display pixel density, making the icon size hi-dpi friendly,...
#define SIP_KEEPREFERENCE
#define SIP_IF_FEATURE(feature)
QObject * ABISYM(QgsApplication::mFileOpenEventReceiver)