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->remove_child(data);
131 new_parent->add_child(
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);
void sort(bool recursive)
sort children of all nodes in ascending way according to their data
Definition: Tree.h:138
Tree * remove_child(Tree *deleted_node)
remove a node from the current node
Definition: Tree.h:107
Tree(const T &data_)
Tree constructor.
Definition: Tree.h:50
void move(Tree *new_parent)
move current node to a new parent
Definition: Tree.h:128
Helper functions.
Definition: GenreView.h:34
The Tree class.
Definition: GenreView.h:37
Tree * add_child(Tree *node)
adds a child to the given node
Definition: Tree.h:85
Tree * copy()
Definition: Tree.h:68
Definition: org_mpris_media_player2_adaptor.h:20