PDA

View Full Version : Context Menu With QTreeWidget (Require to display action menu on selected ITem only)



lekhrajdeshmukh
4th November 2011, 07:03
Hi All.

I need your help in urgent basis.As i am trying to add context menu on treewidget item and i want that this option comes only on leaf node of the widget.As in attached picture its is showing.

Presently when i made right click on anywhere of project section it gives me the Link Analysis option but instead of that i want only in selected leaf node i.e. 9831024567.

Currently using following code which is giving me link analysis option.

void XmlTreeView::setcontextMenu()
{
treeWidget->setContextMenuPolicy(Qt::ActionsContextMenu);
linkAct = new QAction("&LinkAnalysis",treeWidget);
linkAct->setStatusTip("Perform Link Analysis");
treeWidget->addAction(linkAct);
}

Please let me inform if you require any more information.

Looking for prompt response.

Thanks in advance.

regards,
Lekhraj

lekhrajdeshmukh
4th November 2011, 11:25
Guy's could you please help me on above issue.