I tried to read about models, and right now its going over my head.The proper way would be to use your own model and keep a pointer to the graphics item in the model index
Also I need a tree with single column, so I am not sure to go in for a model for this... there must be a simple way
I cud have used this approach, but not all treeWidgetItems are related to GraphicsItem, like the PL.. it contains a list of graphicsitems which are contained in it.But if you want to stick with the treewidget approach, then you can make a QMap<QTreeWidgetItem*, QGraphicsItem*> map and hold the info there.
Also in future I may need to add tree nodes based on certain lists and not graphicsitems..
and the subclassing QTreewidgetItem idea was given by you(wysota) in this thread
what say ??
Also I would be glad if u teach me something about the model , model/view architecture in context with this prpblem, I searched thru Qt Examples but cudnt find a suitable example related to my problem.. only if experts like u speak something, it wud be a great speed up for guys like me![]()
Bookmarks