Pass invalid index to [can]FetchMore.

For QSqlQueryModel, the argument should always be an invalid index:
http://doc.qt.io/qt-5/qsqlquerymodel.html#canFetchMore

For a QStandardItemModel, it doesn't matter. Either way, passing the
top-level parent index was wrong.
This commit is contained in:
Ryan Roden-Corrent 2017-06-20 22:11:53 -04:00
parent 63cb88a0f4
commit b722cc1dec

View File

@ -161,14 +161,14 @@ class CompletionModel(QAbstractItemModel):
"""Override to forward the call to the categories."""
cat = self._cat_from_idx(parent)
if cat:
return cat.canFetchMore(parent)
return cat.canFetchMore(QModelIndex())
return False
def fetchMore(self, parent):
"""Override to forward the call to the categories."""
cat = self._cat_from_idx(parent)
if cat:
cat.fetchMore(parent)
cat.fetchMore(QModelIndex())
def count(self):
"""Return the count of non-category items."""