2004-09-09 01:23:32 +00:00
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
/** \ingroup core
|
|
|
|
* Reads and writes project states.
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2004-09-09 01:23:32 +00:00
|
|
|
|
|
|
|
@note
|
|
|
|
|
|
|
|
Has two general kinds of state to make persistent. (I.e., to read and
|
|
|
|
write.) First, Qgis proprietary information. Second plug-in information.
|
|
|
|
|
|
|
|
A singleton since there shall only be one active project at a time; and
|
|
|
|
provides canonical location for plug-ins and main app to find/set
|
|
|
|
properties.
|
|
|
|
|
|
|
|
Might want to consider moving from Singleton; i.e., allowing more than one
|
|
|
|
project. Just as the GIMP can have simultaneous multiple images, perhaps
|
|
|
|
qgis can one day have simultaneous multiple projects.
|
|
|
|
|
|
|
|
*/
|
2007-01-09 02:39:15 +00:00
|
|
|
class QgsProject : QObject
|
2004-09-09 01:23:32 +00:00
|
|
|
{
|
2007-01-09 02:39:15 +00:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsproject.h>
|
|
|
|
%End
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
public:
|
2004-09-09 01:23:32 +00:00
|
|
|
|
|
|
|
/**
|
2016-02-14 03:50:23 +01:00
|
|
|
* @todo XXX Should have semantics for saving project if dirty as last gasp?
|
|
|
|
*/
|
2004-09-09 01:23:32 +00:00
|
|
|
~QgsProject();
|
|
|
|
|
|
|
|
/// access to canonical QgsProject instance
|
|
|
|
static QgsProject * instance();
|
|
|
|
|
|
|
|
/**
|
2016-02-14 03:50:23 +01:00
|
|
|
* Every project has an associated title string
|
|
|
|
*
|
|
|
|
* @deprecated Use setTitle instead.
|
2004-09-09 01:23:32 +00:00
|
|
|
*/
|
2004-10-21 17:27:38 +00:00
|
|
|
//@{
|
2016-02-14 03:50:23 +01:00
|
|
|
void title( const QString & title ) /Deprecated/;
|
2004-10-21 17:27:38 +00:00
|
|
|
|
2014-05-27 23:22:50 +02:00
|
|
|
/** Set project title
|
2016-02-14 03:50:23 +01:00
|
|
|
* @note added in 2.4
|
|
|
|
*/
|
2014-05-27 23:22:50 +02:00
|
|
|
void setTitle( const QString& title );
|
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Returns title */
|
2015-10-27 14:03:00 +11:00
|
|
|
QString title() const;
|
2004-10-21 17:27:38 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
2016-02-14 03:50:23 +01:00
|
|
|
* the dirty flag is true if the project has been modified since the last
|
|
|
|
* write()
|
2004-10-21 17:27:38 +00:00
|
|
|
*/
|
|
|
|
//@{
|
2008-08-23 09:19:49 +00:00
|
|
|
bool isDirty() const;
|
2004-10-21 17:27:38 +00:00
|
|
|
|
2014-05-27 23:22:50 +02:00
|
|
|
// ### QGIS 3: remove in favor of setDirty(...)
|
2006-03-09 22:50:13 +00:00
|
|
|
void dirty( bool b );
|
2014-05-27 23:22:50 +02:00
|
|
|
|
|
|
|
/** Set project as dirty (modified).
|
|
|
|
* @note added in 2.4 */
|
|
|
|
void setDirty( bool b );
|
2004-10-21 17:27:38 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2016-02-14 03:50:23 +01:00
|
|
|
* Every project has an associated file that contains its XML
|
2004-10-21 17:27:38 +00:00
|
|
|
*/
|
|
|
|
//@{
|
2008-08-23 19:55:27 +00:00
|
|
|
void setFileName( const QString & name );
|
2004-09-09 01:23:32 +00:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Returns file name */
|
2008-08-23 19:38:17 +00:00
|
|
|
QString fileName() const;
|
2004-10-21 17:27:38 +00:00
|
|
|
//@}
|
|
|
|
|
New framework for context based expressions
This commit adds the ability for expressions to be evaluated against
specific contexts. It replaces the previous behaviour where
expressions were evaluated against a specific feature and could
utilise fragile global "special columns".
Now, expressions are instead evaluated using a context designed for
each individual expression. This is done via QgsExpressionContext
and QgsExpressionContextScope objects.
A QgsExpressionContextScope encapsulates the variables and functions
relating to a specific context. For instance, scopes can be created
for "global" variables (such as QGIS version, platform, and user-set
variables specified within the QGIS options dialog. Think things
like user name, work department, etc), or for "project" variables
(eg project path, title, filename, and user-set variables set
through the project properties dialog. Project version, reference
number, that kind of thing). Many more scopes are planned, including
map layer scopes (variables for layer name, id, user-set variables
through the layer properties dialog), composer scopes, etc...
QgsExpressionContextScopes are 'stacked' into a QgsExpressionContext
object. Scopes added later to a QgsExpressionContext will override
any variables or functions provided by earlier scopes, so for
instance a user could override their global 'author' variable set
within QGIS options with a different 'author' set via the project
properties dialog.
The intended use is that a QgsExpressionContext is created before
a batch set of QgsExpression evaluations. Scopes are then added to
the context based on what makes sense for that particular
expression. Eg, almost all contexts will consist of the global
scope and project scope, and then additional scopes as required.
So a composer label would be evaluated against a context
consisting of the global scope, project scope, composition scope
and finally composer item scope. The batch set of expression
evaluations would then be performed using this context, after which
the context is discarded. In other words, a context is designed
for use for one specific set of expression evaluations only.
2015-08-07 15:29:51 +10:00
|
|
|
/** Returns QFileInfo object for the project's associated file.
|
|
|
|
* @note added in QGIS 2.9
|
|
|
|
*/
|
|
|
|
QFileInfo fileInfo() const;
|
|
|
|
|
2014-05-27 23:22:50 +02:00
|
|
|
/** Clear the project
|
|
|
|
* @note added in 2.4
|
|
|
|
*/
|
|
|
|
void clear();
|
|
|
|
|
2004-09-09 01:23:32 +00:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Read project file
|
2016-02-14 03:50:23 +01:00
|
|
|
*
|
|
|
|
* @note Any current plug-in state is erased
|
|
|
|
*
|
|
|
|
* @note dirty set to false after successful invocation
|
|
|
|
*
|
|
|
|
* @note file name argument implicitly sets file
|
|
|
|
*
|
|
|
|
* @note
|
|
|
|
*
|
|
|
|
* - Gets the extents
|
|
|
|
* - Creates maplayers
|
|
|
|
* - Registers maplayers
|
|
|
|
*
|
|
|
|
* @note it's presumed that the caller has already reset the map canvas, map registry, and legend
|
2004-09-09 01:23:32 +00:00
|
|
|
*/
|
|
|
|
//@{
|
2007-01-09 02:39:15 +00:00
|
|
|
bool read( const QFileInfo & file );
|
2013-05-11 21:30:42 +02:00
|
|
|
bool read();
|
2004-09-09 01:23:32 +00:00
|
|
|
//@}
|
|
|
|
|
2005-05-05 21:06:00 +00:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Read the layer described in the associated Dom node
|
2016-02-14 03:50:23 +01:00
|
|
|
*
|
|
|
|
* @param layerNode represents a QgsProject Dom node that maps to a specific layer.
|
|
|
|
*
|
|
|
|
* QgsProject raises an exception when one of the QgsProject::read()
|
|
|
|
* implementations fails. Since the read()s are invoked from qgisapp,
|
|
|
|
* then qgisapp handles the exception. It prompts the user for the new
|
|
|
|
* location of the data, if any. If there is a new location, the Dom
|
|
|
|
* node associated with the layer has its datasource tag corrected.
|
|
|
|
* Then that node is passed to this member function to be re-opened.
|
|
|
|
*
|
2005-05-05 21:06:00 +00:00
|
|
|
*/
|
|
|
|
bool read( QDomNode & layerNode );
|
|
|
|
|
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Write project file
|
2016-02-14 03:50:23 +01:00
|
|
|
*
|
|
|
|
* XXX How to best get read access to Qgis state? Actually we can finagle
|
|
|
|
* that by searching for qgisapp in object hiearchy.
|
|
|
|
*
|
|
|
|
* @note file name argument implicitly sets file
|
|
|
|
*
|
|
|
|
* @note dirty set to false after successful invocation
|
2004-09-09 01:23:32 +00:00
|
|
|
*/
|
|
|
|
//@{
|
2007-01-09 02:39:15 +00:00
|
|
|
bool write( const QFileInfo & file );
|
2013-05-11 21:30:42 +02:00
|
|
|
bool write();
|
2004-09-09 01:23:32 +00:00
|
|
|
//@}
|
|
|
|
|
2004-11-06 00:42:28 +00:00
|
|
|
/**
|
2016-02-14 03:50:23 +01:00
|
|
|
* removes all project properties
|
|
|
|
*
|
|
|
|
* ### QGIS 3: remove in favor of clear()
|
|
|
|
*/
|
2004-11-06 00:42:28 +00:00
|
|
|
void clearProperties();
|
|
|
|
|
2004-11-19 22:27:07 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/* key value mutators
|
2016-02-14 03:50:23 +01:00
|
|
|
*
|
|
|
|
* keys would be the familiar QSettings-like '/' delimited entries, implying
|
|
|
|
* a hierarchy of keys and corresponding values
|
|
|
|
*
|
|
|
|
* @note The key string must be valid xml tag names in order to be saved to the file.
|
|
|
|
*/
|
2004-11-19 22:27:07 +00:00
|
|
|
//@{
|
2014-01-27 09:22:24 +01:00
|
|
|
//! @note available in python bindings as writeEntryBool
|
2014-01-26 18:35:21 +01:00
|
|
|
bool writeEntry( const QString & scope, const QString & key, bool value ) /PyName=writeEntryBool/;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! @note available in python bindings as writeEntryDouble
|
2014-01-26 18:35:21 +01:00
|
|
|
bool writeEntry( const QString & scope, const QString & key, double value ) /PyName=writeEntryDouble/;
|
2012-09-24 02:28:15 +02:00
|
|
|
bool writeEntry( const QString & scope, const QString & key, int value );
|
2014-01-27 09:22:24 +01:00
|
|
|
bool writeEntry( const QString & scope, const QString & key, const QString & value );
|
2012-09-24 02:28:15 +02:00
|
|
|
bool writeEntry( const QString & scope, const QString & key, const QStringList & value );
|
2004-11-19 22:27:07 +00:00
|
|
|
//@}
|
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Key value accessors
|
2016-02-14 03:50:23 +01:00
|
|
|
*
|
|
|
|
* keys would be the familiar QSettings-like '/' delimited entries,
|
|
|
|
* implying a hierarchy of keys and corresponding values
|
|
|
|
*
|
|
|
|
*/
|
2004-11-19 22:27:07 +00:00
|
|
|
//@{
|
2015-10-07 11:55:34 +11:00
|
|
|
QStringList readListEntry( const QString & scope, const QString & key, const QStringList& def = QStringList(), bool *ok = 0 ) const;
|
2004-11-19 22:27:07 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
QString readEntry( const QString & scope, const QString & key, const QString & def = QString::null, bool * ok = 0 ) const;
|
|
|
|
int readNumEntry( const QString & scope, const QString & key, int def = 0, bool * ok = 0 ) const;
|
|
|
|
double readDoubleEntry( const QString & scope, const QString & key, double def = 0, bool * ok = 0 ) const;
|
|
|
|
bool readBoolEntry( const QString & scope, const QString & key, bool def = false, bool * ok = 0 ) const;
|
2004-11-19 22:27:07 +00:00
|
|
|
//@}
|
|
|
|
|
2005-01-19 22:03:09 +00:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Remove the given key */
|
2012-09-24 02:28:15 +02:00
|
|
|
bool removeEntry( const QString & scope, const QString & key );
|
2005-03-02 23:34:00 +00:00
|
|
|
|
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Return keys with values -- do not return keys that contain other keys
|
2016-02-14 03:50:23 +01:00
|
|
|
*
|
|
|
|
* @note equivalent to QSettings entryList()
|
|
|
|
*/
|
2012-09-24 02:28:15 +02:00
|
|
|
QStringList entryList( const QString & scope, const QString & key ) const;
|
2005-01-19 22:03:09 +00:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Return keys with keys -- do not return keys that contain only values
|
2016-02-14 03:50:23 +01:00
|
|
|
*
|
|
|
|
* @note equivalent to QSettings subkeyList()
|
|
|
|
*/
|
2012-09-24 02:28:15 +02:00
|
|
|
QStringList subkeyList( const QString & scope, const QString & key ) const;
|
2005-01-19 22:03:09 +00:00
|
|
|
|
2005-03-02 23:34:00 +00:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Dump out current project properties to stderr
|
2016-02-14 03:50:23 +01:00
|
|
|
*
|
|
|
|
* @todo XXX Now slightly broken since re-factoring. Won't print out top-level key
|
|
|
|
* and redundantly prints sub-keys.
|
|
|
|
*/
|
2005-03-02 23:34:00 +00:00
|
|
|
void dumpProperties() const;
|
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Prepare a filename to save it to the project file */
|
2015-10-07 11:55:34 +11:00
|
|
|
QString writePath( const QString& filename, const QString& relativeBasePath = QString::null ) const;
|
2009-09-05 19:49:10 +00:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Turn filename read from the project file to an absolute path */
|
2009-09-05 19:49:10 +00:00
|
|
|
QString readPath( QString filename ) const;
|
|
|
|
|
2014-11-21 01:17:21 +01:00
|
|
|
/** Return error message from previous read/write */
|
2009-12-07 14:22:37 +00:00
|
|
|
QString error() const;
|
|
|
|
|
2009-12-07 17:14:41 +00:00
|
|
|
/** Change handler for missing layers.
|
2016-02-14 03:50:23 +01:00
|
|
|
* Deletes old handler and takes ownership of the new one.
|
|
|
|
*/
|
2012-09-26 18:46:52 +02:00
|
|
|
void setBadLayerHandler( QgsProjectBadLayerHandler* handler /Transfer/ );
|
2009-12-07 17:14:41 +00:00
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
/** Returns project file path if layer is embedded from other project file. Returns empty string if layer is not embedded*/
|
2012-09-24 02:28:15 +02:00
|
|
|
QString layerIsEmbedded( const QString& id ) const;
|
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
/** Creates a maplayer instance defined in an arbitrary project file. Caller takes ownership
|
2016-02-14 03:50:23 +01:00
|
|
|
* @return the layer or 0 in case of error
|
|
|
|
* @note not available in Python bindings
|
2013-05-11 21:30:42 +02:00
|
|
|
*/
|
2012-09-24 02:28:15 +02:00
|
|
|
/*
|
|
|
|
bool createEmbeddedLayer( const QString& layerId, const QString& projectFilePath, QList<QDomNode>& brokenNodes,
|
|
|
|
QList< QPair< QgsVectorLayer*, QDomElement > >& vectorLayerList, bool saveFlag = true );
|
|
|
|
*/
|
2015-01-13 14:51:16 +01:00
|
|
|
|
2014-05-27 23:22:50 +02:00
|
|
|
/** Create layer group instance defined in an arbitrary project file.
|
|
|
|
* @note: added in version 2.4
|
|
|
|
*/
|
2015-01-13 14:51:16 +01:00
|
|
|
QgsLayerTreeGroup* createEmbeddedGroup( const QString& groupName, const QString& projectFilePath, const QStringList &invisibleLayers );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2014-11-21 01:17:21 +01:00
|
|
|
/** Convenience function to set snap settings per layer */
|
2012-09-24 02:28:15 +02:00
|
|
|
void setSnapSettingsForLayer( const QString& layerId, bool enabled, QgsSnapper::SnappingType type, QgsTolerance::UnitType unit, double tolerance,
|
|
|
|
bool avoidIntersection );
|
2012-06-19 14:10:15 +02:00
|
|
|
|
2014-11-21 01:17:21 +01:00
|
|
|
/** Convenience function to query snap settings of a layer */
|
2012-06-19 14:10:15 +02:00
|
|
|
bool snapSettingsForLayer( const QString& layerId, bool& enabled /Out/, QgsSnapper::SnappingType& type /Out/, QgsTolerance::UnitType& units /Out/, double& tolerance /Out/,
|
2012-09-24 02:28:15 +02:00
|
|
|
bool& avoidIntersection /Out/ ) const;
|
2012-06-19 14:10:15 +02:00
|
|
|
|
2014-11-21 01:17:21 +01:00
|
|
|
/** Convenience function to set topological editing */
|
2012-06-20 11:43:53 +02:00
|
|
|
void setTopologicalEditing( bool enabled );
|
2012-06-20 16:18:05 +02:00
|
|
|
|
2014-11-21 01:17:21 +01:00
|
|
|
/** Convenience function to query topological editing status */
|
2012-06-20 11:43:53 +02:00
|
|
|
bool topologicalEditing() const;
|
|
|
|
|
2016-02-14 21:04:41 +11:00
|
|
|
/** Convenience function to query default distance measurement units for project.
|
|
|
|
* @note added in QGIS 2.14
|
|
|
|
*/
|
|
|
|
QGis::UnitType distanceUnits() const;
|
|
|
|
|
2013-05-11 21:30:42 +02:00
|
|
|
/** Return project's home path
|
2014-11-21 01:17:21 +01:00
|
|
|
@return home path of project (or QString::null if not set) */
|
2013-05-11 21:30:42 +02:00
|
|
|
QString homePath() const;
|
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
QgsRelationManager* relationManager() const;
|
|
|
|
|
2014-05-27 23:22:50 +02:00
|
|
|
/** Return pointer to the root (invisible) node of the project's layer tree
|
|
|
|
* @note added in 2.4
|
|
|
|
*/
|
2014-06-03 15:56:53 +07:00
|
|
|
QgsLayerTreeGroup* layerTreeRoot() const;
|
2014-05-27 23:22:50 +02:00
|
|
|
|
|
|
|
/** Return pointer to the helper class that synchronizes map layer registry with layer tree
|
2014-06-03 15:56:53 +07:00
|
|
|
* @note added in 2.4
|
2014-05-27 23:22:50 +02:00
|
|
|
*/
|
2014-06-03 15:56:53 +07:00
|
|
|
QgsLayerTreeRegistryBridge* layerTreeRegistryBridge() const;
|
2014-05-27 23:22:50 +02:00
|
|
|
|
2015-08-19 19:04:53 +10:00
|
|
|
/** Returns pointer to the project's visibility preset collection.
|
|
|
|
* @note added in QGIS 2.12
|
|
|
|
*/
|
|
|
|
QgsVisibilityPresetCollection* visibilityPresetCollection();
|
|
|
|
|
2009-12-07 14:22:37 +00:00
|
|
|
protected:
|
|
|
|
|
2016-01-04 22:51:18 +11:00
|
|
|
/** Set error message from read/write operation
|
|
|
|
* @note not available in Python bindings
|
2016-02-14 03:50:23 +01:00
|
|
|
*/
|
2016-01-04 22:51:18 +11:00
|
|
|
//void setError( const QString& errorMessage );
|
2009-12-07 14:22:37 +00:00
|
|
|
|
2016-01-04 22:51:18 +11:00
|
|
|
/** Clear error message
|
|
|
|
* @note not available in Python bindings
|
2016-02-14 03:50:23 +01:00
|
|
|
*/
|
2016-01-04 22:51:18 +11:00
|
|
|
//void clearError();
|
2009-12-07 14:22:37 +00:00
|
|
|
|
2016-01-04 22:51:18 +11:00
|
|
|
//! Creates layer and adds it to maplayer registry
|
2014-01-27 09:22:24 +01:00
|
|
|
//! @note not available in python bindings
|
2012-09-24 02:28:15 +02:00
|
|
|
// bool addLayer( const QDomElement& layerElem, QList<QDomNode>& brokenNodes, QList< QPair< QgsVectorLayer*, QDomElement > >& vectorLayerList );
|
|
|
|
|
2014-05-27 23:22:50 +02:00
|
|
|
//! @note not available in python bindings
|
|
|
|
// void initializeEmbeddedSubtree( const QString& projectFilePath, QgsLayerTreeGroup* group );
|
|
|
|
|
|
|
|
//! @note not available in python bindings
|
|
|
|
// void loadEmbeddedNodes( QgsLayerTreeGroup* group );
|
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
signals:
|
|
|
|
//! emitted when project is being read
|
2012-09-24 02:28:15 +02:00
|
|
|
void readProject( const QDomDocument & );
|
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
//! emitted when project is being written
|
2012-09-24 02:28:15 +02:00
|
|
|
void writeProject( QDomDocument & );
|
|
|
|
|
2013-04-28 10:53:34 +02:00
|
|
|
/**
|
2013-05-11 21:30:42 +02:00
|
|
|
* Emitted, after the basic initialisation of a layer from the project
|
2013-04-28 10:53:34 +02:00
|
|
|
* file is done. You can use this signal to read additional information
|
|
|
|
* from the project file.
|
|
|
|
*
|
|
|
|
* @param mapLayer The map layer which is being initialized
|
|
|
|
* @param layerNode The layer node from the project file
|
|
|
|
*/
|
2013-05-11 21:30:42 +02:00
|
|
|
void readMapLayer( QgsMapLayer *mapLayer, const QDomElement &layerNode );
|
2013-04-28 10:53:34 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Emitted, when a layer is being saved. You can use this method to save
|
|
|
|
* additional information to the layer.
|
|
|
|
*
|
|
|
|
* @param mapLayer The map layer which is being initialized
|
2013-05-11 21:30:42 +02:00
|
|
|
* @param layerElem The layer element from the project file
|
2013-04-28 10:53:34 +02:00
|
|
|
* @param doc The document
|
|
|
|
*/
|
2013-05-11 21:30:42 +02:00
|
|
|
void writeMapLayer( QgsMapLayer *mapLayer, QDomElement &layerElem, QDomDocument &doc );
|
|
|
|
|
|
|
|
//! emitted when the project file has been written and closed
|
|
|
|
void projectSaved();
|
2013-04-28 10:53:34 +02:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
//! emitted when an old project file is read.
|
2015-10-26 22:46:25 +11:00
|
|
|
void oldProjectVersionWarning( const QString& );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
//! emitted when a layer from a projects was read
|
|
|
|
// @param i current layer
|
|
|
|
// @param n number of layers
|
|
|
|
void layerLoaded( int i, int n );
|
2005-03-02 23:34:00 +00:00
|
|
|
|
2015-10-26 22:46:25 +11:00
|
|
|
void loadingLayer( const QString& );
|
2013-05-11 21:30:42 +02:00
|
|
|
|
2012-06-20 11:43:53 +02:00
|
|
|
void snapSettingsChanged();
|
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
private:
|
2004-09-09 01:23:32 +00:00
|
|
|
|
|
|
|
QgsProject(); // private 'cause it's a singleton
|
|
|
|
|
|
|
|
}; // QgsProject
|
|
|
|
|
2009-12-07 17:14:41 +00:00
|
|
|
|
2014-11-21 01:17:21 +01:00
|
|
|
/** Interface for classes that handle missing layer files when reading project file. */
|
2009-12-07 17:14:41 +00:00
|
|
|
class QgsProjectBadLayerHandler
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsproject.h>
|
|
|
|
%End
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
public:
|
2015-10-26 22:46:14 +11:00
|
|
|
virtual void handleBadLayers( const QList<QDomNode>& layers, const QDomDocument& projectDom ) = 0;
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual ~QgsProjectBadLayerHandler();
|
2009-12-07 17:14:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-11-21 01:17:21 +01:00
|
|
|
/** Default bad layer handler which ignores any missing layers. */
|
2009-12-07 17:14:41 +00:00
|
|
|
class QgsProjectBadLayerDefaultHandler : QgsProjectBadLayerHandler
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsproject.h>
|
|
|
|
%End
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
public:
|
2015-10-26 22:46:14 +11:00
|
|
|
virtual void handleBadLayers( const QList<QDomNode>& layers, const QDomDocument& projectDom );
|
2009-12-07 17:14:41 +00:00
|
|
|
|
|
|
|
};
|