schrodinger.application.msv.gui.gui_utils module

schrodinger.application.msv.gui.gui_utils.submenu_action(title: str = '', parent: Optional[PyQt6.QtCore.QObject] = None, menu_class: Type[PyQt6.QtWidgets.QMenu] = <class 'PyQt6.QtWidgets.QMenu'>) PyQt6.QtGui.QAction

Create a QAction with an associated menu. QAction.menu() and QAction.setMenu() were removed from PyQt 6, so we have to create the menu first and then get an action from the menu. We store the menu as action.menu so we can access it later.

Parameters
  • title – The title of the submenu

  • parent – The Qt parent of the submenu

  • menu_class – The QMenu class or subclass to use

Returns

The newly created action