One big tree describing all your objects sure presents a fanciful idea, especially the ease with which most of the views can be ready almost instantly thanks to proxy model. However it becomes increasingly difficult to make a tree model for different object types. See, making a model for a type QList<ObjectType1> is not that difficult. Now if your objecttype1 has objecttype2 which is to be a child of a particular objecttype1, you can go ahead use the facilities of QObject and make objecttype2 child of objecttype1 or implement something like that yourself or create another node wrapper class which essentially goes ahead and dissects type of object and helps you with the index() and parent() functions.
With the growing objectypes classes, managing this node class becomes increasingly messy. And difficult. Moreover you cannot envisage the whole program beforehand. Later, it will become a head-ache when a new type comes in.
Having said that, it is better to have that object tree as big as possible, according to my opinion. The various classes generally interact with each other. Even if your data is outside your classes, and you interact directly with them, models need to be told with anything you changed. I wish there was a straight and correct answer to your question. I wish I knew it too.![]()
Bookmarks