44 #include "TreeItem.hh" 48 TreeItem::TreeItem(
int _id, QString _name,
DataType _type,
TreeItem* _parent) :
73 return ( (dataType_ & _type) );
103 bool TreeItem::isGroup() {
150 while ( parentPointer ) {
153 if ( parentPointer->
childCount() > ( thisPointer->
row() + 1) ) {
158 thisPointer = parentPointer;
177 while ( current->
parent() != 0 ) {
179 current = current->
parent();
234 if ( id_ == _objectId )
252 if (
name() == _name )
270 QList<TreeItem*>::iterator i;
279 std::cerr <<
"TreeItem: Illegal remove request" << std::endl;
290 QList< TreeItem* > items;
298 items.push_back(
this);
int row() const
get the row of this item from the parent
void removeChild(TreeItem *_item)
Remove a child from this object.
void appendChild(TreeItem *child)
add a child to this node
void setParent(TreeItem *_parent)
Set the parent pointer.
TreeItem * parentItem_
Parent item or 0 if root node.
int childCount() const
get the number of children
QList< TreeItem * > childItems_
Children of this node.
TreeItem * childExists(int _objectId)
Check if the element exists in the subtree of this element.
TreeItem * parent()
Get the parent item ( 0 if root item )
const DataType DATA_GROUP(1)
Items used for Grouping.
TreeItem * child(int row)
return a child
DataType dataType()
dataType
QList< TreeItem *> getLeafs()
get all leafes of the tree below this object ( These will be all visible objects ) ...
const DataType DATA_ALL(UINT_MAX)
Identifier for all available objects.
void deleteSubtree()
delete the whole subtree below this item ( The item itself is not touched )