I'm trying to imagine how to implement a rather unusual model/view situation. I'm trying to provide two distinct views of an XML hierarchy:
1. A hierarchical tree view, using QTreeView.
2. A list view, based on QStringListModel, which shows a list of the nodes which have xml:id attributes, along with some text from those nodes, displayed in a QListView.
I can do each of these things separately -- in other words, I can implement a model based on QAstractItemModel, construct a tree in it, and display the tree in a QTreeView; and I can construct a model based on QStringListModel consisting of a list of the xml:ids, and display this in a QListView. But what I'd really like to do is have a single model which is hooked up to both a QTreeView and a QListView, so that any change to the model is simultaneously displayed in both controls.
Is this possible? If so, how would you go about it?
All help appreciated,
Martin




Reply With Quote


Bookmarks