50 #include "TreeItem.hh"
54 TreeItem::TreeItem(
int _id, QString _name,
DataType _type,
TreeItem* _parent) :
79 return ( (dataType_ & _type) );
104 return (
parent()->
id() );
109 bool TreeItem::isGroup() {
156 while ( parentPointer ) {
159 if ( parentPointer->
childCount() > ( thisPointer->
row() + 1) ) {
164 thisPointer = parentPointer;
183 while ( current->
parent() != 0 ) {
185 current = current->
parent();
240 if ( id_ == _objectId )
258 if (
name() == _name )
276 QList<TreeItem*>::iterator i;
285 std::cerr <<
"TreeItem: Illegal remove request" << std::endl;
296 QList< TreeItem* > items;
304 items.push_back(
this);
int row() const
get the row of this item from the parent
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_GROUP(1)
Items used for Grouping.
void removeChild(TreeItem *_item)
Remove a child from this object.
TreeItem * parentItem_
Parent item or 0 if root node.
int childCount() const
get the number of children
void setParent(TreeItem *_parent)
Set the parent pointer.
QList< TreeItem * > childItems_
Children of this node.
TreeItem * parent()
Get the parent item ( 0 if root item )
const DataType DATA_ALL(UINT_MAX)
Identifier for all available objects.
TreeItem * childExists(int _objectId)
Check if the element exists in the subtree of this element.
void appendChild(TreeItem *child)
add a child to this node
void deleteSubtree()
delete the whole subtree below this item ( The item itself is not touched )