--- a/eric6/E5Gui/E5TreeWidget.py Tue Apr 13 17:49:05 2021 +0200 +++ b/eric6/E5Gui/E5TreeWidget.py Tue Apr 13 18:02:59 2021 +0200 @@ -269,16 +269,10 @@ @param parent parent item to iterate (QTreeWidgetItem) """ - if parent: - count = parent.childCount() - else: - count = self.topLevelItemCount() + count = parent.childCount() if parent else self.topLevelItemCount() for index in range(count): - if parent: - itm = parent.child(index) - else: - itm = self.topLevelItem(index) + itm = parent.child(index) if parent else self.topLevelItem(index) if itm.childCount() == 0: self.__allTreeItems.append(itm)