How to implement interdependent models using the Qt Model-View framework? In particular, how can I create a model containing fields that reference data in another model? I want the data that has been changed / deleted in the first model to propagate to the dependent field in the second model.
Say, for example, I have a model called BookListModelthat contains a list of books. I have a second model called ReaderTableModel, which contains a list of readers (names) and the book they are reading. I would like these books to refer to the corresponding index BookListModeland any changes for distribution to the corresponding entry in ReaderTableModel.
Does Qt have a mechanism for this? Can I save QPersistentModelIndexinside another model?
source
share