bmesing
28th March 2007, 09:30
Hello
I have a hierarchical QAbstractItemModel. For this model, I want to display all the items which are not at the top level in a simple list.
The Model:
parent1
+- child11
+- child12
parent2
+- child21
parent3
+- child31
should be displayed as:
child11
child12
child21
child31
I have tried to accomplish this by displaying the model in a QTableView, but this displays only the parent items. I have also tried to display the model in a QTreeView and hiding the parents, but unfortunately hiding the parent items does also hide their children.
Is there a way to do this except for writing a completly new view class? Perhaps subclassing QTreeView or QTableView in a smart way?
Any help would be appreciated.
Regards Ben
I have a hierarchical QAbstractItemModel. For this model, I want to display all the items which are not at the top level in a simple list.
The Model:
parent1
+- child11
+- child12
parent2
+- child21
parent3
+- child31
should be displayed as:
child11
child12
child21
child31
I have tried to accomplish this by displaying the model in a QTableView, but this displays only the parent items. I have also tried to display the model in a QTreeView and hiding the parents, but unfortunately hiding the parent items does also hide their children.
Is there a way to do this except for writing a completly new view class? Perhaps subclassing QTreeView or QTableView in a smart way?
Any help would be appreciated.
Regards Ben