QGIS API Documentation  2.99.0-Master (37c43df)
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
QgsApplication Class Reference

Extends QApplication to provide access to QGIS specific resources such as theme paths, database paths etc. More...

#include <qgsapplication.h>

Inheritance diagram for QgsApplication:
Inheritance graph
[legend]

Public Types

enum  endian_t { XDR = 0, NDR = 1 }
 Constants for endian-ness. More...
 

Public Slots

void emitSettingsChanged ()
 Causes the application instance to emit the settingsChanged() signal. More...
 

Signals

void preNotify (QObject *receiver, QEvent *event, bool *done)
 
void settingsChanged ()
 Emitted whenever any global, application-wide settings are changed. More...
 

Public Member Functions

 QgsApplication (int &argc, char **argv, bool GUIenabled, const QString &customConfigPath=QString(), const QString &platformName="desktop")
 
virtual ~QgsApplication ()
 
virtual bool event (QEvent *event) override
 Watch for QFileOpenEvent. More...
 
virtual bool notify (QObject *receiver, QEvent *event) override
 Catch exceptions when sending event to receiver. More...
 

Static Public Member Functions

static QString absolutePathToRelativePath (const QString &apath, const QString &targetPath)
 Converts absolute path to path relative to target. More...
 
static QgsActionScopeRegistryactionScopeRegistry ()
 Returns the action scope registry. More...
 
static QString activeThemePath ()
 Returns the path to the currently active theme directory. More...
 
static QString appIconPath ()
 get application icon More...
 
static void applyGdalSkippedDrivers ()
 Apply the skipped drivers list to gdal. More...
 
static QString authorsFilePath ()
 Returns the path to the authors file. More...
 
static QString buildOutputPath ()
 Returns path to the build output directory. Valid only when running from build directory. More...
 
static QString buildSourcePath ()
 Returns path to the source directory. Valid only when running from build directory. More...
 
static QStringList composerTemplatePaths ()
 Returns the pathes to composer template directories. More...
 
static QString contributorsFilePath ()
 Returns the path to the contributors file. More...
 
static bool createDB (QString *errorMessage=nullptr)
 initialise qgis.db More...
 
static bool createThemeFolder ()
 Create the users theme folder. More...
 
static QString defaultStylePath ()
 Returns the path to default style (works as a starting point). More...
 
static QString defaultThemePath ()
 Returns the path to the default theme directory. More...
 
static QString defaultThemesFolder ()
 Returns the path to default themes folder from install (works as a starting point). More...
 
static QString developersMapFilePath ()
 Returns the path to the developers map file. More...
 
static QString donorsFilePath ()
 Returns the path to the donors file. More...
 
static endian_t endian ()
 Returns whether this machine uses big or little endian. More...
 
template<typename T >
static void endian_swap (T &value)
 Swap the endianness of the specified value. More...
 
static void exitQgis ()
 deletes provider registry and map layer registry More...
 
static QIcon getThemeIcon (const QString &theName)
 Helper to get a theme icon. More...
 
static QPixmap getThemePixmap (const QString &theName)
 Helper to get a theme icon as a pixmap. More...
 
static QString helpAppPath ()
 Returns the path to the help application. More...
 
static QString i18nPath ()
 Returns the path to the translation directory. More...
 
static QString iconPath (const QString &iconFile)
 Returns path to the desired icon file. More...
 
static QString iconsPath ()
 Returns the path to the icons image directory. More...
 
static void init (QString customConfigPath=QString())
 This method initialises paths etc for QGIS. More...
 
static void initQgis ()
 loads providers More...
 
static QgsApplicationinstance ()
 Returns the singleton instance of the QgsApplication. More...
 
static bool isRunningFromBuildDir ()
 Indicates whether running from build directory (not installed) More...
 
static QString libexecPath ()
 Returns the path with utility executables (help viewer, crssync, ...) More...
 
static QString libraryPath ()
 Returns the path containing qgis_core, qgis_gui, qgispython (and other) libraries. More...
 
static QString licenceFilePath ()
 Returns the path to the licence file. More...
 
static int maxThreads ()
 Get maximum concurrent thread count. More...
 
static QString osName ()
 Returns a string name of the operating system QGIS is running on. More...
 
static QString pkgDataPath ()
 Returns the common root path of all application data directories. More...
 
static QString platform ()
 Returns the QGIS platform name, eg "desktop" or "server". More...
 
static QString pluginPath ()
 Returns the path to the application plugin directory. More...
 
