QGIS API Documentation 3.41.0-Master (3440c17df1d)
|
An Abstract Base Class for QGIS project property hierarchys. More...
#include <qgsprojectproperty.h>
Public Member Functions | |
QgsProjectProperty () | |
virtual | ~QgsProjectProperty ()=default |
virtual void | dump (int tabs=0) const =0 |
Dumps out the keys and values. | |
virtual bool | isKey () const =0 |
Returns true if the property is a QgsProjectPropertyKey. | |
virtual bool | isLeaf () const =0 |
Returns true if property is a leaf node. | |
virtual bool | isValue () const =0 |
Returns true if the property is a QgsProjectPropertyValue. | |
virtual bool | readXml (const QDomNode &keyNode)=0 |
Restores the property hierarchy from a specified DOM node. | |
virtual QVariant | value () const =0 |
Returns the node's value. | |
virtual bool | writeXml (const QString &nodeName, QDomElement &element, QDomDocument &document)=0 |
Writes the property hierarchy to a specified DOM element. | |
An Abstract Base Class for QGIS project property hierarchys.
Each sub-class is either a QgsProjectPropertyKey or QgsProjectPropertyValue. QgsProjectPropertyKey can contain either QgsProjectPropertyKey or QgsProjectPropertyValues, thus describing an hierarchy. QgsProjectPropertyValues are always graph leaves.
Definition at line 49 of file qgsprojectproperty.h.
QgsProjectProperty::QgsProjectProperty | ( | ) |
Definition at line 26 of file qgsprojectproperty.cpp.
|
virtualdefault |
|
pure virtual |
Dumps out the keys and values.
tabs | is number of tabs to print; used for pretty-printing hierarchy |
Implemented in QgsProjectPropertyValue, and QgsProjectPropertyKey.
|
pure virtual |
Returns true
if the property is a QgsProjectPropertyKey.
Implemented in QgsProjectPropertyValue, and QgsProjectPropertyKey.
|
pure virtual |
Returns true
if property is a leaf node.
A leaf node is a key node that has either no value or only a single value. A non-leaf node would be a key node with key sub-nodes.
This is used for entryList() and subkeyList() implementation.
Implemented in QgsProjectPropertyValue, and QgsProjectPropertyKey.
|
pure virtual |
Returns true
if the property is a QgsProjectPropertyValue.
Implemented in QgsProjectPropertyValue, and QgsProjectPropertyKey.
|
pure virtual |
Restores the property hierarchy from a specified DOM node.
Used for restoring properties from project file
Implemented in QgsProjectPropertyValue, and QgsProjectPropertyKey.
|
pure virtual |
Returns the node's value.
For QgsProjectPropertyValue nodes, this is straightforward – just return the embedded QVariant, _value. For QgsProjectPropertyKey, this means returning the QgsProjectPropertyValue _value that is keyed by its name, if it exists; i.e., QgsProjectPropertyKey "foo" will return the property value mapped to its name, "foo", in its QHash of QProperties.
Implemented in QgsProjectPropertyValue, and QgsProjectPropertyKey.
|
pure virtual |
Writes the property hierarchy to a specified DOM element.
Used for saving properties to project file.
nodeName | the tag name associated with this element |
element | the parent (or encompassing) property element |
document | the overall project file Dom document |
Implemented in QgsProjectPropertyValue, and QgsProjectPropertyKey.