Override contextMenuEvent in QTreeWidget and populate your custom menu at the clicked position.
View Tag Cloud
Forum Rules
Bookmarks