static QString prefixPath ()
 Returns the path to the application prefix directory. More...
 
static QgsRuntimeProfilerprofiler ()
 Returns the application runtime profiler. More...
 
static QString qgisAuthDbFilePath ()
 Returns the path to the user authentication database file: qgis-auth.db. More...
 
static QString qgisMasterDbFilePath ()
 Returns the path to the master qgis.db file. More...
 
static QString qgisSettingsDirPath ()
 Returns the path to the settings directory in user's home dir. More...
 
static QString qgisUserDbFilePath ()
 Returns the path to the user qgis.db file. More...
 
static void registerOgrDrivers ()
 Register OGR drivers ensuring this only happens once. More...
 
static QString relativePathToAbsolutePath (const QString &rpath, const QString &targetPath)
 Converts path relative to target to an absolute path. More...
 
static QString reportStyleSheet ()
 get a standard css style sheet for reports. More...
 
static void restoreGdalDriver (const QString &theDriver)
 Sets the GDAL_SKIP environment variable to exclude the specified driver and then calls GDALDriverManager::AutoSkipDrivers() to unregister it. More...
 
static void setAuthDbDirPath (const QString &theAuthDbDirPath)
 Alters authentication data base directory path - used by 3rd party apps. More...
 
static void setDefaultSvgPaths (const QStringList &pathList)
 Alters default svg paths - used by 3rd party apps. More...
 
static void setFileOpenEventReceiver (QObject *receiver)
 Set the FileOpen event receiver. More...
 
static void setMaxThreads (int maxThreads)
 Set maximum concurrent thread count. More...
 
static void setPkgDataPath (const QString &thePkgDataPath)
 Alters pkg data path - used by 3rd party apps. More...
 
static void setPluginPath (const QString &thePluginPath)
 Alters plugin path - used by 3rd party apps. More...
 
static void setPrefixPath (const QString &thePrefixPath, bool useDefaultPaths=false)
 Alters prefix path - used by 3rd party apps. More...
 
static void setThemeName (const QString &theThemeName)
 Set the active theme to the specified theme. More...
 
static void setUITheme (const QString &themeName)
 Set the current UI theme used to style the interface. More...
 
static QRegExp shortNameRegExp ()
 Returns the short name regular expression for line edit validator. More...
 
static QString showSettings ()
 Convenience function to get a summary of the paths used in this application instance useful for debugging mainly. More...
 
static void skipGdalDriver (const QString &theDriver)
 Sets the GDAL_SKIP environment variable to include the specified driver and then calls GDALDriverManager::AutoSkipDrivers() to unregister it. More...
 
static QStringList skippedGdalDrivers ()
 Returns the list of gdal drivers that should be skipped (based on GDAL_SKIP environment variable) More...
 
static QString splashPath ()
 Returns the path to the splash screen image directory. More...
 
static QString sponsorsFilePath ()
 Returns the path to the sponsors file. More...
 
static QString srsDbFilePath ()
 Returns the path to the srs.db file. More...
 
static QStringList svgPaths ()
 Returns the pathes to svg directories. More...
 
static QMap< QString, QString > systemEnvVars ()
 Returns the system environment variables passed to application. More...
 
static QString themeName ()
 Set the active theme to the specified theme. More...
 
static QString translatorsFilePath ()
 Returns the path to the sponsors file. More...
 
static QHash< QString, QString > uiThemes ()
 All themes found in ~/.qgis3/themes folder. More...
 
static QString userFullName ()
 Returns the user's operating system login account full display name. More...
 
static QString userLoginName ()
 Returns the user's operating system login account name. More...
 
static QString userStylePath ()
 Returns the path to user's style. More...
 
static QString userThemesFolder ()
 Returns the path to user's themes folder. More...
 

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"
 

Detailed Description

Extends QApplication to provide access to QGIS specific resources such as theme paths, database paths etc.

The QgsApplication class manages application-wide information.

This is a subclass of QApplication and should be instantiated in place of QApplication. Most methods are static in keeping witn 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 37 of file qgsapplication.h.

Member Enumeration Documentation

§ endian_t

Constants for endian-ness.

Enumerator
XDR 
NDR 

Definition at line 277 of file qgsapplication.h.

Constructor & Destructor Documentation

§ QgsApplication()

QgsApplication::QgsApplication ( int &  argc,
char **  argv,
bool  GUIenabled,
const QString &  customConfigPath = QString(),
const QString &  platformName = "desktop" 
)

