270 @param index index of the icon to be removed |
270 @param index index of the icon to be removed |
271 @type int |
271 @type int |
272 """ |
272 """ |
273 label = self.__layout.itemAt(index) |
273 label = self.__layout.itemAt(index) |
274 if label: |
274 if label: |
275 # self.__layout.removeItem(label) |
|
276 # self.__layout.removeWidget(label.widget()) |
|
277 with contextlib.suppress(IndexError): |
275 with contextlib.suppress(IndexError): |
278 del self.__icons[index] |
276 del self.__icons[index] |
279 itm = self.__layout.takeAt(index) |
277 itm = self.__layout.takeAt(index) |
280 itm.widget().deleteLater() |
278 itm.widget().deleteLater() |
281 del itm |
279 del itm |