#include "qgsproject.h"
#include <deque>
#include <memory>
#include "qgsdatasourceuri.h"
#include "qgsexception.h"
#include "qgslayertree.h"
#include "qgslayertreeutils.h"
#include "qgslayertreeregistrybridge.h"
#include "qgslogger.h"
#include "qgsmaplayerregistry.h"
#include "qgspluginlayer.h"
#include "qgspluginlayerregistry.h"
#include "qgsprojectfiletransform.h"
#include "qgsprojectproperty.h"
#include "qgsprojectversion.h"
#include "qgsrasterlayer.h"
#include "qgsrectangle.h"
#include "qgsrelationmanager.h"
#include "qgsvectorlayer.h"
#include "qgsvisibilitypresetcollection.h"
#include <QApplication>
#include <QFileInfo>
#include <QDomNode>
#include <QObject>
#include <QTextStream>
#include <QDir>
#include <QUrl>
Go to the source code of this file.
|
static void | _getProperties (QDomDocument const &doc, QgsPropertyKey &project_properties) |
| Restore any optional properties found in "doc" to "properties". More...
|
|
static void | _getTitle (QDomDocument const &doc, QString &title) |
| Get the project title. More...
|
|
static QgsProjectVersion | _getVersion (QDomDocument const &doc) |
| Return the version string found in the given Dom document. More...
|
|
static QgsProperty * | addKey_ (QString const &scope, QString const &key, QgsPropertyKey *rootProperty, const QVariant &value) |
| Add the given key and value. More...
|
|
static void | dump_ (QgsPropertyKey const &topQgsPropertyKey) |
|
static QgsProperty * | findKey_ (QString const &scope, QString const &key, QgsPropertyKey &rootProperty) |
| return the property that matches the given key sequence, if any More...
|
|
static QStringList | makeKeyTokens_ (QString const &scope, QString const &key) |
| Take the given scope and key and convert them to a string list of key tokens that will be used to navigate through a Property hierarchy. More...
|
|
static void | removeKey_ (QString const &scope, QString const &key, QgsPropertyKey &rootProperty) |
|
Restore any optional properties found in "doc" to "properties".
properties tags for all optional properties. Within that there will be scope tags. In the following example there exist one property in the "fsplugin" scope. "layers" is a list containing three string values.
3 <foo type="int" >42</foo>
4 <baz type="int" >1</baz>
5 <layers type="QStringList" >
6 <value>railroad</value>
9 <xyqzzy type="int" >1</xyqzzy>
10 <bar type="double" >123.456</bar>
11 <feature_types type="QStringList" >
- Parameters
-
doc | xml document |
project_properties | should be the top QgsPropertyKey node. |
Definition at line 472 of file qgsproject.cpp.
Get the project title.
XML in file has this form:
1 <qgis projectname="default project">
2 <title>a project title</title>
- Todo:
- XXX we should go with the attribute xor title, not both.
Definition at line 517 of file qgsproject.cpp.
Return the version string found in the given Dom document.
- Returns
- the version string or an empty string if none found
Definition at line 556 of file qgsproject.cpp.
Add the given key and value.
- Parameters
-
scope | scope of key |
key | key name |
rootProperty | is the property from which to start adding |
value | the value associated with the key |
Definition at line 161 of file qgsproject.cpp.
return the property that matches the given key sequence, if any
- Parameters
-
scope | scope of key |
key | keyname |
rootProperty | is likely to be the top level QgsPropertyKey in QgsProject:e:Imp. |
- Returns
- null if not found, otherwise located Property
Definition at line 85 of file qgsproject.cpp.
Take the given scope and key and convert them to a string list of key tokens that will be used to navigate through a Property hierarchy.
E.g., scope "someplugin" and key "/foo/bar/baz" will become a string list of { "properties", "someplugin", "foo", "bar", "baz" }. "properties" is always first because that's the permanent ``root'' Property node.
Definition at line 61 of file qgsproject.cpp.