15 #ifndef QGSAPPLICATION_H
16 #define QGSAPPLICATION_H
18 #include <QApplication>
20 #include <QStringList>
23 #include <qgsconfig.h>
42 QgsApplication(
int & argc,
char ** argv,
bool GUIenabled, QString customConfigPath = QString() );
50 static void init( QString customConfigPath = QString() );
53 virtual bool event( QEvent * event );
56 virtual bool notify( QObject * receiver, QEvent * event );
59 static void setFileOpenEventReceiver( QObject * receiver );
70 static void setThemeName(
const QString &theThemeName );
78 static const QString themeName();
81 static const QString authorsFilePath();
87 static const QString contributorsFilePath();
91 static const QString sponsorsFilePath();
95 static const QString donorsFilePath();
101 static const QString translatorsFilePath();
106 static const QString licenceFilePath();
109 static const QString helpAppPath();
112 static const QString i18nPath();
115 static const QString qgisMasterDbFilePath();
118 static const QString qgisSettingsDirPath();
121 static const QString qgisUserDbFilePath();
124 static const QString splashPath();
127 static const QString iconsPath();
130 static const QString srsDbFilePath();
134 static const QStringList svgPaths();
141 static const QString prefixPath();
144 static const QString pluginPath();
147 static const QString pkgDataPath();
150 static const QString activeThemePath();
153 static const QString defaultThemePath();
158 static QString iconPath( QString iconFile );
163 static QIcon getThemeIcon(
const QString &theName );
168 static QPixmap getThemePixmap(
const QString &theName );
171 static const QString userStyleV2Path();
174 static const QString defaultStyleV2Path();
178 static const QString libraryPath();
182 static const QString libexecPath();
185 static void setPrefixPath(
const QString &thePrefixPath,
bool useDefaultPaths =
false );
188 static void setPluginPath(
const QString &thePluginPath );
191 static void setPkgDataPath(
const QString &thePkgDataPath );
194 static void setDefaultSvgPaths(
const QStringList& pathList );
197 static void initQgis();
200 static bool createDB( QString* errorMessage = 0 );
203 static void exitQgis();
214 static endian_t endian();
224 static QString reportStyleSheet();
228 static QString showSettings();
236 static void registerOgrDrivers();
240 static QString absolutePathToRelativePath( QString apath, QString targetPath );
243 static QString relativePathToAbsolutePath( QString rpath, QString targetPath );
249 static QString cfgIntDir() {
return ABISYM( mCfgIntDir ); }
263 static void skipGdalDriver( QString theDriver );
270 static void restoreGdalDriver( QString theDriver );
283 static void applyGdalSkippedDrivers();
291 static void setMaxThreads(
int maxThreads );
295 bool x11EventFilter( XEvent * event )
303 void preNotify( QObject * receiver, QEvent * event,
bool * done );
306 static QObject*
ABISYM( mFileOpenEventReceiver );
307 static QStringList
ABISYM( mFileOpenEventList );
309 static QString
ABISYM( mPrefixPath );
310 static QString
ABISYM( mPluginPath );
311 static QString
ABISYM( mPkgDataPath );
312 static QString
ABISYM( mLibraryPath );
313 static QString
ABISYM( mLibexecPath );
314 static QString
ABISYM( mThemeName );
315 static QStringList
ABISYM( mDefaultSvgPaths );
316 static QMap<QString, QString>
ABISYM( mSystemEnvVars );
318 static QString
ABISYM( mConfigPath );
321 static bool ABISYM( mRunningFromBuildDir );
323 static QString
ABISYM( mBuildSourcePath );
326 static QString
ABISYM( mCfgIntDir );
329 static QString
ABISYM( mBuildOutputPath );
333 static QStringList
ABISYM( mGdalSkipList );
336 static int ABISYM( mMaxThreads );
Extends QApplication to provide access to QGIS specific resources such as theme paths, database paths etc.
ENDIAN
constants for endian-ness
static QStringList skippedGdalDrivers()
Returns the list of gdal drivers that should be skipped (based on GDAL_SKIP environment variable) ...
static bool isRunningFromBuildDir()
Indicates whether running from build directory (not installed)
static int maxThreads()
Get maximum concurrent thread count.
static QString buildOutputPath()
Returns path to the build output directory.
static const char * QGIS_ORGANIZATION_NAME
static const QMap< QString, QString > systemEnvVars()
Returns the system environment variables passed to application.
static QString buildSourcePath()
Returns path to the source directory.
static const char * QGIS_ORGANIZATION_DOMAIN
QObject * ABISYM(QgsApplication::mFileOpenEventReceiver)
static const char * QGIS_APPLICATION_NAME