Well, since you already have a QFileSystemModel subclass, you could also implement that in there.
Has the advantage that you can use QModelIndex instances of the base class as-is and only need to provide new ones for your additional data. In a proxy you always need to map between source model indexes and your own.
Every model has signals that are emitted before and after such changes as rows being added, etc. This is how the view knows when to update itself.
In case of using a proxy model you would connect to the source model's signals, usually in an overwritten implementation of setSourceModel().
If you go for adding your data inside your QFileSystemModel subclass, then you most likely don't have to do that, because your data is always "after" the base class data.
So all signals will have proper row values already and whenever rowCount() is called for the top level it is always that of the base class plus your entry.
Cheers,
_






Reply With Quote

Bookmarks