-
Model of models
Hi,
I have a class MyObject and a class MyObjectContainer.
An object container contains a list of MyObject objects.
Each MyObject owns a QStandardItemModel.
The MyObjectContainer owns a QStandardItemModel.
I want to create a tree view where I insert the model of MyObject in the model of MyObjectContainer.
I tried to copy node, to play with invisibleRootNode...I did not success.
Thanks,
-
Re: Model of models
What you will most likely need is a model class derived from QAbstractItemModel that works on a MyObjectContainer.
When it gets requests for the top level, delegate to the MyObjectContainer model. When it gets requests for the second level, find the appropriate MyObject and delegate to its model.
Cheers,
_