Parent and Child are the concepts of arranging the data on the screen (view) is a hierarchy, it is not required to store parent and child in a hierarchy data structure, this is a main and powerful feature exploited by Model/View Framework.
It may not be possible using delegate, delegate are use to interchange data, and but not to rearrange data (which you want to do in your case)
Not sure what your trying to display, but whatever it be, it up to you to store the data in what every way you want it be, (any data structure / database / file). Now the your question is to how to display them then given formation.
The answer would be implement a custom QAbstractItemModel for the QTreeView, and when the view asks to give children and there columns items, then you need to collect all the children and supply to view as if they were a part of one virtual child, and each actual child as a column of the virtual child.
It is as good as saying (only in your case) that the parent and child terms have different interpretation for a view, and diferent interpretation for you model, that is a child for view is a collection of children for the model.
This is all about how you design your model, and exploit Model/View Framework, to answer in one line, all you need to do is handle things in model which you implement.
Bookmarks