Definition at line 103 of file qgsapplication.cpp.

§ ~QgsApplication()

QgsApplication::~QgsApplication ( )
virtual

Definition at line 239 of file qgsapplication.cpp.

Member Function Documentation

§ absolutePathToRelativePath()

QString QgsApplication::absolutePathToRelativePath ( const QString &  apath,
const QString &  targetPath 
)
static

Converts absolute path to path relative to target.

Definition at line 1072 of file qgsapplication.cpp.

§ actionScopeRegistry()

QgsActionScopeRegistry * QgsApplication::actionScopeRegistry ( )
static

Returns the action scope registry.

Note
Added in QGIS 3.0

Definition at line 1253 of file qgsapplication.cpp.

§ activeThemePath()

QString QgsApplication::activeThemePath ( )
static

Returns the path to the currently active theme directory.

Definition at line 408 of file qgsapplication.cpp.

§ appIconPath()

QString QgsApplication::appIconPath ( )
static

get application icon

Definition at line 413 of file qgsapplication.cpp.

§ applyGdalSkippedDrivers()

void QgsApplication::applyGdalSkippedDrivers ( )
static

Apply the skipped drivers list to gdal.

See also
skipGdalDriver
restoreGdalDriver
skippedGdalDrivers

Definition at line 1211 of file qgsapplication.cpp.

§ authorsFilePath()

QString QgsApplication::authorsFilePath ( )
static

Returns the path to the authors file.

Returns the path to the authors file.

Definition at line 571 of file qgsapplication.cpp.

§ buildOutputPath()

static QString QgsApplication::buildOutputPath ( )
inlinestatic

Returns path to the build output directory. Valid only when running from build directory.

Definition at line 335 of file qgsapplication.h.

§ buildSourcePath()

static QString QgsApplication::buildSourcePath ( )
inlinestatic

Returns path to the source directory. Valid only when running from build directory.

Definition at line 333 of file qgsapplication.h.

§ composerTemplatePaths()

QStringList QgsApplication::composerTemplatePaths ( )
static

Returns the pathes to composer template directories.

Returns the paths to the composer template directories.

Definition at line 750 of file qgsapplication.cpp.

§ contributorsFilePath()

QString QgsApplication::contributorsFilePath ( )
static

Returns the path to the contributors file.

Contributors are people who have submitted patches but don't have commit access.

Returns the path to the contributors file.

Definition at line 578 of file qgsapplication.cpp.

§ createDB()

bool QgsApplication::createDB ( QString *  errorMessage = nullptr)
static

initialise qgis.db

Definition at line 1258 of file qgsapplication.cpp.

§ createThemeFolder()

bool QgsApplication::createThemeFolder ( )
static

Create the users theme folder.

Definition at line 1221 of file qgsapplication.cpp.

§ defaultStylePath()

QString QgsApplication::defaultStylePath ( )
static

Returns the path to default style (works as a starting point).

Definition at line 869 of file qgsapplication.cpp.

§ defaultThemePath()

QString QgsApplication::defaultThemePath ( )
static

Returns the path to the default theme directory.

Definition at line 404 of file qgsapplication.cpp.

§ defaultThemesFolder()

QString QgsApplication::defaultThemesFolder ( )
static

Returns the path to default themes folder from install (works as a starting point).

Definition at line 874 of file qgsapplication.cpp.

§ developersMapFilePath()

QString QgsApplication::developersMapFilePath ( )
static

Returns the path to the developers map file.

The developers map was created by using leaflet framework, it shows the doc/contributors.json file.

Note
this function was added in version 2.7

Definition at line 582 of file qgsapplication.cpp.

§ donorsFilePath()

QString QgsApplication::donorsFilePath ( )
static

Returns the path to the donors file.

Returns the path to the donors file.

Definition at line 598 of file qgsapplication.cpp.

§ emitSettingsChanged

void QgsApplication::emitSettingsChanged ( )
slot

Causes the application instance to emit the settingsChanged() signal.

This should be called whenever global, application-wide settings are altered to advise listeners that they may need to update their state.

See also
settingsChanged()
Note
added in QGIS 3.0

Definition at line 1410 of file qgsapplication.cpp.

§ endian()

QgsApplication::endian_t QgsApplication::endian ( )
static

Returns whether this machine uses big or little endian.

Definition at line 889 of file qgsapplication.cpp.

§ endian_swap()

template<typename T >
static void QgsApplication::endian_swap ( T &  value)
inlinestatic

