Two context menu for a treewidget
Hi All,
I ve a tree widget. If i right click on that treewidget, a contextmenu is poping up. I've added two action to that context menu, Add parent and Add child. Afetr adding parents and children to perticular parent, if i right click on a child or parent I need a new popup action which should ask If i want to delete parent. How to do this.? plz help me.
Re: Two context menu for a treewidget
Reimplement QWidget::contextMenuEvent() and use QAbstractItemView::indexAt() to check the index that was clicked or use the one that was current (QAbstractItemView::currentIndex()), detect what kind of item is that and do your stuff accordingly.
Re: Two context menu for a treewidget
Quote:
Originally Posted by
wysota
Thank u. I'll try this way.