25 #include <QFileOpenEvent>
26 #include <QMessageBox>
32 #include <QThreadPool>
35 #include <netinet/in.h>
40 #include "qgsconfig.h"
47 QObject *
ABISYM( QgsApplication::mFileOpenEventReceiver );
48 QStringList
ABISYM( QgsApplication::mFileOpenEventList );
49 QString
ABISYM( QgsApplication::mPrefixPath );
50 QString
ABISYM( QgsApplication::mPluginPath );
51 QString
ABISYM( QgsApplication::mPkgDataPath );
52 QString
ABISYM( QgsApplication::mLibraryPath );
53 QString
ABISYM( QgsApplication::mLibexecPath );
54 QString
ABISYM( QgsApplication::mThemeName );
55 QStringList
ABISYM( QgsApplication::mDefaultSvgPaths );
56 QMap<QString, QString>
ABISYM( QgsApplication::mSystemEnvVars );
57 QString
ABISYM( QgsApplication::mConfigPath );
58 bool ABISYM( QgsApplication::mRunningFromBuildDir ) =
false;
59 QString
ABISYM( QgsApplication::mBuildSourcePath );
61 QString
ABISYM( QgsApplication::mCfgIntDir );
63 QString
ABISYM( QgsApplication::mBuildOutputPath );
64 QStringList
ABISYM( QgsApplication::mGdalSkipList );
65 int ABISYM( QgsApplication::mMaxThreads );
85 : QApplication( argc, argv, GUIenabled )
87 init( customConfigPath );
92 if ( customConfigPath.isEmpty() )
97 qRegisterMetaType<QgsGeometry::Error>(
"QgsGeometry::Error" );
99 QString
prefixPath( getenv(
"QGIS_PREFIX_PATH" ) ? getenv(
"QGIS_PREFIX_PATH" ) : applicationDirPath() );
105 foreach ( QString path, QStringList() <<
"" <<
"/.." <<
"/bin" <<
"/../../.." )
107 f.setFileName( prefixPath + path +
"/qgisbuildpath.txt" );
111 if ( f.exists() && f.open( QIODevice::ReadOnly ) )
113 ABISYM( mRunningFromBuildDir ) =
true;
114 ABISYM( mBuildSourcePath ) = f.readLine().trimmed();
115 ABISYM( mBuildOutputPath ) = f.readLine().trimmed();
116 qDebug(
"Running from build directory!" );
117 qDebug(
"- source directory: %s",
ABISYM( mBuildSourcePath ).toUtf8().data() );
118 qDebug(
"- output directory of the build: %s",
ABISYM( mBuildOutputPath ).toUtf8().data() );
120 ABISYM( mCfgIntDir ) = prefixPath.split(
"/", QString::SkipEmptyParts ).last();
121 qDebug(
"- cfg: %s",
ABISYM( mCfgIntDir ).toUtf8().data() );
125 if (
ABISYM( mRunningFromBuildDir ) )
128 ABISYM( mPrefixPath ) = QString();
129 #if defined(_MSC_VER) && !defined(USING_NMAKE)
135 ABISYM( mLibraryPath ) =
ABISYM( mBuildOutputPath ) +
"/" + QGIS_LIB_SUBDIR +
"/";
136 #if defined(_MSC_VER) && !defined(USING_NMAKE)
137 ABISYM( mLibexecPath ) =
ABISYM( mBuildOutputPath ) +
"/" + QGIS_LIBEXEC_SUBDIR +
"/" +
ABISYM( mCfgIntDir ) +
"/";
139 ABISYM( mLibexecPath ) =
ABISYM( mBuildOutputPath ) +
"/" + QGIS_LIBEXEC_SUBDIR +
"/";
144 char *prefixPath = getenv(
"QGIS_PREFIX_PATH" );
147 #if defined(Q_WS_MACX) || defined(Q_WS_WIN32) || defined(WIN32)
149 #elif defined(ANDROID)
151 QDir myDir( QDir::homePath() );
153 QString myPrefix = myDir.absolutePath();
156 QDir myDir( applicationDirPath() );
158 QString myPrefix = myDir.absolutePath();
168 if ( !customConfigPath.isEmpty() )
170 ABISYM( mConfigPath ) = customConfigPath +
"/";
176 QMap<QString, QString> systemEnvVarMap;
177 foreach (
const QString &varStr, QProcess::systemEnvironment() )
179 int pos = varStr.indexOf( QLatin1Char(
'=' ) );
182 QString varStrName = varStr.left( pos );
183 QString varStrValue = varStr.mid( pos + 1 );
184 systemEnvVarMap.insert( varStrName, varStrValue );
186 ABISYM( mSystemEnvVars ) = systemEnvVarMap;
189 QCoreApplication::addLibraryPath(
pluginPath() );
194 ABISYM( mMaxThreads ) = -1;
204 if ( event->type() == QEvent::FileOpen )
207 if (
ABISYM( mFileOpenEventReceiver ) )
210 done =
notify(
ABISYM( mFileOpenEventReceiver ), event );
217 ABISYM( mFileOpenEventList ).append( static_cast<QFileOpenEvent *>( event )->
file() );
224 done = QApplication::event( event );
233 if ( thread() == receiver->thread() )
234 emit
preNotify( receiver, event, &done );
243 done = QApplication::notify( receiver, event );
248 if ( qApp->thread() == QThread::currentThread() )
249 QMessageBox::critical( activeWindow(),
tr(
"Exception" ), e.
what() );
251 catch ( std::exception & e )
253 QgsDebugMsg(
"Caught unhandled std::exception: " + QString::fromAscii( e.what() ) );
254 if ( qApp->thread() == QThread::currentThread() )
255 QMessageBox::critical( activeWindow(),
tr(
"Exception" ), e.what() );
259 QgsDebugMsg(
"Caught unhandled unknown exception" );
260 if ( qApp->thread() == QThread::currentThread() )
261 QMessageBox::critical( activeWindow(),
tr(
"Exception" ),
tr(
"unknown exception" ) );
270 ABISYM( mFileOpenEventReceiver ) = receiver;
272 if (
ABISYM( mFileOpenEventList ).count() > 0 )
274 QStringListIterator i(
ABISYM( mFileOpenEventList ) );
275 while ( i.hasNext() )
277 QFileOpenEvent foe( i.next() );
278 QgsApplication::sendEvent(
ABISYM( mFileOpenEventReceiver ), &foe );
280 ABISYM( mFileOpenEventList ).clear();
286 ABISYM( mPrefixPath ) = thePrefixPath;
287 #if defined(_MSC_VER)
288 if (
ABISYM( mPrefixPath ).endsWith(
"/bin" ) )
290 ABISYM( mPrefixPath ).chop( 4 );
293 if ( useDefaultPaths && !
ABISYM( mRunningFromBuildDir ) )
298 ABISYM( mLibraryPath ) =
ABISYM( mPrefixPath ) +
"/" + QGIS_LIB_SUBDIR +
"/";
299 ABISYM( mLibexecPath ) =
ABISYM( mPrefixPath ) +
"/" + QGIS_LIBEXEC_SUBDIR +
"/";
304 ABISYM( mPluginPath ) = thePluginPath;
309 ABISYM( mPkgDataPath ) = thePkgDataPath;
310 QString mySvgPath = thePkgDataPath + (
ABISYM( mRunningFromBuildDir ) ?
"/images/svg/" :
"/svg/" );
312 if ( !
ABISYM( mDefaultSvgPaths ).contains( mySvgPath ) )
313 ABISYM( mDefaultSvgPaths ) << mySvgPath;
318 ABISYM( mDefaultSvgPaths ) = pathList;
323 if (
ABISYM( mRunningFromBuildDir ) )
325 qWarning(
"!!! prefix path was requested, but it is not valid - we do not run from installed path !!!" );
328 return ABISYM( mPrefixPath );
332 return ABISYM( mPluginPath );
336 return ABISYM( mPkgDataPath );
340 return ":/images/themes/default/";
344 return ":/images/themes/" +
themeName() +
"/";
352 if ( QFile::exists( path + iconFile ) )
353 return path + iconFile;
361 QString myPreferredPath =
activeThemePath() + QDir::separator() + theName;
363 if ( QFile::exists( myPreferredPath ) )
365 return QIcon( myPreferredPath );
367 else if ( QFile::exists( myDefaultPath ) )
371 return QIcon( myDefaultPath );
382 QString myPreferredPath =
activeThemePath() + QDir::separator() + theName;
384 if ( QFile::exists( myPreferredPath ) )
386 return QPixmap( myPreferredPath );
392 return QPixmap( myDefaultPath );
401 QString myPath =
":/images/themes/" + theThemeName +
"/";
403 if ( QFile::exists( myPath ) )
405 ABISYM( mThemeName ) = theThemeName;
409 ABISYM( mThemeName ) =
"default";
417 return ABISYM( mThemeName );
424 return ABISYM( mPkgDataPath ) + QString(
"/doc/AUTHORS" );
431 return ABISYM( mPkgDataPath ) + QString(
"/doc/CONTRIBUTORS" );
438 return ABISYM( mPkgDataPath ) + QString(
"/doc/SPONSORS" );
446 return ABISYM( mPkgDataPath ) + QString(
"/doc/DONORS" );
455 return ABISYM( mPkgDataPath ) + QString(
"/doc/TRANSLATORS" );
463 return ABISYM( mPkgDataPath ) + QString(
"/doc/LICENSE" );
473 helpAppPath = applicationDirPath() +
"/bin/qgis_help.app/Contents/MacOS";
477 helpAppPath +=
"/qgis_help";
479 helpAppPath +=
".exe";
488 if (
ABISYM( mRunningFromBuildDir ) )
489 return ABISYM( mBuildOutputPath ) + QString(
"/i18n" );
491 return ABISYM( mPkgDataPath ) + QString(
"/i18n/" );
499 return ABISYM( mPkgDataPath ) + QString(
"/resources/qgis.db" );
507 return ABISYM( mConfigPath );
523 return QString(
":/images/splash/" );
531 return ABISYM( mPkgDataPath ) + QString(
"/images/icons/" );
538 if (
ABISYM( mRunningFromBuildDir ) )
540 QString tempCopy = QDir::tempPath() +
"/srs.db";
542 if ( !QFile( tempCopy ).exists() )
544 QFile f(
ABISYM( mPkgDataPath ) +
"/resources/srs.db" );
545 if ( !f.copy( tempCopy ) )
547 qFatal(
"Could not create temporary copy" );
555 return ABISYM( mPkgDataPath ) + QString(
"/resources/srs.db" );
567 QStringList myPathList;
568 QString myPaths = settings.value(
"svg/searchPathsForSVG",
"" ).toString();
569 if ( !myPaths.isEmpty() )
571 myPathList = myPaths.split(
"|" );
574 myPathList <<
ABISYM( mDefaultSvgPaths );
585 return ABISYM( mPkgDataPath ) + QString(
"/resources/symbology-ng-style.db" );
590 return ABISYM( mLibraryPath );
595 return ABISYM( mLibexecPath );
600 return ( htonl( 1 ) == 1 ) ?
XDR :
NDR ;
621 QString myEnvironmentVar( getenv(
"QGIS_PREFIX_PATH" ) );
622 QString myState =
tr(
"Application state:\n"
623 "QGIS_PREFIX_PATH env var:\t\t%1\n"
625 "Plugin Path:\t\t%3\n"
626 "Package Data Path:\t%4\n"
627 "Active Theme Name:\t%5\n"
628 "Active Theme Path:\t%6\n"
629 "Default Theme Path:\t%7\n"
630 "SVG Search Paths:\t%8\n"
631 "User DB Path:\t%9\n" )
632 .arg( myEnvironmentVar )
639 .arg(
svgPaths().join(
tr(
"\n\t\t",
"match indentation of application state" ) ) )
651 QColor myColor1( Qt::lightGray );
652 QColor myColor2 = myColor1;
653 myColor2 = myColor2.lighter( 110 );
655 myStyle =
"p.glossy{ background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, "
656 " stop: 0 " + myColor1.name() +
","
657 " stop: 0.1 " + myColor2.name() +
","
658 " stop: 0.5 " + myColor1.name() +
","
659 " stop: 0.9 " + myColor2.name() +
","
660 " stop: 1 " + myColor1.name() +
");"
662 " padding-left: 4px;"
663 " padding-top: 20px;"
664 " padding-bottom: 8px;"
665 " border: 1px solid #6c6c6c;"
667 "p.subheaderglossy{ background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, "
668 " stop: 0 " + myColor1.name() +
","
669 " stop: 0.1 " + myColor2.name() +
","
670 " stop: 0.5 " + myColor1.name() +
","
671 " stop: 0.9 " + myColor2.name() +
","
672 " stop: 1 " + myColor1.name() +
");"
673 " font-weight: bold;"
674 " font-size: medium;"
675 " line-height: 1.1em;"
678 " padding-left: 4px;"
679 " padding-right: 4px;"
680 " padding-top: 20px;"
681 " padding-bottom: 8px;"
682 " border: 1px solid #6c6c6c;"
684 "th.glossy{ background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, "
685 " stop: 0 " + myColor1.name() +
","
686 " stop: 0.1 " + myColor2.name() +
","
687 " stop: 0.5 " + myColor1.name() +
","
688 " stop: 0.9 " + myColor2.name() +
","
689 " stop: 1 " + myColor1.name() +
");"
691 " border: 1px solid #6c6c6c;"
693 ".overview{ font: 1.82em; font-weight: bold;}"
694 "body{ background: white;"
696 " font-family: arial,sans-serif;"
698 "h1{ background-color: #F6F6F6;"
700 " font-size: x-large; "
701 " font-weight: normal;"
702 " font-family: luxi serif, georgia, times new roman, times, serif;"
704 " padding: 0.75em 0 0;"
708 "h2{ background-color: #F6F6F6;"
710 " font-size: medium; "
711 " font-weight: normal;"
712 " font-family: luxi serif, georgia, times new roman, times, serif;"
714 " padding: 0.75em 0 0;"
716 " line-height: 1.1em;"
718 "h3{ background-color: #F6F6F6;"
720 " font-family: luxi serif, georgia, times new roman, times, serif;"
721 " font-weight: bold;"
723 " text-align: right;"
724 " border-bottom: 5px solid #DCEB5C;"
726 "h4{ background-color: #F6F6F6;"
728 " font-family: luxi serif, georgia, times new roman, times, serif;"
729 " font-weight: bold;"
730 " font-size: medium;"
731 " text-align: right;"
733 "h5{ background-color: #F6F6F6;"
735 " font-family: luxi serif, georgia, times new roman, times, serif;"
736 " font-weight: bold;"
738 " text-align: right;"
741 " font-family: arial,sans-serif;"
744 "label{ background-color: #FFFFCC;"
745 " border: 1px solid black;"
747 " padding: 0px 3px; "
755 if ( 0 >= OGRGetDriverCount() )
763 #if defined( Q_OS_WIN )
764 const Qt::CaseSensitivity cs = Qt::CaseInsensitive;
766 aPath.replace(
"\\",
"/" );
767 if ( aPath.startsWith(
"//" ) )
770 aPath =
"\\\\" + aPath.mid( 2 );
773 targetPath.replace(
"\\",
"/" );
774 if ( targetPath.startsWith(
"//" ) )
777 targetPath =
"\\\\" + targetPath.mid( 2 );
780 const Qt::CaseSensitivity cs = Qt::CaseSensitive;
783 QStringList targetElems = targetPath.split(
"/", QString::SkipEmptyParts );
784 QStringList aPathElems = aPath.split(
"/", QString::SkipEmptyParts );
786 targetElems.removeAll(
"." );
787 aPathElems.removeAll(
"." );
791 while ( aPathElems.size() > 0 &&
792 targetElems.size() > 0 &&
793 aPathElems[0].compare( targetElems[0], cs ) == 0 )
795 aPathElems.removeFirst();
796 targetElems.removeFirst();
806 if ( targetElems.size() > 0 )
809 for (
int i = 0; i < targetElems.size(); i++ )
811 aPathElems.insert( 0,
".." );
818 aPathElems.insert( 0,
"." );
821 return aPathElems.join(
"/" );
827 if ( !rpath.startsWith(
"./" ) && !rpath.startsWith(
"../" ) )
832 #if defined(Q_OS_WIN)
833 rpath.replace(
"\\",
"/" );
834 targetPath.replace(
"\\",
"/" );
836 bool uncPath = targetPath.startsWith(
"//" );
839 QStringList srcElems = rpath.split(
"/", QString::SkipEmptyParts );
840 QStringList targetElems = targetPath.split(
"/", QString::SkipEmptyParts );
842 #if defined(Q_OS_WIN)
845 targetElems.insert( 0,
"" );
846 targetElems.insert( 0,
"" );
851 targetElems << srcElems;
852 targetElems.removeAll(
"." );
856 while (( pos = targetElems.indexOf(
".." ) ) > 0 )
859 targetElems.removeAt( pos - 1 );
860 targetElems.removeAt( pos - 1 );
863 #if !defined(Q_OS_WIN)
865 targetElems.prepend(
"" );
868 return targetElems.join(
"/" );
873 if (
ABISYM( mGdalSkipList ).contains( theDriver ) || theDriver.isEmpty() )
877 ABISYM( mGdalSkipList ) << theDriver;
883 if ( !
ABISYM( mGdalSkipList ).contains( theDriver ) )
887 int myPos =
ABISYM( mGdalSkipList ).indexOf( theDriver );
890 ABISYM( mGdalSkipList ).removeAt( myPos );
897 ABISYM( mGdalSkipList ).removeDuplicates();
898 QString myDriverList =
ABISYM( mGdalSkipList ).join(
" " );
901 CPLSetConfigOption(
"GDAL_SKIP", myDriverList.toUtf8() );
911 QDir myDir( myPamPath );
912 if ( !myDir.exists() )
914 myDir.mkpath( myPamPath );
917 #if defined(Q_WS_WIN32) || defined(WIN32)
918 CPLSetConfigOption(
"GDAL_PAM_PROXY_DIR", myPamPath.toUtf8() );
922 int myChangeFlag = 0;
923 setenv(
"GDAL_PAM_PROXY_DIR", myPamPath.toUtf8(), myChangeFlag );
930 if ( !qgisPrivateDbFile.exists() )
934 QFile masterFile( qgisMasterDbFileName );
940 bool isDbFileCopied = masterFile.copy( qgisPrivateDbFile.fileName() );
942 if ( !isDbFileCopied )
946 *errorMessage =
tr(
"[ERROR] Can not make qgis.db private copy" );
959 *errorMessage =
tr(
"Could not open qgis.db" );
965 int res = sqlite3_exec( db,
"SELECT epsg FROM tbl_srs LIMIT 0", 0, 0, &errmsg );
966 if ( res == SQLITE_OK )
969 if ( sqlite3_exec( db,
970 "ALTER TABLE tbl_srs RENAME TO tbl_srs_bak;"
971 "CREATE TABLE tbl_srs ("
972 "srs_id INTEGER PRIMARY KEY,"
973 "description text NOT NULL,"
974 "projection_acronym text NOT NULL,"
975 "ellipsoid_acronym NOT NULL,"
976 "parameters text NOT NULL,"
980 "is_geo integer NOT NULL,"
981 "deprecated boolean);"
982 "CREATE INDEX idx_srsauthid on tbl_srs(auth_name,auth_id);"
983 "INSERT INTO tbl_srs(srs_id,description,projection_acronym,ellipsoid_acronym,parameters,srid,auth_name,auth_id,is_geo,deprecated) SELECT srs_id,description,projection_acronym,ellipsoid_acronym,parameters,srid,'','',is_geo,0 FROM tbl_srs_bak;"
984 "DROP TABLE tbl_srs_bak", 0, 0, &errmsg ) != SQLITE_OK
989 *errorMessage =
tr(
"Migration of private qgis.db failed.\n%1" ).arg( QString::fromUtf8( errmsg ) );
991 sqlite3_free( errmsg );
998 sqlite3_free( errmsg );
1001 if ( sqlite3_exec( db,
"DROP VIEW vw_srs", 0, 0, &errmsg ) != SQLITE_OK )
1003 QgsDebugMsg( QString(
"vw_srs didn't exists in private qgis.db: %1" ).arg( errmsg ) );
1006 if ( sqlite3_exec( db,
1007 "CREATE VIEW vw_srs AS"
1009 " a.description AS description"
1010 ",a.srs_id AS srs_id"
1011 ",a.is_geo AS is_geo"
1012 ",coalesce(b.name,a.projection_acronym) AS name"
1013 ",a.parameters AS parameters"
1014 ",a.auth_name AS auth_name"
1015 ",a.auth_id AS auth_id"
1016 ",a.deprecated AS deprecated"
1018 " LEFT OUTER JOIN tbl_projection b ON a.projection_acronym=b.acronym"
1019 " ORDER BY coalesce(b.name,a.projection_acronym),a.description", 0, 0, &errmsg ) != SQLITE_OK
1024 *errorMessage =
tr(
"Update of view in private qgis.db failed.\n%1" ).arg( QString::fromUtf8( errmsg ) );
1026 sqlite3_free( errmsg );
1027 sqlite3_close( db );
1031 sqlite3_close( db );
1038 QgsDebugMsg( QString(
"maxThreads: %1" ).arg( maxThreads ) );
1042 if ( maxThreads < 1 || maxThreads > QThread::idealThreadCount() )
1049 if ( maxThreads == -1 )
1050 maxThreads = QThread::idealThreadCount();
1053 QThreadPool::globalInstance()->setMaxThreadCount( maxThreads );
1054 QgsDebugMsg( QString(
"set QThreadPool max thread count to %1" ).arg( QThreadPool::globalInstance()->maxThreadCount() ) );
static const QString pkgDataPath()
Returns the common root path of all application data directories.
static void init(QString customConfigPath=QString())
This method initialises paths etc for QGIS.
static const QString i18nPath()
Returns the path to the translation directory.
static const QString contributorsFilePath()
Returns the path to the contributors file.
enum QgsApplication::ENDIAN endian_t
constants for endian-ness
static const QString qgisMasterDbFilePath()
Returns the path to the master qgis.db file.
static const QString libexecPath()
Returns the path with utility executables (help viewer, crssync, ...)
static const QString activeThemePath()
Returns the path to the currently active theme directory.
static QObject * ABISYM(mFileOpenEventReceiver)
static const QString prefixPath()
Returns the path to the application prefix directory.
static const QString helpAppPath()
Returns the path to the help application.
static const QStringList svgPaths()
Returns the pathes to svg directories.
static const QString licenceFilePath()
static QgsProviderRegistry * instance(QString pluginPath=QString::null)
means of accessing canonical single instance
static void setPrefixPath(const QString &thePrefixPath, bool useDefaultPaths=false)
Alters prefix path - used by 3rd party apps.
static QString iconPath(QString iconFile)
Returns path to the desired icon file.
static const QString libraryPath()
Returns the path containing qgis_core, qgis_gui, qgispython (and other) libraries.
static QIcon getThemeIcon(const QString &theName)
Helper to get a theme icon.
static void registerOgrDrivers()
Register OGR drivers ensuring this only happens once.
static const QString translatorsFilePath()
Returns the path to the sponsors file.
static const QString authorsFilePath()
Returns the path to the authors file.
static QString absolutePathToRelativePath(QString apath, QString targetPath)
Converts absolute path to path relative to target.
static void setFileOpenEventReceiver(QObject *receiver)
Set the FileOpen event receiver.
static QString reportStyleSheet()
get a standard css style sheet for reports.
static int maxThreads()
Get maximum concurrent thread count.
static endian_t endian()
Returns whether this machine uses big or little endian.
static const QString qgisSettingsDirPath()
Returns the path to the settings directory in user's home dir.
static QPixmap getThemePixmap(const QString &theName)
Helper to get a theme icon as a pixmap.
virtual bool notify(QObject *receiver, QEvent *event)
Catch exceptions when sending event to receiver.
static void applyGdalSkippedDrivers()
Apply the skipped drivers list to gdal.
static void setThemeName(const QString &theThemeName)
Set the active theme to the specified theme.
static const QString iconsPath()
Returns the path to the icons image directory.
virtual ~QgsApplication()
static const QString splashPath()
Returns the path to the splash screen image directory.
static const QString defaultThemePath()
Returns the path to the default theme directory.
static void setPkgDataPath(const QString &thePkgDataPath)
Alters pkg data path - used by 3rd party apps.
static void restoreGdalDriver(QString theDriver)
Sets the GDAL_SKIP environment variable to exclude the specified driver and then calls GDALDriverMana...
static const char * QGIS_ORGANIZATION_NAME
static bool createDB(QString *errorMessage=0)
initialise qgis.db
static void setPluginPath(const QString &thePluginPath)
Alters plugin path - used by 3rd party apps.
static const QString defaultStyleV2Path()
Returns the path to default style (works as a starting point). Added in QGIS 1.4. ...
static void initQgis()
loads providers
static void setDefaultSvgPaths(const QStringList &pathList)
Alters default svg paths - used by 3rd party apps. Added in QGIS 1.5.
static QString relativePathToAbsolutePath(QString rpath, QString targetPath)
Converts path relative to target to an absolute path.
static void skipGdalDriver(QString theDriver)
Sets the GDAL_SKIP environment variable to include the specified driver and then calls GDALDriverMana...
static QString showSettings()
Convenience function to get a summary of the paths used in this application instance useful for debug...
static const char * QGIS_ORGANIZATION_DOMAIN
static QgsMapLayerRegistry * instance()
Returns the instance pointer, creating the object on the first call.
static const QString donorsFilePath()
Returns the path to the donors file.
static const QString srsDbFilePath()
Returns the path to the srs.db file.
QObject * ABISYM(QgsApplication::mFileOpenEventReceiver)
static void exitQgis()
deletes provider registry and map layer registry
static const QString sponsorsFilePath()
Returns the path to the sponsors file.
QgsApplication(int &argc, char **argv, bool GUIenabled, QString customConfigPath=QString())
static const char * QGIS_APPLICATION_NAME
virtual bool event(QEvent *event)
Watch for QFileOpenEvent.
static const QString qgisUserDbFilePath()
Returns the path to the user qgis.db file.
static const QString pluginPath()
Returns the path to the application plugin directory.
static const QString userStyleV2Path()
Returns the path to user's style. Added in QGIS 1.4.
static const QString themeName()
Set the active theme to the specified theme.
static const int QGIS_VERSION_INT
Defines a qgis exception class.
static void setMaxThreads(int maxThreads)
Set maximum concurrent thread count.
void preNotify(QObject *receiver, QEvent *event, bool *done)