Swap the endianness of the specified value.

Note
not available in Python bindings

Definition at line 290 of file qgsapplication.h.

§ event()

bool QgsApplication::event ( QEvent *  event)
overridevirtual

Watch for QFileOpenEvent.

Definition at line 250 of file qgsapplication.cpp.

§ exitQgis()

void QgsApplication::exitQgis ( )
static

deletes provider registry and map layer registry

Definition at line 909 of file qgsapplication.cpp.

§ getThemeIcon()

QIcon QgsApplication::getThemeIcon ( const QString &  theName)
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.

Definition at line 429 of file qgsapplication.cpp.

§ getThemePixmap()

QPixmap QgsApplication::getThemePixmap ( const QString &  theName)
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.

Definition at line 460 of file qgsapplication.cpp.

§ helpAppPath()

QString QgsApplication::helpAppPath ( )
static

Returns the path to the help application.

Returns the path to the help application.

Definition at line 618 of file qgsapplication.cpp.

§ i18nPath()

QString QgsApplication::i18nPath ( )
static

Returns the path to the translation directory.

Returns the path to the translation directory.

Definition at line 635 of file qgsapplication.cpp.

§ iconPath()

QString QgsApplication::iconPath ( const QString &  iconFile)
static

Returns path to the desired icon file.

First it tries to use the active theme path, then default theme path

Definition at line 418 of file qgsapplication.cpp.

§ iconsPath()

QString QgsApplication::iconsPath ( )
static

Returns the path to the icons image directory.

Returns the path to the icons image directory.

Definition at line 686 of file qgsapplication.cpp.

§ init()

void QgsApplication::init ( QString  customConfigPath = QString())
static

This method initialises paths etc for QGIS.

Called by the ctor or call it manually when your app does not extend the QApplication class.

Note
you will probably want to call initQgis too to load the providers in the above case.
not available in Python bindings

Definition at line 114 of file qgsapplication.cpp.

§ initQgis()

void QgsApplication::initQgis ( )
static

loads providers

Definition at line 894 of file qgsapplication.cpp.

§ instance()

QgsApplication * QgsApplication::instance ( )
static

Returns the singleton instance of the QgsApplication.

Note
Added in QGIS 3.0

Definition at line 245 of file qgsapplication.cpp.

§ isRunningFromBuildDir()

static bool QgsApplication::isRunningFromBuildDir ( )
inlinestatic

Indicates whether running from build directory (not installed)

Definition at line 328 of file qgsapplication.h.

§ libexecPath()

QString QgsApplication::libexecPath ( )
static

Returns the path with utility executables (help viewer, crssync, ...)

Definition at line 884 of file qgsapplication.cpp.

§ libraryPath()

QString QgsApplication::libraryPath ( )
static

Returns the path containing qgis_core, qgis_gui, qgispython (and other) libraries.

Definition at line 879 of file qgsapplication.cpp.

§ licenceFilePath()

QString QgsApplication::licenceFilePath ( )
static

Returns the path to the licence file.

Returns the path to the licence file.

Definition at line 610 of file qgsapplication.cpp.

§ maxThreads()

static int QgsApplication::maxThreads ( )
inlinestatic

Get maximum concurrent thread count.

Note
added in 2.4

Definition at line 362 of file qgsapplication.h.

§ notify()

bool QgsApplication::notify ( QObject *  receiver,
QEvent *  event 
)
overridevirtual

Catch exceptions when sending event to receiver.

Definition at line 278 of file qgsapplication.cpp.

§ osName()

QString QgsApplication::osName ( )
static

Returns a string name of the operating system QGIS is running on.

Note
added in QGIS 2.14
See also
platform()

Definition at line 844 of file qgsapplication.cpp.

§ pkgDataPath()

QString QgsApplication::pkgDataPath ( )
static

Returns the common root path of all application data directories.

Definition at line 400 of file qgsapplication.cpp.

§ platform()

QString QgsApplication::platform ( )
static

Returns the QGIS platform name, eg "desktop" or "server".

Note
added in QGIS 2.14
See also
osName()

Definition at line 859 of file qgsapplication.cpp.

§ pluginPath()

QString QgsApplication::pluginPath ( )
static

Returns the path to the application plugin directory.

Definition at line 396 of file qgsapplication.cpp.

§ prefixPath()

QString QgsApplication::prefixPath ( )
static

Returns the path to the application prefix directory.

Definition at line 384 of file qgsapplication.cpp.

§ preNotify

