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:
Qt Code:
  1. parent1
  2. +- child11
  3. +- child12
  4. parent2
  5. +- child21
  6. parent3
  7. +- child31
To copy to clipboard, switch view to plain text mode 
should be displayed as:
Qt Code:
  1. child11
  2. child12
  3. child21
  4. child31
To copy to clipboard, switch view to plain text mode 

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