Tool Box Widget (toolbox)

Tool Box Widget

A reimplementation of the QToolBox widget that keeps all the tabs in a single QScrollArea instance and can keep multiple open tabs.

class orangecanvas.gui.toolbox.ToolBox(parent=None, **kwargs)[source]

Bases: PyQt5.QtWidgets.QFrame

A tool box widget.

tabToggled(index: int, state: bool)

Signal emitted when a tab at index is toggled.

setExclusive(exclusive)[source]

Set exclusive tabs (only one tab can be open at a time).

exclusive()[source]

Are the tabs in the toolbox exclusive.

exclusive_

Exclusive tabs

setTabButtonHeight(height)[source]

Set the tab button height.

tabButtonHeight()[source]

Return the tab button height.

setTabIconSize(size)[source]

Set the tab button icon size.

tabIconSize()[source]

Return the tab icon size.

tabButton(index)[source]

Return the tab button at index

tabAction(index)[source]

Return open/close action for the tab at index.

addItem(widget, text, icon=<PyQt5.QtGui.QIcon object>, toolTip='')[source]

Append the widget in a new tab and return its index.

Parameters:
  • widget (QWidget) – A widget to be inserted. The toolbox takes ownership of the widget.
  • text (str) – Name/title of the new tab.
  • icon (QIcon) – An icon for the tab button.
  • toolTip (str) – Tool tip for the tab button.
Returns:

index – Index of the inserted tab

Return type:

int

insertItem(index, widget, text, icon=<PyQt5.QtGui.QIcon object>, toolTip='')[source]

Insert the widget in a new tab at position index.

removeItem(index)[source]

Remove the widget at index.

Note

The widget is hidden but is is not deleted. It is up to the caller to delete it.

count()[source]

Return the number of widgets inserted in the toolbox.

widget(index)[source]

Return the widget at index.

createTabButton(widget, text, icon=<PyQt5.QtGui.QIcon object>, toolTip='')[source]

Create the tab button for widget.

ensureWidgetVisible(child, xmargin=50, ymargin=50)[source]

Scroll the contents so child widget instance is visible inside the viewport.

sizeHint()[source]

Reimplemented.