Hi,
I could really use some help and general guidelines on how a complex hierarchical data model should be implemented using QAbstractItemModel interface (+ proxy models?) for several different views. The current solution that we have is implemented using item based classes (QTreeWidget, QListWidget mainly). The data model is separate from the widgets and implemented using standard c++ classes, containers etc. Qt widgets are used to visualize different parts of the model, for example a QTreeWidget is used to visualize the main hierarchy and when users selects an item there another tree widget visualizes the more detailed view from that item on and so on. There are tens different view on different levels of the data model. Synchronization between data model and item based widgets is made using identifiers and/or pointers that are stored to items (for example QTreeWidgetItem) as data (item->setData(0, id, Qt::UserRole)) and so one..
However, the trend seems to be away from the item based widgets (or has been that for a while now) and the future Qt versions are relying more and more to model/view approach (QtQuick + item models).
I'm a bit lost with Qt's model/view framework here... Would it be a good idea to describe the whole data model with one QAbstractItemModel interface and then use several proxy models to filter data for specific views or should we have several QAbstractItemModel based models in the first place... The Qt documentation is not very clear here - all the examples are for really small and simple data sets.
Any recommendations and/or pointers would be more than welcome!
Thanks,
- Timo
Bookmarks