Toolbox¶
-
class
cued_datalogger.api.toolbox.
Toolbox
(widget_side='left', parent=None)¶ Bases:
PyQt5.QtWidgets.QWidget
A side-oriented widget similar to a TabWidget that can be collapsed and expanded.
A Toolbox is designed to be a container for sets of controls, grouped into ‘pages’ and accessible by a TabBar, in the same way as a TabWidget. A page is normally a QWidget with a layout that contains controls. A widget can be added as a new tab using
addTab()
. The Toolbox has slots for triggering its collapse and expansion, both in an animated mode (soft slide) and a ‘quick’ mode which skips the animation. Commonly the collapse/expand slots are connected to the tabBar’stabBarDoubleClicked()
signal. Normally in the DataLogger a Toolbox is created and then added to aMasterToolbox
, which connects the relevant signals for collapsing and expanding the Toolbox.Attributes
tabBar (QTabBar) tabPages (QStackedWidget) The stack of widgets that form the pages of the tabs. collapse_animation (QPropertyAnimation) The animation that controls how the Toolbox collapses. Methods
-
addTab
(widget, title)¶ Add a new tab, with the page widget widget and tab title title.
-
changePage
(index)¶ Set the current page to index.
-
clear
()¶ Remove all tabs and pages.
-
collapse
()¶ Collapse the widget so that only the tab bar is visible.
-
expand
()¶ Expand the widget so that the pages are visible.
-
removeTab
(title)¶ Remove the tab with title title.
-
toggle_collapse
()¶ If collapsed, expand the widget so the pages are visible. If not collapsed, collapse the widget so that only the tabBar is showing.
-