Hi all,

I've been trying to add an action in the DataManager context menu, but only for a specific type of object, namely mitk::BoundingObject. Looking in mitk code, I succeeded in adding the option but I'm stuck. Here's the code in one of my plugin activator:

QmitkNodeDescriptorManager* manager =QmitkNodeDescriptorManager::GetInstance();

QAction* locateSelectionObject = new QAction(QIcon("..."),"name", this);
QObject::connect(locateSelectionObject, SIGNAL(triggered(bool)),this, SLOT(test(bool)));

QmitkNodeDescriptor* desc = new QmitkNodeDescriptor("name", "",myPredicate,manager);
desc->AddAction(locateSelectionObject);
manager->AddDescriptor(desc);

I can see it in the context menu when I click on a mitk::BoundingObject and I know my test() function is called. The problem is that the only parameter it has is a bool. I don't even know which node was clicked. The standard context menu item (inheriting from mitk::IContextMenuAction) receives a List of selected node, but afaik they always appear in the context menu and this is not what I want.

I couldn't find any exemple of type-specific action in mitk's code, they are all hardcoded in QmitkDataManagerView :(
Can someone please tell me what is the right way to do that? Thanks.

--
Logo Imeka <http://imeka.ca/>     Nil Goyette, M.Sc.
www.imeka.ca <http://imeka.ca/>

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://p.sf.net/sfu/Zoho
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to