Your treemodel will index every element added to the tree.
For any given item in the tree you can get the other elements at the same level using the sibling function.
For more info take a look at the documentation for QModelIndex.
Your treemodel will index every element added to the tree.
For any given item in the tree you can get the other elements at the same level using the sibling function.
For more info take a look at the documentation for QModelIndex.
Store your data in a basic table model with a the hierarchy you want for your tree view. If the children you want to show in your list view are all of the same parent then you might consider using a single-columned tree view and QTreeView::setRootIndex(). If not, as would seem to be the case in your example, write a QAbstractItemProxyModel derivative to filter the underlying table to produce a single-columned list for your list view.
I think the browser example in the Qt distribution/demos contains an implmentation described here http://labs.trolltech.com/blogs/2008...-of-modelview/
Thanks a lot guys.... Tried a bit but the solution seems to be somewhat complex ..Going with a Two Model Strategy right now and will try on the suggestion again
sometime later .
Bookmarks