Bump.
I'd really like to solve this problem.
I don't know what I'm doing wrong.
The only way I've been able to create a working solution is to use QStandardItemModel and QStandardItem. But that item based approach is not suited to my problem and working that way is unnatural and just wrong. My data is row based NOT item based. My number of columns will never change. A cell of data (an item) by itself simply cannot exist in my application.
I've tried in 2 different custom implementations to just call beingInsertRows and endInsertRows but it never works (no rows are added or removed from the view). It only works when I call the layoutchange methods. And I read somewhere (stackoverflow I think) that I need to update the persistent indexes when I remove rows. So I'm doing that as well.
I feel like I'm doing so much work just to add/remove a row. Shouldn't the persisted indexes update on their own? Shouldn't the selected row remain selected when I insert a new row, rather than me having to do additional work to update yet another set of indexes somewhere?
Bookmarks