src/eric7/EricWidgets/EricToolBox.py

branch
eric7
changeset 9874
b89dce027259
parent 9653
e67609152c5e
child 9876
800c539f8700
equal deleted inserted replaced
9873:38f3435daeef 9874:b89dce027259
23 Constructor 23 Constructor
24 24
25 @param parent reference to the parent widget (QWidget) 25 @param parent reference to the parent widget (QWidget)
26 """ 26 """
27 super().__init__(parent) 27 super().__init__(parent)
28
29 def setCurrentWidget(self, widget):
30 """
31 Public slot to set the current widget.
32
33 @param widget reference to the widget to become the current widget
34 (QWidget)
35 """
36 index = self.indexOf(widget)
37 if index < 0:
38 # not found, set first widget as default
39 index = 0
40 self.setCurrentIndex(index)
28 41
29 42
30 class EricHorizontalToolBox(EricTabWidget): 43 class EricHorizontalToolBox(EricTabWidget):
31 """ 44 """
32 Class implementing a vertical QToolBox like widget. 45 Class implementing a vertical QToolBox like widget.
92 105
93 @param index index of the item (integer) 106 @param index index of the item (integer)
94 @param enabled flag indicating the enabled state (boolean) 107 @param enabled flag indicating the enabled state (boolean)
95 """ 108 """
96 self.setTabEnabled(index, enabled) 109 self.setTabEnabled(index, enabled)
110
111 def setCurrentWidget(self, widget):
112 """
113 Public slot to set the current widget.
114
115 @param widget reference to the widget to become the current widget
116 (QWidget)
117 """
118 index = self.indexOf(widget)
119 if index < 0:
120 # not found, set first widget as default
121 index = 0
122 self.setCurrentIndex(index)

eric ide

mercurial