QGIS API Documentation  2.2.0-Valmiera
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
QgsPropertyValue Class Reference

QgsPropertyValue node. More...

#include <qgsprojectproperty.h>

Inheritance diagram for QgsPropertyValue:
Inheritance graph
[legend]
Collaboration diagram for QgsPropertyValue:
Collaboration graph
[legend]

Public Member Functions

 QgsPropertyValue ()
 QgsPropertyValue (const QVariant &value)
virtual ~QgsPropertyValue ()
virtual bool isKey () const
 returns true if is a QgsPropertyKey
virtual bool isValue () const
 returns true if is a QgsPropertyValue
QVariant value () const
 return the node's value
bool isLeaf () const
 returns true if is a leaf node
void dump (int tabs=0) const
 dumps out the keys and values
bool readXML (QDomNode &keyNode)
 restores property hierarchy to given Dom node
bool writeXML (const QString &nodeName, QDomElement &element, QDomDocument &document)
 keyElement created by parent QgsPropertyKey
int count () const
void entryList (QStringList &keyName, QStringList &entries) const
 return keys that do not contain other keys
- Public Member Functions inherited from QgsProperty
 QgsProperty ()
virtual ~QgsProperty ()

Private Attributes

QVariant value_
 We use QVariant as it's very handy to keep multiple types and provides type conversions.

Detailed Description

QgsPropertyValue node.

Contains a QgsPropertyKey's value

Definition at line 119 of file qgsprojectproperty.h.

Constructor & Destructor Documentation

QgsPropertyValue::QgsPropertyValue ( )
inline

Definition at line 122 of file qgsprojectproperty.h.

QgsPropertyValue::QgsPropertyValue ( const QVariant &  value)
inline

Definition at line 124 of file qgsprojectproperty.h.

virtual QgsPropertyValue::~QgsPropertyValue ( )
inlinevirtual

Definition at line 128 of file qgsprojectproperty.h.

Member Function Documentation

int QgsPropertyValue::count ( ) const
inline

Definition at line 153 of file qgsprojectproperty.h.

void QgsPropertyValue::dump ( int  tabs = 0) const
virtual

dumps out the keys and values

Parameters
tabsis number of tabs to print; used for pretty-printing hierarchy

Implements QgsProperty.

Definition at line 24 of file qgsprojectproperty.cpp.

References QgsDebugMsg, and value_.

Referenced by QgsPropertyKey::dump().

void QgsPropertyValue::entryList ( QStringList &  keyName,
QStringList &  entries 
) const
inline

return keys that do not contain other keys

Since QgsPropertyValue isn't a key, don't do anything.

Definition at line 159 of file qgsprojectproperty.h.

virtual bool QgsPropertyValue::isKey ( ) const
inlinevirtual

returns true if is a QgsPropertyKey

Implements QgsProperty.

Definition at line 131 of file qgsprojectproperty.h.

bool QgsPropertyValue::isLeaf ( ) const
inlinevirtual

returns true if is a leaf node

Note
I suppose, in a way, value nodes can also be qualified as leaf nodes even though we're only counting key nodes.

Implements QgsProperty.

Definition at line 143 of file qgsprojectproperty.h.

virtual bool QgsPropertyValue::isValue ( ) const
inlinevirtual

returns true if is a QgsPropertyValue

Implements QgsProperty.

Definition at line 134 of file qgsprojectproperty.h.

bool QgsPropertyValue::readXML ( QDomNode &  keyNode)
virtual

restores property hierarchy to given Dom node

Used for restoring properties from project file

Implements QgsProperty.

Definition at line 45 of file qgsprojectproperty.cpp.

References QgsDebugMsg, and value_.

QVariant QgsPropertyValue::value ( ) const
inlinevirtual

return the node's value

For QgsPropertyValue nodes, this is straightforward – just return the embedded QVariant, _value. For QgsPropertyKey, this means returning the QgsPropertyValue _value that is keyed by its name, if it exists; i.e., QgsPropertyKey "foo" will return the property value mapped to its name, "foo", in its QHash of QProperties.

Implements QgsProperty.

Definition at line 136 of file qgsprojectproperty.h.

Referenced by QgsPropertyKey::dump().

bool QgsPropertyValue::writeXML ( const QString &  nodeName,
QDomElement &  element,
QDomDocument &  document 
)
virtual

keyElement created by parent QgsPropertyKey

Implements QgsProperty.

Definition at line 226 of file qgsprojectproperty.cpp.

References value_.

Referenced by QgsProjectFileTransform::transform1100to1200().

Member Data Documentation

QVariant QgsPropertyValue::value_
private

We use QVariant as it's very handy to keep multiple types and provides type conversions.

Definition at line 167 of file qgsprojectproperty.h.

Referenced by dump(), readXML(), and writeXML().


The documentation for this class was generated from the following files: