I have a tree view that displays data from an external source which I have enclosed in a class. This data is dynamic in nature. I also subclassed a QAbstractItemModel and I am now able to display stuff initially with no problem. Having the dynamic nature of the data, I'm having trouble with how I would be able to update the QTreeView display without reloading everything. I read the documentation and some of the code samples but I find that implementing insertRows() and the other stuff somewhat obscure and have sought to use other means instead since I've read I don't have to implement them in order to achieve what I want.
insertRow()/removeRow() is implemented by QAbstractItemModel and is not virtual, whereas insertRows() is. I want to use that instead since I find it more straightforward. How would the QAbstractItemModel remove a 'row' in my model class if it has no idea how I implemented it? I imagine this to be possible if there were functions that deleted something at all by me but there isn't. Also, assuming that this would work, how would then I remove a row in the view? Do I have to manually call the functions of the view to delete a displayed row? Or do they sort of sync?
What are the other means to achieve this dynamic tree view? How would I use insertRow() in a subclassed abstract model? (note: no 's')
Bookmarks