[Interest] Add context menu to QTreeWidget based on Specific Item being clicked

Michael Jackson imikejackson at gmail.com
Fri May 10 22:06:24 CEST 2013


I am trying to add a "right click" or context menu to a QTreeWidget where the menu that gets popped up has menus that are specific to the item being clicked on. So far all my attempts have failed.

I have tried to add my higher level QWidget class (The parent of the QTreeWidget) as an Event Filter for the QTreeWidget but I am not receiving the mouse clicked events. I tried adding the QAction to the QTreeWidgetItem directly by getting the QWidget from the QTreeWidgetItem while it is being constructed but at that point in the code the QTreeWidgetItem does not have a QWidget yet so that does not work.

I am hoping it is something simple that I am just missing. Any help would be greatly appreciated.

Thanks
Mike Jackson


More information about the Interest mailing list