HomePhabricator
Diffusion MITK a5312246035b

Context menu action can be initialized with icon attribute via the extension…

Description

Context menu action can be initialized with icon attribute via the extension point

Details

Provenance
klemmmaAuthored on Nov 12 2014, 3:58 PM
Parents
rMITK3710e7c4030b: Merge branch 'bug-18227-QballLevelWindowIntegration'
Branches
Unknown
Tags
Unknown

Event Timeline

zimmerm added inline comments.
/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerView.cpp
266

If we want to allow any plugins (other than the data manager plugin itself) to contribute with actions, we have to pay attention on the way the icon is retrieved. I have noted that retrieving icon by doing QIcon(iconPath) works only when the icon is a resource of the same plugin. I suggest using something like that:

QIcon icon  = berry::AbstractUICTKPlugin::ImageDescriptorFromPlugin(
                                         (*cmActionsIt)->GetContributor()->GetName(),
                                         QString::fromStdString(cmIcon));
contextMenuAction = new QAction(icon, QString::fromStdString(cmLabel), parent);