Hi,
I have my data in QDomElement / QDomDocument form, and I simply display it using a web browser element.On clicking, the node expands/contracts as in internet explorer. Fine.

Problem :
Now, I have a situation where I want to right click on a xml node and be able to tell its path from the root element. say if i clicked D, I should get "Root/A/B/C/D" . Also I want to keep the xml highlighting.
I have two solutions in mind -
1) Implement my own item model and item view. Simplest would be using QStandardItem and QTreeView I guess. But problem with this solution is,,, I havent used model/view till now and it looks very comples to me. Also how do I maintain XML highting even if I manage to make a tree view out of my xml data ?

2) Inherit QTreeWidget and QTreeWidgetItem. and set a delegate for it. The delegate is supposed to do the XML highlighing. Also what functions wud I need to override ? I havent worked with delegates too till now

Which one of the above 2 is better ?
Is there any other way I could achieve my goal more easily and efficiently ?? I dont wanna increase my code.

Any ideas ???