I am trying to convert a table into a tree, hereby making use of the aforementioned model and view. I can create/order the table anyhow I want. Currently, every row in the table represents a path of the tree, which means that for some row an element in the "column-1" is the parent of the element of "column".

I have tried reimplementing the index() and parent() of the QSqlTableModel. I have tried using the proxy model. I have studied numerous examples, read Qt's “view/model programming”, and various other docs. I didn't even get close to a tree. I am constantly getting errors/crashes/etc..

I know I could use the “treeitem” and “treemodel” from Qt's source snippets, but it seems a whole way round something that seems so simple.

So, how do I make an index point to some other index?

Kind regards,
Davor