Hi,

Try using QTreeWidget::customContextMenuRequested(QPoint pos), and use the QTreeWidget::itemAt(QPoint&) to find the item. If that returns 0, just skip the menu...
You will need to change the contextMenuPolicy of the tree widget...

Hth.