void QgsApplication::preNotify ( QObject *  receiver,
QEvent *  event,
bool *  done 
)
signal
Note
not available in python bindings

§ profiler()

QgsRuntimeProfiler * QgsApplication::profiler ( )
static

Returns the application runtime profiler.

Note
added in QGIS 3.0

Definition at line 316 of file qgsapplication.cpp.

§ qgisAuthDbFilePath()

QString QgsApplication::qgisAuthDbFilePath ( )
static

Returns the path to the user authentication database file: qgis-auth.db.

Returns the path to the user authentication database file: qgis-auth.db.

Definition at line 670 of file qgsapplication.cpp.

§ qgisMasterDbFilePath()

QString QgsApplication::qgisMasterDbFilePath ( )
static

Returns the path to the master qgis.db file.

Returns the path to the master qgis.db file.

Definition at line 646 of file qgsapplication.cpp.

§ qgisSettingsDirPath()

QString QgsApplication::qgisSettingsDirPath ( )
static

Returns the path to the settings directory in user's home dir.

Returns the path to the settings directory in user's home dir

Definition at line 654 of file qgsapplication.cpp.

§ qgisUserDbFilePath()

QString QgsApplication::qgisUserDbFilePath ( )
static

Returns the path to the user qgis.db file.

Returns the path to the user qgis.db file.

Definition at line 662 of file qgsapplication.cpp.

§ registerOgrDrivers()

void QgsApplication::registerOgrDrivers ( )
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 1064 of file qgsapplication.cpp.

§ relativePathToAbsolutePath()

QString QgsApplication::relativePathToAbsolutePath ( const QString &  rpath,
const QString &  targetPath 
)
static

Converts path relative to target to an absolute path.

Definition at line 1137 of file qgsapplication.cpp.

§ reportStyleSheet()

QString QgsApplication::reportStyleSheet ( )
static

get a standard css style sheet for reports.

Typically you will use this method by doing: QString myStyle = QgsApplication::reportStyleSheet(); textBrowserReport->document()->setDefaultStyleSheet(myStyle);

Returns
QString containing the CSS 2.1 compliant stylesheet.
Note
you can use the special Qt extensions too, for example the gradient fills for backgrounds.

Definition at line 955 of file qgsapplication.cpp.

§ restoreGdalDriver()

void QgsApplication::restoreGdalDriver ( const QString &  theDriver)
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 1197 of file qgsapplication.cpp.

§ setAuthDbDirPath()

void QgsApplication::setAuthDbDirPath ( const QString &  theAuthDbDirPath)
static

Alters authentication data base directory path - used by 3rd party apps.

Definition at line 375 of file qgsapplication.cpp.

§ setDefaultSvgPaths()

void QgsApplication::setDefaultSvgPaths ( const QStringList &  pathList)
static

Alters default svg paths - used by 3rd party apps.

Definition at line 370 of file qgsapplication.cpp.

§ setFileOpenEventReceiver()

void QgsApplication::setFileOpenEventReceiver ( QObject *  receiver)
static

Set the FileOpen event receiver.

Definition at line 321 of file qgsapplication.cpp.

§ setMaxThreads()

void QgsApplication::setMaxThreads ( int  maxThreads)
static

Set maximum concurrent thread count.

Note
must be between 1 and #cores, -1 means use all available cores
added in 2.4

Definition at line 1389 of file qgsapplication.cpp.

§ setPkgDataPath()

void QgsApplication::setPkgDataPath ( const QString &  thePkgDataPath)
static

Alters pkg data path - used by 3rd party apps.

Definition at line 361 of file qgsapplication.cpp.

§ setPluginPath()

void QgsApplication::setPluginPath ( const QString &  thePluginPath)
static

Alters plugin path - used by 3rd party apps.

Definition at line 356 of file qgsapplication.cpp.

§ setPrefixPath()

void QgsApplication::setPrefixPath ( const QString &  thePrefixPath,
bool  useDefaultPaths = false 
)
static

Alters prefix path - used by 3rd party apps.

Definition at line 338 of file qgsapplication.cpp.

§ setThemeName()

void QgsApplication::setThemeName ( const QString &  theThemeName)
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.

Note
A basic test will be carried out to ensure the theme search path based on the supplied theme name exists. If it does not the theme name will be reverted to 'default'.

Set the theme path to the specified theme.

Definition at line 479 of file qgsapplication.cpp.

§ settingsChanged

void QgsApplication::settingsChanged ( )
signal

