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:
parent
63cb88a0f4
commit
b722cc1dec
@ -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."""
|
||||
|
Loading…
Reference in New Issue
Block a user