Different listviews , one model
-
I have a c++ QAbstractItemModel that i'm using to populate different list views with the help of a delegate model in different ways, I'll like to add a delete button, but the problem is I'm having a problem getting the right index to be deleted as I'm only familiar with doing it with only one listView.
So, in short how do I get the exact index of the item(it's index in the model) when it's clicked on, solutions I have seen involve using the ListView to get the index but the index usually varies from the intended index as it's filtered.
Any examples or guide on this please? Thank you. -
https://doc.qt.io/qt-5/modelview.html
is a good read and is the fundament of using model view usage.there is a list of references to books with specific examples too.