Quantum GIS API Documentation
1.7.5-Wroclaw
|
QgsPropertyKey node. More...
#include <qgsprojectproperty.h>
Public Member Functions | |
QgsPropertyKey (QString const name="") | |
virtual | ~QgsPropertyKey () |
QVariant | value () const |
if this key has a value, it will be stored by its name in its properties More... | |
QgsPropertyKey * | addKey (QString const &keyName) |
add the given property key More... | |
void | removeKey (QString const &keyName) |
remove the given key More... | |
QgsPropertyValue * | setValue (QString const &name, QVariant const &value) |
set the value associated with this key More... | |
QgsPropertyValue * | setValue (QVariant const &value) |
set the value associated with this key More... | |
void | dump (size_t tabs=0) const |
dumps out the keys and values More... | |
bool | readXML (QDomNode &keyNode) |
restores property hierarchy to given Dom node More... | |
bool | writeXML (QString const &nodeName, QDomElement &element, QDomDocument &document) |
Property keys will always create a Dom element for itself and then recursively call writeXML for any constituent properties. More... | |
size_t | count () const |
how many elements are contained within this one? More... | |
bool | isEmpty () const |
Does this property not have any subkeys or values? More... | |
virtual bool | isKey () const |
returns true if is a QgsPropertyKey More... | |
virtual bool | isValue () const |
returns true if is a QgsPropertyValue More... | |
void | entryList (QStringList &entries) const |
return keys that do not contain other keys More... | |
void | subkeyList (QStringList &entries) const |
return keys that contain other keys More... | |
bool | isLeaf () const |
returns true if a leaf node More... | |
virtual void | clear () |
reset the QgsProperty key to prestine state More... | |
virtual void | clearKeys () |
delete any sub-nodes More... | |
QgsProperty * | find (QString &propertyName) |
QString const & | name () const |
every key has a name More... | |
QString & | name () |
![]() | |
QgsProperty () | |
virtual | ~QgsProperty () |
Private Attributes | |
QString | mName |
every key has a name More... | |
QHash< QString, QgsProperty * > | mProperties |
sub-keys More... | |
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 199 of file qgsprojectproperty.h.
QgsPropertyKey::QgsPropertyKey | ( | QString const | name = "" ) |
Definition at line 273 of file qgsprojectproperty.cpp.
|
virtual |
Definition at line 277 of file qgsprojectproperty.cpp.
References clearKeys().
|
inline |
add the given property key
Definition at line 224 of file qgsprojectproperty.h.
Referenced by _getProperties(), addKey_(), and readXML().
|
inlinevirtual |
reset the QgsProperty key to prestine state
Definition at line 300 of file qgsprojectproperty.h.
|
inlinevirtual |
delete any sub-nodes
Definition at line 307 of file qgsprojectproperty.h.
Referenced by QgsProject::Imp::clear(), and ~QgsPropertyKey().
|
inline |
how many elements are contained within this one?
Definition at line 271 of file qgsprojectproperty.h.
Referenced by isLeaf().
|
virtual |
dumps out the keys and values
tabs | is number of tabs to print; used for pretty-printing hierarchy |
Implements QgsProperty.
Definition at line 296 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 431 of file qgsprojectproperty.cpp.
References mProperties.
Referenced by QgsProject::entryList().
|
inline |
Definition at line 313 of file qgsprojectproperty.h.
References QgsProperty::value().
Referenced by _getProperties(), addKey_(), findKey_(), and removeKey_().
|
inline |
Does this property not have any subkeys or values?
Definition at line 275 of file qgsprojectproperty.h.
|
inlinevirtual |
returns true if is a QgsPropertyKey
Implements QgsProperty.
Definition at line 279 of file qgsprojectproperty.h.
|
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 462 of file qgsprojectproperty.cpp.
References count(), and mProperties.
|
inlinevirtual |
returns true if is a QgsPropertyValue
Implements QgsProperty.
Definition at line 283 of file qgsprojectproperty.h.
|
inline |
every key has a name
Definition at line 209 of file qgsprojectproperty.h.
Referenced by addKey_(), dump(), findKey_(), QgsProject::Imp::Imp(), removeKey_(), and value().
|
inline |
Definition at line 212 of file qgsprojectproperty.h.
|
virtual |
restores property hierarchy to given Dom node
Used for restoring properties from project file
Implements QgsProperty.
Definition at line 354 of file qgsprojectproperty.cpp.
References addKey(), mProperties, and QgsDebugMsg.
Referenced by _getProperties().
|
inline |
remove the given key
Definition at line 234 of file qgsprojectproperty.h.
Referenced by removeKey_().
|
inline |
set the value associated with this key
name | is the key name |
value | is the value to set |
Definition at line 244 of file qgsprojectproperty.h.
Referenced by addKey_().
|
inline |
set the value associated with this key
Definition at line 257 of file qgsprojectproperty.h.
void QgsPropertyKey::subkeyList | ( | QStringList & | entries) | const |
return keys that contain other keys
Definition at line 447 of file qgsprojectproperty.cpp.
References mProperties.
Referenced by QgsProject::subkeyList().
|
virtual |
if this key has a value, it will be stored by its name in its properties
Implements QgsProperty.
Definition at line 282 of file qgsprojectproperty.cpp.
References mProperties, name(), QgsDebugMsg, and QgsProperty::value().
|
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 402 of file qgsprojectproperty.cpp.
References mProperties.
|
private |
every key has a name
Definition at line 321 of file qgsprojectproperty.h.
|
private |
sub-keys
Definition at line 324 of file qgsprojectproperty.h.
Referenced by dump(), entryList(), isLeaf(), readXML(), subkeyList(), value(), and writeXML().