Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to add/find items to a model at a specific index
philk last edited by
I have a tree model with 4 branches of the root. Now during runtime one of the branches should get children. The question is:
How do I find/remember the right branch/item to add the children to?
I found QPersistentModelIndex, which works. But is it the best approach? Or should I, when its time to insert new items, search in the model (how?) for the parent item they are supposed to be added to?