15#ifndef QGSAPPLICATION_H
16#define QGSAPPLICATION_H
19#include <QApplication>
56class QgsAnnotationRegistry;
100 static char **qtgui_ArgvToC( PyObject *argvlist,
int &argc )
104 argc = PyList_GET_SIZE( argvlist );
108 if ( ( argv = (
char ** )sipMalloc( 2 * ( argc + 1 ) *
sizeof(
char * ) ) ) == NULL )
112 for (
int a = 0; a < argc; ++a )
116 if ( ( arg = PyBytes_AsString( PyList_GET_ITEM( argvlist, a ) ) ) == NULL ||
117 ( argv[a] = (
char * )sipMalloc( strlen( arg ) + 1 ) ) == NULL )
120 strcpy( argv[a], arg );
121 argv[a + argc + 1] = argv[a];
124 argv[argc + argc + 1] = argv[argc] = NULL;
131 static void qtgui_UpdatePyArgv( PyObject *argvlist,
int argc,
char **argv )
133 for (
int a = 0, na = 0; a < argc; ++a )
136 if ( argv[na] == argv[a + argc + 1] )
139 PyList_SetSlice( argvlist, na, na + 1, NULL );
177 QgsApplication(
int &argc,
char **argv,
bool GUIenabled,
const QString &profileFolder = QString(),
const QString &platformName =
"external" );
188 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" )];
196 if ( ( argv = qtgui_ArgvToC( a0, argc ) ) == NULL )
201 static int nargc = argc;
203 sipCpp =
new sipQgsApplication( nargc, argv, a1, *a2, *a3 );
206 qtgui_UpdatePyArgv( a0, argc, argv );
227 static void init( QString profileFolder = QString() )
SIP_SKIP;
230 bool event( QEvent *event ) override;
233 bool notify( QObject *receiver, QEvent *event ) override;
236 static
void setFileOpenEventReceiver( QObject *receiver );
248 static
void setThemeName( const QString &themeName );
254 static QString resolvePkgPath();
263 static QString themeName();
272 static
void setUITheme( const QString &themeName );
280 static QHash<QString, QString> uiThemes();
283 static QString authorsFilePath();
290 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();
326 static QString metadataPath();
329 static QString qgisMasterDatabaseFilePath();
332 static QString qgisSettingsDirPath();
335 static QString qgisUserDatabaseFilePath();
338 static QString qgisAuthDatabaseFilePath();
341 static QString splashPath();
344 static QString iconsPath();
347 static QString srsDatabaseFilePath();
354 static
void setSvgPaths( const QStringList &svgPaths );
357 static QStringList svgPaths();
363 static QStringList layoutTemplatePaths();
366 static QMap<QString, QString> systemEnvVars();
369 static QString prefixPath();
372 static QString pluginPath();
375 static QString pkgDataPath();
378 static QString activeThemePath();
381 static QString defaultThemePath();
387 static QString iconPath( const QString &iconFile );
396 static QIcon getThemeIcon( const QString &name, const QColor &fillColor = QColor(), const QColor &strokeColor = QColor() );
419 static QCursor getThemeCursor( Cursor cursor );
429 static QPixmap getThemePixmap(
const QString &name,
const QColor &foreColor = QColor(),
const QColor &backColor = QColor(),
int size = 16 );
432 static QString userStylePath();
439 static QRegularExpression shortNameRegularExpression();
446 static QString userLoginName();
453 static QString userFullName();
460 static QString osName();
469 static int systemMemorySizeMb();
476 static QString platform();
490 static QString applicationFullName();
496 static QString locale();
504 static void setLocale(
const QLocale &locale );
507 static QString userThemesFolder();
510 static QString defaultStylePath();
513 static QString defaultThemesFolder();
516 static QString libraryPath();
519 static QString libexecPath();
527 static QString qmlImportPath();
530 static void setPrefixPath(
const QString &prefixPath,
bool useDefaultPaths =
false );
533 static void setPluginPath(
const QString &pluginPath );
536 static void setPkgDataPath(
const QString &pkgDataPath );
539 static void setDefaultSvgPaths(
const QStringList &pathList );
542 static void setAuthDatabaseDirPath(
const QString &authDbDirPath );
545 static void initQgis();
548 static bool createDatabase( QString *errorMessage =
nullptr );
551 static bool createThemeFolder();
554 static void exitQgis();
557 static QString appIconPath();
567 static endian_t endian();
589 static QString showSettings();
598 static void registerOgrDrivers();
601 static QString absolutePathToRelativePath(
const QString &apath,
const QString &targetPath );
603 static QString relativePathToAbsolutePath(
const QString &rpath,
const QString &targetPath );
607#if defined(_MSC_VER) && !defined(USING_NMAKE) && !defined(USING_NINJA)
608 static QString cfgIntDir()
SIP_SKIP;
611 static QString buildSourcePath();
613 static QString buildOutputPath();
620 static void skipGdalDriver(
const QString &driver );
627 static void restoreGdalDriver(
const QString &driver );
633 static QStringList skippedGdalDrivers();
641 static void applyGdalSkippedDrivers();
647 static void registerGdalDriversFromSettings();
655 static QStringList deferredSkippedGdalDrivers();
663 static void setSkippedGdalDrivers(
const QStringList &skippedGdalDrivers,
664 const QStringList &deferredSkippedGdalDrivers );
670 static int maxThreads();
677 static void setMaxThreads(
int maxThreads );
903 static QgsAnnotationRegistry *annotationRegistry()
SIP_SKIP;
990 static QString nullRepresentation();
995 static
void setNullRepresentation( const QString &nullRepresentation );
1004 static QVariantMap customVariables();
1013 static
void setCustomVariables( const QVariantMap &customVariables );
1020 static
void setCustomVariable( const QString &name, const QVariant &value );
1031 static
int scaleIconSize(
int standardSize,
bool applyDevicePixelRatio = false );
1041 int maxConcurrentConnectionsPerPool() const;
1048 static
void setTranslation( const QString &translation );
1055 QString translation() const;
1081 bool x11EventFilter( XEvent *event );
1120 static void copyPath(
const QString &src,
const QString &dst );
1121 static QObject *
ABISYM( mFileOpenEventReceiver );
1123 static bool ABISYM( mInitialized );
1126 static bool ABISYM( mRunningFromBuildDir );
1131 static int ABISYM( sMaxThreads );
1133 QMap<QString, QIcon> mIconCache;
1134 QMap<Cursor, QCursor> mCursorCache;
1136 QTranslator *mQgisTranslator =
nullptr;
1137 QTranslator *mQtTranslator =
nullptr;
1138 QTranslator *mQtBaseTranslator =
nullptr;
1143 struct ApplicationMembers
1150 QgsAnnotationRegistry *mAnnotationRegistry =
nullptr;
1189 QString mNullRepresentation;
1190 QStringList mSvgPathCache;
1191 bool mSvgPathCacheValid =
false;
1193 ApplicationMembers();
1194 ~ApplicationMembers();
1198 ApplicationMembers *mApplicationMembers =
nullptr;
1200 static ApplicationMembers *sApplicationMembers;
1204 static ApplicationMembers *members();
1206 static void invalidateCaches();
1212 void installTranslators()
SIP_SKIP;
1214 friend class TestQgsApplication;
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.
static const QgsSettingsEntryStringList * settingsSearchPathsForSVG
Settings entry search path for SVG.
static const QgsSettingsEntryBool * settingsLocaleOverrideFlag
Settings entry locale override flag.
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 QgsSettingsEntryString * settingsLocaleGlobalLocale
Settings entry locale global locale.
static const QgsSettingsEntryString * settingsLocaleUserLocale
Settings entry locale user locale.
static const char * QGIS_APPLICATION_NAME
static const char * QGIS_ORGANIZATION_DOMAIN
void preNotify(QObject *receiver, QEvent *event, bool *done)
void localeChanged()
Emitted when project locale has been changed.
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 const QgsSettingsEntryBool * settingsLocaleShowGroupSeparator
Settings entry locale show group separator.
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.
Handles logging of database queries.
Registry of external storage backends used by QgsExternalResourceWidget.
Manages available fonts and font installation for a QGIS instance.
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.
Handles and tracks style items recently used in the QGIS GUI.
Provides a method of recording run time profiles of operations, allowing easy recording of their over...
The QgsScaleBarRendererRegistry manages registered scalebar renderers.
Registry of available sensor types.
A boolean settings entry.
A string list settings entry.
QgsSettingsRegistryCore is used for settings introspection and collects all QgsSettingsEntry instance...
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)