124 Public method to add a top level item. |
126 Public method to add a top level item. |
125 |
127 |
126 @param item item to be added as a top level item (QTreeWidgetItem) |
128 @param item item to be added as a top level item (QTreeWidgetItem) |
127 """ |
129 """ |
128 self.__allTreeItems.append(item) |
130 self.__allTreeItems.append(item) |
129 super().addTopLevelItem(item) |
131 super(E5TreeWidget, self).addTopLevelItem(item) |
130 |
132 |
131 def addTopLevelItems(self, items): |
133 def addTopLevelItems(self, items): |
132 """ |
134 """ |
133 Public method to add a list of top level items. |
135 Public method to add a list of top level items. |
134 |
136 |
135 @param items items to be added as top level items (list of QTreeWidgetItem) |
137 @param items items to be added as top level items (list of QTreeWidgetItem) |
136 """ |
138 """ |
137 self.__allTreeItems.extend(items) |
139 self.__allTreeItems.extend(items) |
138 super().addTopLevelItems(items) |
140 super(E5TreeWidget, self).addTopLevelItems(items) |
139 |
141 |
140 def insertTopLevelItem(self, index, item): |
142 def insertTopLevelItem(self, index, item): |
141 """ |
143 """ |
142 Public method to insert a top level item. |
144 Public method to insert a top level item. |
143 |
145 |
144 @param index index for the insertion (integer) |
146 @param index index for the insertion (integer) |
145 @param item item to be inserted as a top level item (QTreeWidgetItem) |
147 @param item item to be inserted as a top level item (QTreeWidgetItem) |
146 """ |
148 """ |
147 self.__allTreeItems.append(item) |
149 self.__allTreeItems.append(item) |
148 super().insertTopLevelItem(index, item) |
150 super(E5TreeWidget, self).insertTopLevelItem(index, item) |
149 |
151 |
150 def insertTopLevelItems(self, index, items): |
152 def insertTopLevelItems(self, index, items): |
151 """ |
153 """ |
152 Public method to insert a list of top level items. |
154 Public method to insert a list of top level items. |
153 |
155 |
154 @param index index for the insertion (integer) |
156 @param index index for the insertion (integer) |
155 @param items items to be inserted as top level items (list of QTreeWidgetItem) |
157 @param items items to be inserted as top level items (list of QTreeWidgetItem) |
156 """ |
158 """ |
157 self.__allTreeItems.extend(items) |
159 self.__allTreeItems.extend(items) |
158 super().insertTopLevelItems(index, items) |
160 super(E5TreeWidget, self).insertTopLevelItems(index, items) |
159 |
161 |
160 def deleteItem(self, item): |
162 def deleteItem(self, item): |
161 """ |
163 """ |
162 Public method to delete an item. |
164 Public method to delete an item. |
163 |
165 |
245 return |
247 return |
246 elif evt.buttons() == Qt.MiddleButton: |
248 elif evt.buttons() == Qt.MiddleButton: |
247 self.itemMiddleButtonClicked.emit(self.itemAt(evt.pos())) |
249 self.itemMiddleButtonClicked.emit(self.itemAt(evt.pos())) |
248 return |
250 return |
249 else: |
251 else: |
250 super().mousePressEvent(evt) |
252 super(E5TreeWidget, self).mousePressEvent(evt) |
251 |
253 |
252 def __iterateAllItems(self, parent): |
254 def __iterateAllItems(self, parent): |
253 """ |
255 """ |
254 Private method to iterate over the child items of the parent. |
256 Private method to iterate over the child items of the parent. |
255 |
257 |