QGIS API Documentation 3.41.0-Master (af5edcb665c)
|
Extends QApplication to provide access to QGIS specific resources such as theme paths, database paths etc. More...
#include <qgsapplication.h>
Public Types | |
enum | Cursor { ZoomIn , ZoomOut , Identify , CrossHair , CapturePoint , Select , Sampler } |
The Cursor enum defines constants for QGIS custom cursors. More... | |
enum | endian_t { XDR = 0 , NDR = 1 } |
Constants for endian-ness. More... | |
enum | StyleSheetType { Qt , WebBrowser } |
The StyleSheetType enum represents the stylesheet type that a widget supports. More... | |
Signals | |
void | customVariablesChanged () |
Emitted whenever a custom global variable changes. | |
void | localeChanged () |
Emitted when project locale has been changed. | |
void | nullRepresentationChanged () |
Emitted when the string representing the NULL value is changed. | |
void | preNotify (QObject *receiver, QEvent *event, bool *done) |
void | requestForTranslatableObjects (QgsTranslationContext *translationContext) |
Emitted when project strings which require translation are being collected for inclusion in a .ts file. | |
Public Member Functions | |
QgsApplication (int &argc, char **argv, bool GUIenabled, const QString &profileFolder=QString(), const QString &platformName="external") | |
Constructor for QgsApplication. | |
~QgsApplication () override | |
void | collectTranslatableObjects (QgsTranslationContext *translationContext) |
Emits the signal to collect all the strings of .qgs to be included in ts file. | |
bool | event (QEvent *event) override |
Watch for QFileOpenEvent. | |
int | maxConcurrentConnectionsPerPool () const |
The maximum number of concurrent connections per connections pool. | |
bool | notify (QObject *receiver, QEvent *event) override |
Catch exceptions when sending event to receiver. | |
QString | translation () const |
Returns the current application translation locale code. | |
Static Public Member Functions | |
static QString | absolutePathToRelativePath (const QString &apath, const QString &targetPath) |
Converts absolute path to path relative to target. | |
static QgsActionScopeRegistry * | actionScopeRegistry () |
Returns the action scope registry. | |
static QString | activeThemePath () |
Returns the path to the currently active theme directory. | |
static QgsAnnotationItemRegistry * | annotationItemRegistry () |
Returns the application's annotation item registry, used for annotation item types. | |
static QgsAnnotationRegistry * | annotationRegistry () |
Returns the application's annotation registry, used for managing annotation types. | |
static QString | appIconPath () |
Gets application icon. | |
static QString | applicationFullName () |
Returns the QGIS application full name. | |
static void | applyGdalSkippedDrivers () |
Apply the skipped drivers list to gdal. | |
static QgsAuthConfigurationStorageRegistry * | authConfigurationStorageRegistry () |
Returns the application's authentication configuration storage registry. | |
static QgsAuthManager * | authManager () |
Returns the application's authentication manager instance. | |
static QString | authorsFilePath () |
Returns the path to the authors file. | |
static QgsBookmarkManager * | bookmarkManager () |
Returns the application's bookmark manager, used for storing installation-wide bookmarks. | |
static QString | buildOutputPath () |
Returns path to the build output directory. Valid only when running from build directory. | |
static QString | buildSourcePath () |
Returns path to the source directory. Valid only when running from build directory. | |
static QgsCalloutRegistry * | calloutRegistry () |
Returns the application's callout registry, used for managing callout types. | |
static QgsClassificationMethodRegistry * | classificationMethodRegistry () |
Returns the application's classification methods registry, used in graduated renderer. | |
static QgsColorSchemeRegistry * | colorSchemeRegistry () |
Returns the application's color scheme registry, used for managing color schemes. | |
static QgsConnectionRegistry * | connectionRegistry () |
Returns the application's connection registry, used for managing saved data provider connections. | |
static QString | contributorsFilePath () |
Returns the path to the contributors file. | |
static QgsCoordinateReferenceSystemRegistry * | coordinateReferenceSystemRegistry () |
Returns the application's coordinate reference system (CRS) registry, which handles known CRS definitions (including user-defined CRSes). | |
static bool | createDatabase (QString *errorMessage=nullptr) |
initialize qgis.db | |
static bool | createThemeFolder () |
Create the users theme folder. | |
static QVariantMap | customVariables () |
Custom expression variables for this application. | |
static QgsDatabaseQueryLog * | databaseQueryLog () |
Returns the database query log. | |
static QgsDataItemProviderRegistry * | dataItemProviderRegistry () |
Returns the application's data item provider registry, which keeps a list of data item providers that may add items to the browser tree. | |
static QgsStyleModel * | defaultStyleModel () |
Returns a shared QgsStyleModel containing the default style library (see QgsStyle::defaultStyle()). | |
static QString | defaultStylePath () |
Returns the path to default style (works as a starting point). | |
static QString | defaultThemePath () |
Returns the path to the default theme directory. | |
static QString | defaultThemesFolder () |
Returns the path to default themes folder from install (works as a starting point). | |
static QStringList | deferredSkippedGdalDrivers () |
Returns the list of gdal drivers that have been disabled in the current session, and thus, for safety, should not be disabled right now, but at the next application restart. | |
static QString | developersMapFilePath () |
Returns the path to the developers map file. | |
static QString | donorsFilePath () |
Returns the path to the donors file. | |
static endian_t | endian () |
Returns whether this machine uses big or little endian. | |
static void | exitQgis () |
deletes provider registry and map layer registry | |
static QgsExternalStorageRegistry * | externalStorageRegistry () |
Returns registry of available external storage implementations. | |
static QgsFieldFormatterRegistry * | fieldFormatterRegistry () |
Gets the registry of available field formatters. | |
static QgsFontManager * | fontManager () |
Returns the application font manager, which manages available fonts and font installation for the QGIS instance. | |
static QCursor | getThemeCursor (Cursor cursor) |
Helper to get a theme cursor. | |
static QIcon | getThemeIcon (const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor()) |
Helper to get a theme icon. | |
static QPixmap | getThemePixmap (const QString &name, const QColor &foreColor=QColor(), const QColor &backColor=QColor(), int size=16) |
Helper to get a theme icon as a pixmap. | |
static QgsBabelFormatRegistry * | gpsBabelFormatRegistry () |
Returns the application's GPSBabel format registry, used for managing GPSBabel formats. | |
static QgsGpsConnectionRegistry * | gpsConnectionRegistry () |
Returns the application's GPS connection registry, used for managing GPS connections. | |
static QString | i18nPath () |
Returns the path to the translation directory. | |
static QString | iconPath (const QString &iconFile) |
Returns path to the desired icon file. | |
static QString | iconsPath () |
Returns the path to the icons image directory. | |
static QgsImageCache * | imageCache () |
Returns the application's image cache, used for caching resampled versions of raster images. | |
static void | init (QString profileFolder=QString()) |
This method initializes paths etc for QGIS. | |
static void | initQgis () |
loads providers | |
static QgsApplication * | instance () |
Returns the singleton instance of the QgsApplication. | |
static bool | isRunningFromBuildDir () |
Indicates whether running from build directory (not installed) | |
static QgsLabelingEngineRuleRegistry * | labelingEngineRuleRegistry () |
Gets the registry of available labeling engine rules. | |
static QgsLayerMetadataProviderRegistry * | layerMetadataProviderRegistry () |
Returns registry of available layer metadata provider implementations. | |
static QgsLayoutItemRegistry * | layoutItemRegistry () |
Returns the application's layout item registry, used for layout item types. | |
static QStringList | layoutTemplatePaths () |
Returns the paths to layout template directories. | |
static QString | libexecPath () |
Returns the path with utility executables (help viewer, crssync, ...) | |
static QString | libraryPath () |
Returns the path containing qgis_core, qgis_gui, qgispython (and other) libraries. | |
static QString | licenceFilePath () |
Returns the path to the licence file. | |
static QString | locale () |
Returns the QGIS locale. | |
static QgsLocalizedDataPathRegistry * | localizedDataPathRegistry () |
Returns the registry of data repositories These are used as paths for basemaps, logos, etc. | |
static int | maxThreads () |
Gets maximum concurrent thread count. | |
static QgsMessageLog * | messageLog () |
Returns the application's message log. | |
static QString | metadataPath () |
Returns the path to the metadata directory. | |
static QgsNetworkContentFetcherRegistry * | networkContentFetcherRegistry () |
Returns the application's network content registry used for fetching temporary files during QGIS session. | |
static QString | nullRepresentation () |
Returns the string used to represent the value NULL throughout QGIS. | |
static QgsNumericFormatRegistry * | numericFormatRegistry () |
Gets the registry of available numeric formats. | |
static QString | osName () |
Returns a string name of the operating system QGIS is running on. | |
static QgsPageSizeRegistry * | pageSizeRegistry () |
Returns the application's page size registry, used for managing layout page sizes. | |
static QgsPaintEffectRegistry * | paintEffectRegistry () |
Returns the application's paint effect registry, used for managing paint effects. | |
static QString | pkgDataPath () |
Returns the common root path of all application data directories. | |
static QString | platform () |
Returns the QGIS platform name, e.g., "desktop", "server", "qgis_process" or "external" (for external CLI scripts). | |
static QgsPluginLayerRegistry * | pluginLayerRegistry () |
Returns the application's plugin layer registry, used for managing plugin layer types. | |
static QString | pluginPath () |
Returns the path to the application plugin directory. | |
static QgsPointCloudRendererRegistry * | pointCloudRendererRegistry () |
Returns the application's point cloud renderer registry, used for managing point cloud layer 2D renderers. | |
static QString | prefixPath () |
Returns the path to the application prefix directory. | |
static QgsProcessingRegistry * | processingRegistry () |
Returns the application's processing registry, used for managing processing providers, algorithms, and various parameters and outputs. | |
static QgsRuntimeProfiler * | profiler () |
Returns the application runtime profiler. | |
static QgsProfileSourceRegistry * | profileSourceRegistry () |
Returns registry of available profile source implementations. | |
static QgsProjectStorageRegistry * | projectStorageRegistry () |
Returns registry of available project storage implementations. | |
static Q_DECL_DEPRECATED QString | qgisAuthDatabaseFilePath () |
Returns the path to the user authentication database file: qgis-auth.db. | |
static QString | qgisAuthDatabaseUri () |
Returns the URI to the user authentication database. | |
static QString | qgisMasterDatabaseFilePath () |
Returns the path to the master qgis.db file. | |
static QString | qgisSettingsDirPath () |
Returns the path to the settings directory in user's home dir. | |
static QString | qgisUserDatabaseFilePath () |
Returns the path to the user qgis.db file. | |
static QString | qmlImportPath () |
Returns the path where QML components are installed for QGIS Quick library. | |
static QgsRasterRendererRegistry * | rasterRendererRegistry () |
Returns the application's raster renderer registry, used for managing raster layer renderers. | |
static QgsRecentStyleHandler * | recentStyleHandler () |
Returns the handler for recently used style items. | |
static void | registerGdalDriversFromSettings () |
Register gdal drivers, excluding the ones mentioned in "gdal/skipList" setting. | |
static void | registerOgrDrivers () |
Register OGR drivers ensuring this only happens once. | |
static QString | relativePathToAbsolutePath (const QString &rpath, const QString &targetPath) |
Converts path relative to target to an absolute path. | |
static Qgs3DRendererRegistry * | renderer3DRegistry () |
Returns registry of available 3D renderers. | |
static QgsRendererRegistry * | rendererRegistry () |
Returns the application's renderer registry, used for managing vector layer renderers. | |
static QString | reportStyleSheet (QgsApplication::StyleSheetType styleSheetType=QgsApplication::StyleSheetType::Qt) |
Returns a css style sheet for reports, the styleSheetType argument determines what type of stylesheet is supported by the widget. | |
static QString | resolvePkgPath () |
Calculate the application pkg path. | |
static void | restoreGdalDriver (const QString &driver) |
Sets the GDAL_SKIP environment variable to exclude the specified driver and then calls GDALDriverManager::AutoSkipDrivers() to unregister it. | |
static QgsScaleBarRendererRegistry * | scaleBarRendererRegistry () |
Gets the registry of available scalebar renderers. | |
static int | scaleIconSize (int standardSize, bool applyDevicePixelRatio=false) |
Scales an icon size to compensate for display pixel density, making the icon size hi-dpi friendly, whilst still resulting in pixel-perfect sizes for low-dpi displays. | |
static QgsSensorRegistry * | sensorRegistry () |
Returns the application's sensor registry, used for sensor types. | |
static QString | serverResourcesPath () |
Returns the path to the server resources directory. | |
static void | setAuthDatabaseDirPath (const QString &authDbDirPath) |
Alters authentication data base directory path - used by 3rd party apps. | |
static void | setCustomVariable (const QString &name, const QVariant &value) |
Set a single custom expression variable. | |
static void | setCustomVariables (const QVariantMap &customVariables) |
Custom expression variables for this application. | |
static void | setDefaultSvgPaths (const QStringList &pathList) |
Alters default svg paths - used by 3rd party apps. | |
static void | setFileOpenEventReceiver (QObject *receiver) |
Sets the FileOpen event receiver. | |
static void | setLocale (const QLocale &locale) |
Sets the QGIS locale - used mainly by 3rd party apps and tests. | |
static void | setMaxThreads (int maxThreads) |
Set maximum concurrent thread count. | |
static void | setNullRepresentation (const QString &nullRepresentation) |
Sets the string used to represent the value NULL throughout QGIS. | |
static void | setPkgDataPath (const QString &pkgDataPath) |
Alters pkg data path - used by 3rd party apps. | |
static void | setPluginPath (const QString &pluginPath) |
Alters plugin path - used by 3rd party apps. | |
static void | setPrefixPath (const QString &prefixPath, bool useDefaultPaths=false) |
Alters prefix path - used by 3rd party apps. | |
static void | setSkippedGdalDrivers (const QStringList &skippedGdalDrivers, const QStringList &deferredSkippedGdalDrivers) |
Sets the list of gdal drivers that should be disabled (skippedGdalDrivers), but excludes for now the ones defines in deferredSkippedGdalDrivers. | |
static void | setSvgPaths (const QStringList &svgPaths) |
Sets the paths to svg directories and invalidates the svg path list cache. | |
static void | setThemeName (const QString &themeName) |
Set the active theme to the specified theme. | |
static Q_DECL_DEPRECATED QgsSettingsRegistryCore * | settingsRegistryCore () |
Returns the application's settings registry, used for managing application settings. | |
static void | setTranslation (const QString &translation) |
Set translation locale code. | |
static void | setUITheme (const QString &themeName) |
Set the current UI theme used to style the interface. | |
static QRegularExpression | shortNameRegularExpression () |
Returns the short name regular expression for line edit validator. | |
static QString | showSettings () |
Convenience function to get a summary of the paths used in this application instance useful for debugging mainly. | |
static void | skipGdalDriver (const QString &driver) |
Sets the GDAL_SKIP environment variable to include the specified driver and then calls GDALDriverManager::AutoSkipDrivers() to unregister it. | |
static QStringList | skippedGdalDrivers () |
Returns the list of gdal drivers that should be skipped (based on GDAL_SKIP environment variable) | |
static QgsSourceCache * | sourceCache () |
Returns the application's source cache, used for caching embedded and remote source strings as local files. | |
static QString | splashPath () |
Returns the path to the splash screen image directory. | |
static QString | sponsorsFilePath () |
Returns the path to the sponsors file. | |
static QString | srsDatabaseFilePath () |
Returns the path to the srs.db file. | |
static QgsSvgCache * | svgCache () |
Returns the application's SVG cache, used for caching SVG images and handling parameter replacement within SVG files. | |
static QStringList | svgPaths () |
Returns the paths to svg directories. | |
static Qgs3DSymbolRegistry * | symbol3DRegistry () |
Returns registry of available 3D symbols. | |
static QgsSymbolLayerRegistry * | symbolLayerRegistry () |
Returns the application's symbol layer registry, used for managing symbol layers. | |
static QMap< QString, QString > | systemEnvVars () |
Returns the system environment variables passed to application. | |
static int | systemMemorySizeMb () |
Returns the size of the system memory (RAM) in megabytes. | |
static QgsTaskManager * | taskManager () |
Returns the application's task manager, used for managing application wide background task handling. | |
static QString | themeName () |
Set the active theme to the specified theme. | |
static QgsTileDownloadManager * | tileDownloadManager () |
Returns the application's tile download manager, used for download of map tiles when rendering. | |
static QgsTiledSceneRendererRegistry * | tiledSceneRendererRegistry () |
Returns the application's tiled scene renderer registry, used for managing tiled scene layer 2D renderers. | |
static QString | translatorsFilePath () |
Returns the path to the sponsors file. | |
static QHash< QString, QString > | uiThemes () |
All themes found in ~/.qgis3/themes folder. | |
static QString | userFullName () |
Returns the user's operating system login account full display name. | |
static QString | userLoginName () |
Returns the user's operating system login account name. | |
static QString | userStylePath () |
Returns the path to user's style. | |
static QString | userThemesFolder () |
Returns the path to user's themes folder. | |
static QgsValidityCheckRegistry * | validityCheckRegistry () |
Returns the application's validity check registry, used for managing validity checks. | |
Static Public Attributes | |
static const char * | QGIS_APPLICATION_NAME = "QGIS3" |
static const char * | QGIS_ORGANIZATION_DOMAIN = "qgis.org" |
static const char * | QGIS_ORGANIZATION_NAME = "QGIS" |
static const QgsSettingsEntryString * | settingsLocaleGlobalLocale = new QgsSettingsEntryString( QStringLiteral( "globalLocale" ), QgsSettingsTree::sTreeLocale, QString() ) |
Settings entry locale global locale. | |
static const QgsSettingsEntryBool * | settingsLocaleOverrideFlag = new QgsSettingsEntryBool( QStringLiteral( "overrideFlag" ), QgsSettingsTree::sTreeLocale, false ) |
Settings entry locale override flag. | |
static const QgsSettingsEntryBool * | settingsLocaleShowGroupSeparator = new QgsSettingsEntryBool( QStringLiteral( "showGroupSeparator" ), QgsSettingsTree::sTreeLocale, false ) |
Settings entry locale show group separator. | |
static const QgsSettingsEntryString * | settingsLocaleUserLocale = new QgsSettingsEntryString( QStringLiteral( "userLocale" ), QgsSettingsTree::sTreeLocale, QString() ) |
Settings entry locale user locale. | |
static const QgsSettingsEntryStringList * | settingsSearchPathsForSVG = new QgsSettingsEntryStringList( QStringLiteral( "searchPathsForSVG" ), QgsSettingsTree::sTreeSvg, QStringList() ) |
Settings entry search path for SVG. | |
Friends | |
class | TestQgsApplication |
Extends QApplication to provide access to QGIS specific resources such as theme paths, database paths etc.
This is a subclass of QApplication and should be instantiated in place of QApplication. Most methods are static in keeping with the design of QApplication.
This class hides platform-specific path information and provides a portable way of referencing specific files and directories. Ideally, hard-coded paths should appear only here and not in other modules so that platform-conditional code is minimized and paths are easier to change due to centralization.
Definition at line 98 of file qgsapplication.h.
The Cursor enum defines constants for QGIS custom cursors.
Definition at line 414 of file qgsapplication.h.
The StyleSheetType enum represents the stylesheet type that a widget supports.
Is is used by widgets that display HTML content to retrieve the standard QGIS stylesheet, maintained according to QGIS visual guidelines.
Enumerator | |
---|---|
Qt | StyleSheet for Qt GUI widgets (based on QLabel or QTextBrowser), supports basic CSS and Qt extensions. |
WebBrowser | StyleSheet for embedded browsers (QtWebKit), supports full standard CSS. |
Definition at line 161 of file qgsapplication.h.
QgsApplication::QgsApplication | ( | int & | argc, |
char ** | argv, | ||
bool | GUIenabled, | ||
const QString & | profileFolder = QString() , |
||
const QString & | platformName = "external" |
||
) |
Constructor for QgsApplication.
argc | command line argument count |
argv | command line arguments |
GUIenabled | set to true if a GUI application is required, or false for a console only application |
profileFolder | optional string representing the profile to load at startup |
platformName | the QGIS platform name, e.g., "desktop", "server", "qgis_process" or "external" (for external CLI scripts) |
Definition at line 207 of file qgsapplication.cpp.
|
override |
Definition at line 554 of file qgsapplication.cpp.
|
static |
Converts absolute path to path relative to target.
Definition at line 1829 of file qgsapplication.cpp.
|
static |
Returns the action scope registry.
Definition at line 2184 of file qgsapplication.cpp.
|
static |
Returns the path to the currently active theme directory.
Definition at line 760 of file qgsapplication.cpp.
|
static |
Returns the application's annotation item registry, used for annotation item types.
Definition at line 2550 of file qgsapplication.cpp.
|
static |
Returns the application's annotation registry, used for managing annotation types.
Definition at line 2635 of file qgsapplication.cpp.
|
static |
Gets application icon.
Definition at line 775 of file qgsapplication.cpp.
|
static |
Returns the QGIS application full name.
It can be defined by the environment variable QGIS_APPLICATION_FULL_NAME or the /qgis/application_full_name in the QGIS config file.
By default it is equal to applicationName()+' '+platform()
Definition at line 1466 of file qgsapplication.cpp.
|
static |
Apply the skipped drivers list to gdal.
Definition at line 2030 of file qgsapplication.cpp.
|
static |
Returns the application's authentication configuration storage registry.
Definition at line 1596 of file qgsapplication.cpp.
|
static |
Returns the application's authentication manager instance.
nullptr
if called before initQgis Definition at line 1577 of file qgsapplication.cpp.
|
static |
Returns the path to the authors file.
Definition at line 1155 of file qgsapplication.cpp.
|
static |
Returns the application's bookmark manager, used for storing installation-wide bookmarks.
Definition at line 2580 of file qgsapplication.cpp.
|
static |
Returns path to the build output directory. Valid only when running from build directory.
Definition at line 1949 of file qgsapplication.cpp.
|
static |
Returns path to the source directory. Valid only when running from build directory.
Definition at line 1944 of file qgsapplication.cpp.
|
static |
Returns the application's callout registry, used for managing callout types.
Definition at line 2540 of file qgsapplication.cpp.
|
static |
Returns the application's classification methods registry, used in graduated renderer.
Definition at line 2575 of file qgsapplication.cpp.
void QgsApplication::collectTranslatableObjects | ( | QgsTranslationContext * | translationContext | ) |
Emits the signal to collect all the strings of .qgs to be included in ts file.
Definition at line 2155 of file qgsapplication.cpp.
|
static |
Returns the application's color scheme registry, used for managing color schemes.
Definition at line 2455 of file qgsapplication.cpp.
|
static |
Returns the application's connection registry, used for managing saved data provider connections.
Definition at line 2620 of file qgsapplication.cpp.
|
static |
Returns the path to the contributors file.
Contributors are people who have submitted patches but don't have commit access.
Definition at line 1160 of file qgsapplication.cpp.
|
static |
Returns the application's coordinate reference system (CRS) registry, which handles known CRS definitions (including user-defined CRSes).
Definition at line 2505 of file qgsapplication.cpp.
|
static |
initialize qgis.db
Definition at line 2189 of file qgsapplication.cpp.
|
static |
Create the users theme folder.
Definition at line 2046 of file qgsapplication.cpp.
|
static |
Custom expression variables for this application.
This does not include generated variables (like system name, user name etc.)
Definition at line 2079 of file qgsapplication.cpp.
|
signal |
Emitted whenever a custom global variable changes.
|
static |
|
static |
Returns the application's data item provider registry, which keeps a list of data item providers that may add items to the browser tree.
Definition at line 2485 of file qgsapplication.cpp.
|
static |
Returns a shared QgsStyleModel containing the default style library (see QgsStyle::defaultStyle()).
Using this shared model instead of creating a new QgsStyleModel improves performance.
Definition at line 2600 of file qgsapplication.cpp.
|
static |
Returns the path to default style (works as a starting point).
Definition at line 1515 of file qgsapplication.cpp.
|
static |
Returns the path to the default theme directory.
Definition at line 756 of file qgsapplication.cpp.
|
static |
Returns the path to default themes folder from install (works as a starting point).
Definition at line 1520 of file qgsapplication.cpp.
|
static |
Returns the list of gdal drivers that have been disabled in the current session, and thus, for safety, should not be disabled right now, but at the next application restart.
Definition at line 2025 of file qgsapplication.cpp.
|
static |
Returns the path to the developers map file.
The developers map was created by using leaflet framework, it shows the contributors.json file.
Definition at line 1164 of file qgsapplication.cpp.
|
static |
Returns the path to the donors file.
Definition at line 1174 of file qgsapplication.cpp.
|
static |
Returns whether this machine uses big or little endian.
Definition at line 1545 of file qgsapplication.cpp.
|
override |
Watch for QFileOpenEvent.
Definition at line 586 of file qgsapplication.cpp.
|
static |
deletes provider registry and map layer registry
Definition at line 1602 of file qgsapplication.cpp.
|
static |
Returns registry of available external storage implementations.
Definition at line 2675 of file qgsapplication.cpp.
|
static |
Gets the registry of available field formatters.
Definition at line 2645 of file qgsapplication.cpp.
|
static |
Returns the application font manager, which manages available fonts and font installation for the QGIS instance.
Definition at line 2605 of file qgsapplication.cpp.
|
static |
Helper to get a theme cursor.
It will fall back to the default theme if the active theme does not have the required icon. Cursors are automatically scaled to look like a 16px cursor on 96dpi screens.
Definition at line 870 of file qgsapplication.cpp.
|
static |
Helper to get a theme icon.
It will fall back to the default theme if the active theme does not have the required icon.
Since QGIS 3.20, the optional fillColor and strokeColor arguments can be used to control the color of parameter based SVG icons.
Definition at line 796 of file qgsapplication.cpp.
|
static |
Helper to get a theme icon as a pixmap.
It will fall back to the default theme if the active theme does not have the required icon.
If foreColor or backColor are specified, then these colors will be used for parametrized colors in SVG files wherever available. If colors are specified then the size argument also must be set.
Definition at line 935 of file qgsapplication.cpp.
|
static |
Returns the application's GPSBabel format registry, used for managing GPSBabel formats.
Definition at line 2565 of file qgsapplication.cpp.
|
static |
Returns the application's GPS connection registry, used for managing GPS connections.
Definition at line 2560 of file qgsapplication.cpp.
|
static |
Returns the path to the translation directory.
Definition at line 1189 of file qgsapplication.cpp.
|
static |
Returns path to the desired icon file.
First it tries to use the active theme path, then default theme path
Definition at line 785 of file qgsapplication.cpp.
|
static |
Returns the path to the icons image directory.
Definition at line 1232 of file qgsapplication.cpp.
|
static |
Returns the application's image cache, used for caching resampled versions of raster images.
Definition at line 2515 of file qgsapplication.cpp.
|
static |
This method initializes paths etc for QGIS.
Called by the ctor or call it manually when your app does not extend the QApplication class.
Definition at line 227 of file qgsapplication.cpp.
|
static |
loads providers
Definition at line 1550 of file qgsapplication.cpp.
|
static |
Returns the singleton instance of the QgsApplication.
Definition at line 581 of file qgsapplication.cpp.
|
inlinestatic |
Indicates whether running from build directory (not installed)
Definition at line 613 of file qgsapplication.h.
|
static |
Gets the registry of available labeling engine rules.
Definition at line 2665 of file qgsapplication.cpp.
|
static |
Returns registry of available layer metadata provider implementations.
Definition at line 2625 of file qgsapplication.cpp.
|
static |
Returns the application's layout item registry, used for layout item types.
Definition at line 2545 of file qgsapplication.cpp.
|
static |
Returns the paths to layout template directories.
Definition at line 1301 of file qgsapplication.cpp.
|
static |
Returns the path with utility executables (help viewer, crssync, ...)
Definition at line 1535 of file qgsapplication.cpp.
|
static |
Returns the path containing qgis_core, qgis_gui, qgispython (and other) libraries.
Definition at line 1530 of file qgsapplication.cpp.
|
static |
Returns the path to the licence file.
Definition at line 1184 of file qgsapplication.cpp.
|
static |
Returns the QGIS locale.
Definition at line 1485 of file qgsapplication.cpp.
|
signal |
Emitted when project locale has been changed.
|
static |
Returns the registry of data repositories These are used as paths for basemaps, logos, etc.
which can be referenced differently across work stations.
Definition at line 2685 of file qgsapplication.cpp.
int QgsApplication::maxConcurrentConnectionsPerPool | ( | ) | const |
The maximum number of concurrent connections per connections pool.
Definition at line 2136 of file qgsapplication.cpp.
|
static |
Gets maximum concurrent thread count.
Definition at line 780 of file qgsapplication.cpp.
|
static |
Returns the application's message log.
Definition at line 2610 of file qgsapplication.cpp.
|
static |
Returns the path to the metadata directory.
Definition at line 1197 of file qgsapplication.cpp.
|
static |
Returns the application's network content registry used for fetching temporary files during QGIS session.
Definition at line 2525 of file qgsapplication.cpp.
|
override |
Catch exceptions when sending event to receiver.
Definition at line 614 of file qgsapplication.cpp.
|
static |
Returns the string used to represent the value NULL
throughout QGIS.
Definition at line 2160 of file qgsapplication.cpp.
|
signal |
Emitted when the string representing the NULL
value is changed.
|
static |
Gets the registry of available numeric formats.
Definition at line 2640 of file qgsapplication.cpp.
|
static |
Returns a string name of the operating system QGIS is running on.
Definition at line 1402 of file qgsapplication.cpp.
|
static |
Returns the application's page size registry, used for managing layout page sizes.
Definition at line 2630 of file qgsapplication.cpp.
|
static |
Returns the application's paint effect registry, used for managing paint effects.
Definition at line 2460 of file qgsapplication.cpp.
|
static |
Returns the common root path of all application data directories.
Definition at line 748 of file qgsapplication.cpp.
|
static |
Returns the QGIS platform name, e.g., "desktop", "server", "qgis_process" or "external" (for external CLI scripts).
Definition at line 1461 of file qgsapplication.cpp.
|
static |
Returns the application's plugin layer registry, used for managing plugin layer types.
Definition at line 2570 of file qgsapplication.cpp.
|
static |
Returns the path to the application plugin directory.
Definition at line 743 of file qgsapplication.cpp.
|
static |
Returns the application's point cloud renderer registry, used for managing point cloud layer 2D renderers.
Definition at line 2475 of file qgsapplication.cpp.
|
static |
Returns the path to the application prefix directory.
Definition at line 725 of file qgsapplication.cpp.
|
signal |
|
static |
Returns the application's processing registry, used for managing processing providers, algorithms, and various parameters and outputs.
Definition at line 2615 of file qgsapplication.cpp.
|
static |
Returns the application runtime profiler.
Definition at line 652 of file qgsapplication.cpp.
|
static |
Returns registry of available profile source implementations.
Definition at line 2680 of file qgsapplication.cpp.
|
static |
Returns registry of available project storage implementations.
Definition at line 2670 of file qgsapplication.cpp.
|
static |
Returns the path to the user authentication database file: qgis-auth.db.
Definition at line 1217 of file qgsapplication.cpp.
|
static |
Returns the URI to the user authentication database.
The URI is be in the format:
<DRIVER>://<USER>:<PASSWORD>@<HOST>:<PORT>/<DATABASE>[?OPTIONS]
where DATABASE is just the path to the file for SQLite databases. If DRIVER is omitted, PSQLITE is assumed. Optional SCHEMA can be specified as a query parameter.
Definition at line 1222 of file qgsapplication.cpp.
|
static |
Returns the path to the master qgis.db file.
Definition at line 1202 of file qgsapplication.cpp.
|
static |
Returns the path to the settings directory in user's home dir.
Definition at line 1207 of file qgsapplication.cpp.
|
static |
Returns the path to the user qgis.db file.
Definition at line 1212 of file qgsapplication.cpp.
|
static |
Returns the path where QML components are installed for QGIS Quick library.
Returns empty string when QGIS is built without Quick support
Definition at line 1540 of file qgsapplication.cpp.
|
static |
Returns the application's raster renderer registry, used for managing raster layer renderers.
Definition at line 2470 of file qgsapplication.cpp.
|
static |
Returns the handler for recently used style items.
Definition at line 2590 of file qgsapplication.cpp.
|
static |
Register gdal drivers, excluding the ones mentioned in "gdal/skipList" setting.
Definition at line 2002 of file qgsapplication.cpp.
|
static |
Register OGR drivers ensuring this only happens once.
This is a workaround for an issue with older gdal versions that caused duplicate driver name entries to appear in the list of registered drivers when QgsApplication::registerOgrDrivers was called multiple times.
Definition at line 1821 of file qgsapplication.cpp.
|
static |
Converts path relative to target to an absolute path.
Definition at line 1894 of file qgsapplication.cpp.
|
static |
Returns registry of available 3D renderers.
Definition at line 2650 of file qgsapplication.cpp.
|
static |
Returns the application's renderer registry, used for managing vector layer renderers.
Definition at line 2465 of file qgsapplication.cpp.
|
static |
Returns a css style sheet for reports, the styleSheetType argument determines what type of stylesheet is supported by the widget.
Typically you will use this method by doing: QString myStyle = QgsApplication::reportStyleSheet(); textBrowserReport->document()->setDefaultStyleSheet(myStyle); if you are using a QgsWebView you will need to manually inject the CSS into a head -> script tag instead.
Definition at line 1670 of file qgsapplication.cpp.
|
signal |
Emitted when project strings which require translation are being collected for inclusion in a .ts file.
In order to register translatable strings, connect to this signal and register the strings within the specified translationContext.
|
static |
Calculate the application pkg path.
Definition at line 955 of file qgsapplication.cpp.
|
static |
Sets the GDAL_SKIP environment variable to exclude the specified driver and then calls GDALDriverManager::AutoSkipDrivers() to unregister it.
The driver name should be the short format of the Gdal driver name e.g. GTIFF.
Definition at line 1971 of file qgsapplication.cpp.
|
static |
Gets the registry of available scalebar renderers.
Definition at line 2660 of file qgsapplication.cpp.
|
static |
Scales an icon size to compensate for display pixel density, making the icon size hi-dpi friendly, whilst still resulting in pixel-perfect sizes for low-dpi displays.
standardSize should be set to a standard icon size, e.g. 16, 24, 48, etc.
Definition at line 2123 of file qgsapplication.cpp.
|
static |
Returns the application's sensor registry, used for sensor types.
Definition at line 2555 of file qgsapplication.cpp.
|
static |
Returns the path to the server resources directory.
Definition at line 1525 of file qgsapplication.cpp.
|
static |
Alters authentication data base directory path - used by 3rd party apps.
Definition at line 716 of file qgsapplication.cpp.
|
static |
Set a single custom expression variable.
Definition at line 2113 of file qgsapplication.cpp.
|
static |
Custom expression variables for this application.
Do not include generated variables (like system name, user name etc.)
Definition at line 2098 of file qgsapplication.cpp.
|
static |
Alters default svg paths - used by 3rd party apps.
Definition at line 711 of file qgsapplication.cpp.
|
static |
Sets the FileOpen event receiver.
Definition at line 657 of file qgsapplication.cpp.
|
static |
Sets the QGIS locale - used mainly by 3rd party apps and tests.
In QGIS this is internally triggered by the application in startup.
Definition at line 1504 of file qgsapplication.cpp.
|
static |
Set maximum concurrent thread count.
Definition at line 2421 of file qgsapplication.cpp.
|
static |
Sets the string used to represent the value NULL
throughout QGIS.
Definition at line 2170 of file qgsapplication.cpp.
|
static |
Alters pkg data path - used by 3rd party apps.
Definition at line 700 of file qgsapplication.cpp.
|
static |
Alters plugin path - used by 3rd party apps.
Definition at line 695 of file qgsapplication.cpp.
|
static |
Alters prefix path - used by 3rd party apps.
Definition at line 674 of file qgsapplication.cpp.
|
static |
Sets the list of gdal drivers that should be disabled (skippedGdalDrivers), but excludes for now the ones defines in deferredSkippedGdalDrivers.
This writes the "gdal/skipList" setting.
Definition at line 1990 of file qgsapplication.cpp.
|
static |
Sets the paths to svg directories and invalidates the svg path list cache.
Definition at line 1260 of file qgsapplication.cpp.
|
static |
Set the active theme to the specified theme.
The theme name should be a single word e.g. 'default','classic'. The theme search path usually will be pkgDataPath + "/themes/" + themName + "/" but plugin writers etc can use themeName() as a basis for searching for resources in their own datastores e.g. a Qt4 resource bundle.
Definition at line 950 of file qgsapplication.cpp.
|
static |
Returns the application's settings registry, used for managing application settings.
Definition at line 2450 of file qgsapplication.cpp.
|
static |
|
static |
Set the current UI theme used to style the interface.
Use uiThemes() to find valid themes to use. Variables found in variables.qss will be added to the stylesheet on load.
themeName | The name of the theme. |
Definition at line 1041 of file qgsapplication.cpp.
|
static |
Returns the short name regular expression for line edit validator.
shortNameRegExp
for QGIS <= 3.20 Definition at line 1318 of file qgsapplication.cpp.
|
static |
Convenience function to get a summary of the paths used in this application instance useful for debugging mainly.
Definition at line 1643 of file qgsapplication.cpp.
|
static |
Sets the GDAL_SKIP environment variable to include the specified driver and then calls GDALDriverManager::AutoSkipDrivers() to unregister it.
The driver name should be the short format of the Gdal driver name e.g. GTIFF.
Definition at line 1961 of file qgsapplication.cpp.
|
static |
Returns the list of gdal drivers that should be skipped (based on GDAL_SKIP environment variable)
Definition at line 1985 of file qgsapplication.cpp.
|
static |
Returns the application's source cache, used for caching embedded and remote source strings as local files.
Definition at line 2520 of file qgsapplication.cpp.
|
static |
Returns the path to the splash screen image directory.
Definition at line 1227 of file qgsapplication.cpp.
|
static |
Returns the path to the sponsors file.
Definition at line 1169 of file qgsapplication.cpp.
|
static |
Returns the path to the srs.db file.
Definition at line 1237 of file qgsapplication.cpp.
|
static |
Returns the application's SVG cache, used for caching SVG images and handling parameter replacement within SVG files.
Definition at line 2510 of file qgsapplication.cpp.
|
static |
Returns the paths to svg directories.
Definition at line 1266 of file qgsapplication.cpp.
|
static |
Returns registry of available 3D symbols.
Definition at line 2655 of file qgsapplication.cpp.
|
static |
Returns the application's symbol layer registry, used for managing symbol layers.
Definition at line 2535 of file qgsapplication.cpp.
|
static |
Returns the system environment variables passed to application.
Definition at line 1308 of file qgsapplication.cpp.
|
static |
Returns the size of the system memory (RAM) in megabytes.
This is only supported on some platforms, and will return -1 if not supported.
Definition at line 1425 of file qgsapplication.cpp.
|
static |
Returns the application's task manager, used for managing application wide background task handling.
Definition at line 2445 of file qgsapplication.cpp.
|
static |
Set the active theme to the specified theme.
The theme name should be a single word e.g. 'default','classic'. The theme search path usually will be pkgDataPath + "/themes/" + themName + "/" but plugin writers etc can use this method as a basis for searching for resources in their own datastores e.g. a Qt4 resource bundle.
Definition at line 1036 of file qgsapplication.cpp.
|
static |
Returns the application's tile download manager, used for download of map tiles when rendering.
Definition at line 2585 of file qgsapplication.cpp.
|
static |
Returns the application's tiled scene renderer registry, used for managing tiled scene layer 2D renderers.
Definition at line 2480 of file qgsapplication.cpp.
QString QgsApplication::translation | ( | ) | const |
Returns the current application translation locale code.
Definition at line 2150 of file qgsapplication.cpp.
|
static |
Returns the path to the sponsors file.
Definition at line 1179 of file qgsapplication.cpp.
|
static |
All themes found in ~/.qgis3/themes folder.
The path is to the root folder for the theme
Definition at line 1130 of file qgsapplication.cpp.
|
static |
Returns the user's operating system login account full display name.
Definition at line 1364 of file qgsapplication.cpp.
|
static |
Returns the user's operating system login account name.
Definition at line 1324 of file qgsapplication.cpp.
|
static |
Returns the path to user's style.
Definition at line 1313 of file qgsapplication.cpp.
|
static |
Returns the path to user's themes folder.
Definition at line 1510 of file qgsapplication.cpp.
|
static |
Returns the application's validity check registry, used for managing validity checks.
Definition at line 2530 of file qgsapplication.cpp.
|
friend |
Definition at line 1234 of file qgsapplication.h.
|
static |
Definition at line 169 of file qgsapplication.h.
|
static |
Definition at line 168 of file qgsapplication.h.
|
static |
Definition at line 167 of file qgsapplication.h.
|
static |
Settings entry locale global locale.
Definition at line 1088 of file qgsapplication.h.
|
static |
Settings entry locale override flag.
Definition at line 1086 of file qgsapplication.h.
|
static |
Settings entry locale show group separator.
Definition at line 1090 of file qgsapplication.h.
|
static |
Settings entry locale user locale.
Definition at line 1084 of file qgsapplication.h.
|
static |
Settings entry search path for SVG.
Definition at line 1092 of file qgsapplication.h.