To i)
Learning model/view is worth the trouble.
I am not saying you should for this problem; but take a look at it anyway!

ii) I don't see why you would need/want to subclass QTreeWidget (if at all: QTreeView, probably?)? As long as you do not have a model, a view (or delegate) won't help you.


There is an example of adapting XML to a model in Qt4's examples (look for "Simple DOM Model"). Take a look at it.
Then put that in a QTreeView.
Connect to the contextMenu event (or something like), translate the mouse pos. to the QModelIndex, get the DomNode from that, and from that, the path.

HTH