Not sure that I understand what you are trying to achieve, but I think to get anything to show up in your treeWidget you to need to either reparent the items or copy them.
Reparent:
void showItems(A* a){
Item* top = a->root();
while (top->childCount() > 0){
Item *child = top->takeChild(0);
addTopLevelItem(child);
}
}
void showItems(A* a){
Item* top = a->root();
while (top->childCount() > 0){
Item *child = top->takeChild(0);
addTopLevelItem(child);
}
}
To copy to clipboard, switch view to plain text mode
Copy:
void showItems(A* a){
Item* top = a->root();
for(int i=0;i<top->childCount();++i) {
Item *child = new Item(*top->child(i));
addTopLevelItem(child);
}
}
void showItems(A* a){
Item* top = a->root();
for(int i=0;i<top->childCount();++i) {
Item *child = new Item(*top->child(i));
addTopLevelItem(child);
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks