|
Quantum GIS API Documentation
master-ce49b66
|
QgsPropertyKey node. More...
#include <qgsprojectproperty.h>
Inheritance diagram for QgsPropertyKey:
Collaboration diagram for QgsPropertyKey:Public Member Functions | |
| QgsPropertyKey (const QString name="") | |
| virtual | ~QgsPropertyKey () |
| QgsPropertyKey * | addKey (const QString &keyName) |
| add the given property key | |
| virtual void | clear () |
| reset the QgsProperty key to prestine state | |
| virtual void | clearKeys () |
| delete any sub-nodes | |
| size_t | count () const |
| how many elements are contained within this one? | |
| void | dump (size_t tabs=0) const |
| dumps out the keys and values | |
| void | entryList (QStringList &entries) const |
| return keys that do not contain other keys | |
| QgsProperty * | find (QString &propertyName) |
| bool | isEmpty () const |
| Does this property not have any subkeys or values? | |
| virtual bool | isKey () const |
| returns true if is a QgsPropertyKey | |
| bool | isLeaf () const |
| returns true if a leaf node | |
| virtual bool | isValue () const |
| returns true if is a QgsPropertyValue | |
| bool | readXML (QDomNode &keyNode) |
| restores property hierarchy to given Dom node | |
| void | removeKey (const QString &keyName) |
| remove the given key | |
| QgsPropertyValue * | setValue (const QString &name, const QVariant &value) |
| set the value associated with this key | |
| QgsPropertyValue * | setValue (const QVariant &value) |
| set the value associated with this key | |
| void | subkeyList (QStringList &entries) const |
| return keys that contain other keys | |
| QVariant | value () const |
| if this key has a value, it will be stored by its name in its properties | |
| bool | writeXML (const QString &nodeName, QDomElement &element, QDomDocument &document) |
| Property keys will always create a Dom element for itself and then recursively call writeXML for any constituent properties. | |
| const QString & | name () const |
| every key has a name | |
| QString & | name () |
Private Attributes | |
| QString | mName |
| every key has a name | |
| QHash< QString, QgsProperty * > | mProperties |
| sub-keys | |
QgsPropertyKey node.
Can, itself, contain QgsPropertyKeys and QgsPropertyValues.
The internal QHash, mProperties, maps key names to their respective QgsPropertyValue or next QgsPropertyKey in the key name sequence. The key with the current name should contain its QgsPropertyValue.
E.g., given the key sequence "/foo/bar", "foo" will have a corresponding QgsPropertyKey with a name "foo". It will contain an element in its mProperties that maps to "bar", which is another QgsPropertyKey. The "bar" QgsPropertyKey will, in turn, have an element that maps to itself, i.e. "bar", that will contain a QgsPropertyValue.
Definition at line 198 of file qgsprojectproperty.h.
| QgsPropertyKey::QgsPropertyKey | ( | const QString | name = "" | ) |
Definition at line 270 of file qgsprojectproperty.cpp.
| QgsPropertyKey::~QgsPropertyKey | ( | ) | [virtual] |
Definition at line 274 of file qgsprojectproperty.cpp.
References clearKeys().
| QgsPropertyKey* QgsPropertyKey::addKey | ( | const QString & | keyName | ) | [inline] |
add the given property key
Definition at line 221 of file qgsprojectproperty.h.
Referenced by _getProperties(), addKey_(), and readXML().
| virtual void QgsPropertyKey::clear | ( | ) | [inline, virtual] |
reset the QgsProperty key to prestine state
Definition at line 297 of file qgsprojectproperty.h.
| virtual void QgsPropertyKey::clearKeys | ( | ) | [inline, virtual] |
delete any sub-nodes
Definition at line 304 of file qgsprojectproperty.h.
Referenced by QgsProject::Imp::clear(), and ~QgsPropertyKey().
| size_t QgsPropertyKey::count | ( | ) | const [inline] |
how many elements are contained within this one?
Definition at line 268 of file qgsprojectproperty.h.
Referenced by isLeaf().
| void QgsPropertyKey::dump | ( | size_t | tabs = 0 | ) | const [virtual] |
dumps out the keys and values
| tabs | is number of tabs to print; used for pretty-printing hierarchy |
Implements QgsProperty.
Definition at line 293 of file qgsprojectproperty.cpp.
References QgsPropertyValue::dump(), mProperties, name(), QgsDebugMsg, and QgsPropertyValue::value().
Referenced by dump_().
| void QgsPropertyKey::entryList | ( | QStringList & | entries | ) | const |
return keys that do not contain other keys
Definition at line 428 of file qgsprojectproperty.cpp.
References mProperties.
Referenced by QgsProject::entryList().
| QgsProperty* QgsPropertyKey::find | ( | QString & | propertyName | ) | [inline] |
Definition at line 310 of file qgsprojectproperty.h.
References QgsProperty::value().
Referenced by _getProperties(), addKey_(), findKey_(), and removeKey_().
| bool QgsPropertyKey::isEmpty | ( | ) | const [inline] |
Does this property not have any subkeys or values?
Definition at line 272 of file qgsprojectproperty.h.
| virtual bool QgsPropertyKey::isKey | ( | ) | const [inline, virtual] |
returns true if is a QgsPropertyKey
Implements QgsProperty.
Definition at line 276 of file qgsprojectproperty.h.
| bool QgsPropertyKey::isLeaf | ( | ) | const [virtual] |
returns true if a leaf node
A leaf node is a key node that has either no value or a single value. A non-leaf node would be a key node with key sub-nodes.
Implements QgsProperty.
Definition at line 459 of file qgsprojectproperty.cpp.
References count(), and mProperties.
| virtual bool QgsPropertyKey::isValue | ( | ) | const [inline, virtual] |
returns true if is a QgsPropertyValue
Implements QgsProperty.
Definition at line 280 of file qgsprojectproperty.h.
| const QString& QgsPropertyKey::name | ( | ) | const [inline] |
every key has a name
Definition at line 206 of file qgsprojectproperty.h.
Referenced by addKey_(), dump(), findKey_(), QgsProject::Imp::Imp(), removeKey_(), and value().
| QString& QgsPropertyKey::name | ( | ) | [inline] |
Definition at line 209 of file qgsprojectproperty.h.
| bool QgsPropertyKey::readXML | ( | QDomNode & | keyNode | ) | [virtual] |
restores property hierarchy to given Dom node
Used for restoring properties from project file
Implements QgsProperty.
Definition at line 351 of file qgsprojectproperty.cpp.
References addKey(), mProperties, and QgsDebugMsg.
Referenced by _getProperties().
| void QgsPropertyKey::removeKey | ( | const QString & | keyName | ) | [inline] |
remove the given key
Definition at line 231 of file qgsprojectproperty.h.
Referenced by removeKey_().
| QgsPropertyValue* QgsPropertyKey::setValue | ( | const QString & | name, |
| const QVariant & | value | ||
| ) | [inline] |
set the value associated with this key
| name | is the key name |
| value | is the value to set |
Definition at line 241 of file qgsprojectproperty.h.
Referenced by addKey_().
| QgsPropertyValue* QgsPropertyKey::setValue | ( | const QVariant & | value | ) | [inline] |
set the value associated with this key
Definition at line 254 of file qgsprojectproperty.h.
| void QgsPropertyKey::subkeyList | ( | QStringList & | entries | ) | const |
return keys that contain other keys
Definition at line 444 of file qgsprojectproperty.cpp.
References mProperties.
Referenced by QgsProject::subkeyList().
| QVariant QgsPropertyKey::value | ( | ) | const [virtual] |
if this key has a value, it will be stored by its name in its properties
Implements QgsProperty.
Definition at line 279 of file qgsprojectproperty.cpp.
References mProperties, name(), QgsDebugMsg, and QgsProperty::value().
| bool QgsPropertyKey::writeXML | ( | const QString & | nodeName, |
| QDomElement & | element, | ||
| QDomDocument & | document | ||
| ) | [virtual] |
Property keys will always create a Dom element for itself and then recursively call writeXML for any constituent properties.
Implements QgsProperty.
Definition at line 399 of file qgsprojectproperty.cpp.
References mProperties.
QString QgsPropertyKey::mName [private] |
every key has a name
Definition at line 318 of file qgsprojectproperty.h.
QHash< QString, QgsProperty* > QgsPropertyKey::mProperties [private] |
sub-keys
Definition at line 321 of file qgsprojectproperty.h.
Referenced by dump(), entryList(), isLeaf(), readXML(), subkeyList(), value(), and writeXML().