12 TreeNode(const QString
&name
) : _name(name
) {}
14 const QString
&name() const {return _name
;}
15 const QList
<TreeNode
<T
> > &childs() const {return _childs
;}
16 const QList
<T
> &items() const {return _items
;}
18 void addItem(T node
) {_items
.append(node
);}
19 void addChild(const TreeNode
<T
> &child
) {_childs
.append(child
);}
21 bool isEmpty() const {return _childs
.isEmpty() && _items
.isEmpty();}
22 void clear() {clear(*this);}
25 void clear(TreeNode
<T
> &node
)
27 for (int i
= 0; i
< node
._childs
.size(); i
++)
28 clear(node
._childs
[i
]);
33 QList
<TreeNode
<T
> > _childs
;