I am using a QAbstractItemModel and QTreeView to display a hierarchy of joints. I want to clear and re-populate the TreeView when my selection changes.
Based on the Qt Documentation, I need to re-implement the removeRows method for the QAbstractItemModel and I have done that based on Yasin’s tutorials.
When I try to clear the TreeView and re-populate it with new data, removeRows returns False, and I just end up appending the new data to the TreeView.
Most of the answers I’ve found on StackOverflow and elsewhere indicate that re-implementing removeRows should work, but I haven’t had any luck yet.
What else could I be overlooking?
Thanks.
[EDIT: NVM, found my problem, a syntax error as a result of copying and pasting code around…]