Is there any way to disable right-click context menu between Module Panel and Views?

I want to disable this mouse right-click qAction:

I´ve tried:

pluginHandler = slicer.qSlicerSubjectHierarchyPluginHandler.instance()
pluginLogic = pluginHandler.pluginLogic()
pluginLogic.allowedViewContextMenuActionNames =

It doesn´t work for me.

Thanks in advance!!!

This is a standard Qt main window feature. You may search/ask on Qt forums about how to customize it, for example here.

1 Like

This works for me…

slicer.util.mainWindow().setContextMenuPolicy(qt.Qt.NoContextMenu)

Thanks @lassoan

1 Like