Hi,
I've got a pretty complex model/view situation I'm dealing with. I'm hoping you guys can offer some advice.
I have created a model based on QAbstractItemModel, that retrieves data from our non-qt based data object directly to update the information four the QTableView that is the main focus widget for the application. Basically, I arbitrarily determined what a row index means and what a column index means and I can use that information to look up values in my data object. It works pretty smoothly for the QTableView. However, I now need to add a QTreeView to the mix. (Actually 2 and they're each looking at different information. the row/column designations don't have the same meaning in the QTreeView. (eg row = roomNumber, column=student name, in the table. The tree is looking at course name and book list...just as an example)
I would like to take my main data model and use it with QTreeView. I haven't been able to figure out hot to get this to work yet, because of the disparate information. Using a proxy model and setting up the mapping methods didn't work because the information I'm looking for doesn't alway directly map. For example, since the base model was generated with a QTableView in mind the modelindexes have no idea about the parenting required to work with a QTreeView.
Has anyone faced this problem. Have you seen any good ideas on approaches? I've been staring and staring and the best idea I've been able to come up with is to use multiple data models, but chaining together the datachanges gets klunky.
I apologize if this isn't clear. I'm happy to attempt to clarify.
thank you
Bookmarks