spyder.api.widgets.toolbars#

Spyder API toolbar widgets.

Classes

ApplicationToolbar(parent, toolbar_id, title)

Spyder Main application Toolbar.

MainWidgetToolbar([parent, title])

Spyder Widget toolbar class.

SpyderToolbar(parent, title)

Spyder Toolbar.

ToolTipFilter

Filter tool tip events on toolbuttons.

ToolbarLocation()

ToolbarStyle

class spyder.api.widgets.toolbars.ToolTipFilter[source]#

Bases: QObject

Filter tool tip events on toolbuttons.

eventFilter(self, a0: QObject | None, a1: QEvent | None) bool[source]#
class spyder.api.widgets.toolbars.ToolbarStyle[source]#

Bases: QProxyStyle

pixelMetric(pm, option, widget)[source]#

Adjust size of toolbar extension button (in pixels).

From https://stackoverflow.com/a/27042352/438386

class spyder.api.widgets.toolbars.SpyderToolbar(parent, title)[source]#

Bases: QToolBar

Spyder Toolbar.

This class provides toolbars with some predefined functionality.

sig_is_rendered#

This signal is emitted to let other objects know that the toolbar is now rendered.

add_item(action_or_widget: SpyderAction | QWidget, section: str | None = None, before: str | None = None, before_section: str | None = None, omit_id: bool = False)[source]#

Add action or widget item to given toolbar section.

Parameters:
  • item (SpyderAction or QWidget) – The item to add to the toolbar.

  • toolbar_id (str or None) – The application toolbar unique string identifier.

  • section (str or None) – The section id in which to insert the item on the toolbar.

  • before (str or None) – Make the item appear before another given item.

  • before_section (str or None) – Make the item defined section appear before another given section (must be already defined).

  • omit_id (bool) – If True, then the toolbar 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

remove_item(item_id: str)[source]#

Remove action or widget from toolbar by id.

render()[source]#

Create the toolbar taking into account sections and locations.

class spyder.api.widgets.toolbars.ApplicationToolbar(parent, toolbar_id, title)[source]#

Bases: SpyderToolbar

Spyder Main application Toolbar.

ID = None#

Unique string toolbar identifier.

This is used by Qt to be able to save and restore the state of widgets.

class spyder.api.widgets.toolbars.MainWidgetToolbar(parent=None, title=None)[source]#

Bases: SpyderToolbar

Spyder Widget toolbar class.

A toolbar used in Spyder dockable plugins to add internal toolbars to their interface.

ID = None#

Unique string toolbar identifier.