Understanding Qt view-model architecture: when to create and how to cleanup indexes in QAbstractItemModel implementation?
I'm currently migrating my project from QTreeWidget to QtreeView , and have a lot of problems caused by poor understanding of the Qt model-view design. So far I couldn't find answers even in Qt examples. I've implemented my QAbstractItemModel . I'm returning strings to be viewed in the QTreeView through data method. Now, the underlying data will change in runtime. To handle this my model is subscribed to a notification that does emit dataChanged(index(0,0), index(rowCount() - 1, LastColumn)); . The question is: how to create and cleanup QModelIndex objects? One of the Qt examples reimplements