Consider whether you need the QTreeView (a model, abstract and general) or whether you need the QTreeWidget (a ready-to-use tree structure). If you need a QTreeWidget, then:
Adding non-top level item is made at the QTreeWidgetItem level. You need pointers to the parent node and the added item, then do parentNode->AddChild(item) for one item or create QList<QTreeWidgetItem *> from more items added simultaneously and then parentNote->AddChildren(list). Note that the pointers to the added item(s) get owned by the tree and that they need to be created by new. The list itself can be deleted after adding.
Adding top level items is made at QTreeWidget level. Do tree->addTopLevelItem(item) for one item or tree->AddTopLevelItems(list) for a list of items. You can also get the pointer to the invisible root item: root = invisibleRootItem() and add child(ren) as above: root->addChild(item) or root->addChildren(list).
Bookmarks