spyder.api.widgets.menus#
Spyder API menu widgets.
Classes
|
|
|
|
|
Options menu for PluginMainWidget. |
|
A QMenu subclass to implement additional functionality for Spyder. |
Style adjustments that can only be done with a proxy style. |
- class spyder.api.widgets.menus.SpyderMenuProxyStyle[source]#
Bases:
QProxyStyleStyle adjustments that can only be done with a proxy style.
- class spyder.api.widgets.menus.SpyderMenu(parent: QWidget | None = None, menu_id: str | None = None, title: str | None = None, min_width: int | None = None, reposition: bool | None = True)[source]#
Bases:
QMenu,SpyderFontsMixinA QMenu subclass to implement additional functionality for Spyder.
- clear_actions()[source]#
Remove actions from the menu (including custom references)
- Return type:
None.
- add_action(action: SpyderAction | T, section: str | None = None, before: str | None = None, before_section: str | None = None, check_before: bool = True, omit_id: bool = False)[source]#
Add action to a given menu section.
- Parameters:
action (SpyderAction) – The action to add.
section (str or None) – The section id in which to insert the action.
before (str) – Make the action appear before the given action identifier.
before_section (str or None) – Make the item section (if provided) appear before another given section.
check_before (bool) – Check if the before action is part of the menu. This is necessary to avoid an infinite recursion when adding unintroduced actions with this method again.
omit_id (bool) – If True, then the menu will check if the item to add declares an id, False otherwise. This flag exists only for items added on Spyder 4 plugins. Default: False
- get_actions()[source]#
Return a parsed list of menu actions.
Includes MENU_SEPARATOR taking into account the sections defined.