 |
Sayonara Player
|
57 for(
Tree* child : children){
58 delete child; child =
nullptr;
72 for(
Tree* child : children){
73 node->children << child->copy();
89 this->children << node;
109 deleted_node->parent =
nullptr;
111 for(
int i=0; i < children.size(); i++){
112 Tree* node = children[i];
114 if(node == deleted_node){
115 deleted_node = children.takeAt(i);
130 parent->removeChild(data);
131 new_parent->addChild(
this);
142 if(children.isEmpty()){
147 return (a->data < b->data);
150 std::sort(children.begin(), children.end(), lambda);
154 for(
Tree* child : children){
156 child->sort(recursive);
Tree(const T &data_)
Tree constructor.
Definition: Tree.h:50
Tree * addChild(Tree *node)
adds a child to the given node
Definition: Tree.h:85
Definition: EngineUtils.h:33
Helper functions.
Definition: GenreView.h:35
Tree * removeChild(Tree *deleted_node)
remove a node from the current node
Definition: Tree.h:107
The Tree class.
Definition: GenreView.h:38
void move(Tree *new_parent)
move current node to a new parent
Definition: Tree.h:128
Tree * copy()
Definition: Tree.h:68
void sort(bool recursive)
sort children of all nodes in ascending way according to their data
Definition: Tree.h:138