Merge pull request #888 from pyqtgraph/py3-treewidget

TreeWidget.topLevelItems Python 3 fix
This commit is contained in:
Ogi Moore 2019-05-24 22:53:36 -07:00 committed by GitHub
commit 957aab008c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -201,7 +201,7 @@ class TreeWidget(QtGui.QTreeWidget):
return item
def topLevelItems(self):
return map(self.topLevelItem, xrange(self.topLevelItemCount()))
return [self.topLevelItem(i) for i in range(self.topLevelItemCount())]
def clear(self):
items = self.topLevelItems()