I would like to know how can we set context menu for a qtreewidgetitem that is if i right click on each item in my qtreewidget,i should have some options like edit,delete ..i would like to know how can we implement this.thanks in advance
Asked
Active
Viewed 2,589 times
1
-
1duplicate of http://stackoverflow.com/questions/1771657/invoking-context-menu-in-qtreewidget – Eli Bendersky Apr 19 '10 at 19:08
1 Answers
2
create several Action's such as "Edit", "Delete",...
call myTreeWidget->addAction( actionEdit )
call myTreeWidget->setContextMenuPolicy( Qt::ActionsContextMenu )
Connect a slot to the QAction::triggered signal, retrieve the item-selection from there and execute your code.

Pieter
- 1,191
- 1
- 11
- 29