I have a QTreeWidget, which is populated with QTreeWidgetItems. How do I setup a handler so that when a user right clicks on each tree item, different context menus can be shown?

Many thanks, I tried a few things like the contextMenuPolicy but that only appears to work on the QTreeWidget itself, not its actual items.