GCF::ObjectTreeNode Class Reference
Represents a node in GCF::ObjectTree. More...
#include <GCF3/ObjectTree>
Public Member Functions | |
| ObjectTreeNode (ObjectTreeNode *parent, const QString &name, QObject *object, const QVariantMap &info=QVariantMap()) | |
| virtual | ~ObjectTreeNode () |
| QString | name () const |
| QObject * | object () const |
| const QVariantMap & | info () const |
| QVariantMap & | writableInfo () |
| ObjectTreeNode * | parent () const |
| QList< ObjectTreeNode * > | children () const |
| ObjectTree * | owningTree () const |
| ObjectTreeNode * | node (const QString &path) const |
| ObjectTreeNode * | node (QObject *object) const |
| QObject * | object (const QString &path) const |
| QString | path () const |
Detailed Description
This class represents a single node in GCF::ObjectTree.
A node is characterized by the following fields
name- name of the node. [No two nodes can have the same name within the same hierarchy, although this rule is not enforced]path- a dot (.) separated list of names that uniquely identiies a node in the treeobject- pointer to aQObjectthat the node is managing. The pointer will be NULL if the object got deleted after the node was constructed, or if no object was specified during the construction of the node. [No two nodes in the entire tree must point to the same object, although this rule is not enforced.]info- aQVariantMapof key=value pairs.
- See Also
- GCF::ObjectTree
Constructor & Destructor Documentation
| GCF::ObjectTreeNode::ObjectTreeNode | ( | GCF::ObjectTreeNode * | parent, |
| const QString & | name, | ||
| QObject * | object, | ||
| const QVariantMap & | info = QVariantMap() |
||
| ) |
Constructor
- Parameters
-
parent pointer to the parent node underwhich this new node should be created. name name of the node [the name must be unique within a parent] object pointer to a QObjectthat this node references [a valid pointer must always be specified]info a QVariantMapof key=value pairs
|
virtual |
Destructor deletes all children nodes under this node.
Member Function Documentation
| QString GCF::ObjectTreeNode::name | ( | ) | const |
- Returns
- name of this node
| QObject * GCF::ObjectTreeNode::object | ( | ) | const |
- Returns
- pointer to the
QObjectreferenced by this node
| const QVariantMap & GCF::ObjectTreeNode::info | ( | ) | const |
- Returns
- const reference to the
QVariantMapinformation table associated with this node
| QVariantMap & GCF::ObjectTreeNode::writableInfo | ( | ) |
- Returns
- reference to the
QVariantMapinformation table associated with this node
| GCF::ObjectTreeNode * GCF::ObjectTreeNode::parent | ( | ) | const |
- Returns
- pointer to the parent of this node
| QList< GCF::ObjectTreeNode * > GCF::ObjectTreeNode::children | ( | ) | const |
- Returns
- list of children nodes
| GCF::ObjectTree * GCF::ObjectTreeNode::owningTree | ( | ) | const |
- Returns
- pointer to the object tree that owns this node
| GCF::ObjectTreeNode * GCF::ObjectTreeNode::node | ( | const QString & | path | ) | const |
- Parameters
-
path path of the node that is being searched
- Returns
- a pointer to the node at
pathOR null if no such node exists
- Note
- This function is similar to GCF::ObjectTree::node(QString), but it only searches the sub-tree under this node.
| GCF::ObjectTreeNode * GCF::ObjectTreeNode::node | ( | QObject * | object | ) | const |
- Parameters
-
object pointer to an object that is referenced by any of the nodes in this tree
- Returns
- a pointer to the node at that references object OR null if no such node exists
- Note
- This function is similar to GCF::ObjectTree::node(QObject*), but it only searches the sub-tree under this node.
| QObject * GCF::ObjectTreeNode::object | ( | const QString & | path | ) | const |
- Parameters
-
path path of the node that is being searched
- Returns
- pointer to the
QObjectreferenced by the node that was searched OR null if no such node exists.
Same as node(path)->object()
| QString GCF::ObjectTreeNode::path | ( | ) | const |
- Returns
- path of this node

