diff -r e9e7eca7efee -r bf71ee032bb4 src/eric7/EricWidgets/EricToolBox.py --- a/src/eric7/EricWidgets/EricToolBox.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/EricWidgets/EricToolBox.py Wed Jul 13 14:55:47 2022 +0200 @@ -17,10 +17,11 @@ Class implementing a ToolBox class substituting QToolBox to support wheel events. """ + def __init__(self, parent=None): """ Constructor - + @param parent reference to the parent widget (QWidget) """ super().__init__(parent) @@ -30,20 +31,21 @@ """ Class implementing a vertical QToolBox like widget. """ + def __init__(self, parent=None): """ Constructor - + @param parent reference to the parent widget (QWidget) """ EricTabWidget.__init__(self, parent) self.setTabPosition(QTabWidget.TabPosition.West) self.setUsesScrollButtons(True) - + def addItem(self, widget, icon, text): """ Public method to add a widget to the toolbox. - + @param widget reference to the widget to be added (QWidget) @param icon the icon to be shown (QIcon) @param text the text to be shown (string) @@ -52,11 +54,11 @@ index = self.addTab(widget, icon, "") self.setTabToolTip(index, text) return index - + def insertItem(self, index, widget, icon, text): """ Public method to add a widget to the toolbox. - + @param index position at which the widget should be inserted (integer) @param widget reference to the widget to be added (QWidget) @param icon the icon to be shown (QIcon) @@ -66,28 +68,28 @@ index = self.insertTab(index, widget, icon, "") self.setTabToolTip(index, text) return index - + def removeItem(self, index): """ Public method to remove a widget from the toolbox. - + @param index index of the widget to remove (integer) """ self.removeTab(index) - + def setItemToolTip(self, index, toolTip): """ Public method to set the tooltip of an item. - + @param index index of the item (integer) @param toolTip tooltip text to be set (string) """ self.setTabToolTip(index, toolTip) - + def setItemEnabled(self, index, enabled): """ Public method to set the enabled state of an item. - + @param index index of the item (integer) @param enabled flag indicating the enabled state (boolean) """