Always return col 0 for index parent.

This was changed during code review but was causing Qt errors while
TAB-completing in the selection view:

08:42:34 WARNING  qt         Unknown module:none:0 Can't select indexes from different model or with different parents
This commit is contained in:
Ryan Roden-Corrent 2017-06-08 08:43:53 -04:00
parent 18cd8ba0b6
commit 862f8d3188

View File

@ -134,7 +134,7 @@ class CompletionModel(QAbstractItemModel):
# categories have no parent
return QModelIndex()
row = self._categories.index(parent_cat)
return self.createIndex(row, index.column(), None)
return self.createIndex(row, 0, None)
def rowCount(self, parent=QModelIndex()):
"""Override QAbstractItemModel::rowCount."""