Emitted whenever any global, application-wide settings are changed.

Note
added in QGIS 3.0
See also
emitSettingsChanged()

§ setUITheme()

void QgsApplication::setUITheme ( const QString &  themeName)
static

Set the current UI theme used to style the interface.

Use uiThemes() to find valid themes to use. Variabels found in variables.qss will be added to the stylesheet on load.

Parameters
themeNameThe name of the theme.
Note
using an invalid theme name will reset to default

Definition at line 491 of file qgsapplication.cpp.

§ shortNameRegExp()

QRegExp QgsApplication::shortNameRegExp ( )
static

Returns the short name regular expression for line edit validator.

Definition at line 770 of file qgsapplication.cpp.

§ showSettings()

QString QgsApplication::showSettings ( )
static

Convenience function to get a summary of the paths used in this application instance useful for debugging mainly.

Definition at line 928 of file qgsapplication.cpp.

§ skipGdalDriver()

void QgsApplication::skipGdalDriver ( const QString &  theDriver)
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 1187 of file qgsapplication.cpp.

§ skippedGdalDrivers()

static QStringList QgsApplication::skippedGdalDrivers ( )
inlinestatic

Returns the list of gdal drivers that should be skipped (based on GDAL_SKIP environment variable)

Definition at line 352 of file qgsapplication.h.

§ splashPath()

QString QgsApplication::splashPath ( )
static

Returns the path to the splash screen image directory.

Returns the path to the splash screen image directory.

Definition at line 678 of file qgsapplication.cpp.

§ sponsorsFilePath()

QString QgsApplication::sponsorsFilePath ( )
static

Returns the path to the sponsors file.

Returns the path to the sponsors file.

Definition at line 590 of file qgsapplication.cpp.

§ srsDbFilePath()

QString QgsApplication::srsDbFilePath ( )
static

Returns the path to the srs.db file.

Returns the path to the srs.db file.

Definition at line 693 of file qgsapplication.cpp.

§ svgPaths()

QStringList QgsApplication::svgPaths ( )
static

Returns the pathes to svg directories.

Returns the paths to the svg directories.

Definition at line 719 of file qgsapplication.cpp.

§ systemEnvVars()

static QMap<QString, QString> QgsApplication::systemEnvVars ( )
inlinestatic

Returns the system environment variables passed to application.

Definition at line 172 of file qgsapplication.h.

§ themeName()

QString QgsApplication::themeName ( )
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.

Get the active theme name

Definition at line 486 of file qgsapplication.cpp.

§ translatorsFilePath()

QString QgsApplication::translatorsFilePath ( )
static

Returns the path to the sponsors file.

Definition at line 604 of file qgsapplication.cpp.

§ uiThemes()

QHash< QString, QString > QgsApplication::uiThemes ( )
static

All themes found in ~/.qgis3/themes folder.

The path is to the root folder for the theme

Note
Valid theme folders must contain a style.qss file.
Returns
A hash of theme name and theme path. Valid theme folders contain style.qss

Definition at line 545 of file qgsapplication.cpp.

§ userFullName()

QString QgsApplication::userFullName ( )
static

Returns the user's operating system login account full display name.

Note
added in QGIS 2.14
See also
userLoginName()

Definition at line 810 of file qgsapplication.cpp.

§ userLoginName()

QString QgsApplication::userLoginName ( )
static

Returns the user's operating system login account name.

Note
added in QGIS 2.14
See also
userFullName()

Definition at line 775 of file qgsapplication.cpp.

§ userStylePath()

QString QgsApplication::userStylePath ( )
static

Returns the path to user's style.

Definition at line 765 of file qgsapplication.cpp.

§ userThemesFolder()

QString QgsApplication::userThemesFolder ( )
static

Returns the path to user's themes folder.

Definition at line 864 of file qgsapplication.cpp.

Member Data Documentation

§ QGIS_APPLICATION_NAME

const char * QgsApplication::QGIS_APPLICATION_NAME = "QGIS3"
static

Definition at line 44 of file qgsapplication.h.

§ QGIS_ORGANIZATION_DOMAIN

const char * QgsApplication::QGIS_ORGANIZATION_DOMAIN = "qgis.org"
static

Definition at line 43 of file qgsapplication.h.

§ QGIS_ORGANIZATION_NAME

const char * QgsApplication::QGIS_ORGANIZATION_NAME = "QGIS"
static

Definition at line 42 of file qgsapplication.h.


The documentation for this class was generated from the following files: