completion: get rid of model-specific sort method (see #545)
This commit is contained in:
parent
49327dfcbb
commit
119f9c0e18
@ -126,10 +126,3 @@ class BaseCompletionModel(QStandardItemModel):
|
||||
else:
|
||||
# category
|
||||
return Qt.NoItemFlags
|
||||
|
||||
def sort(self, column, order=Qt.AscendingOrder):
|
||||
"""Sort the data in column according to order.
|
||||
|
||||
Override QAbstractItemModel::sort.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
@ -63,9 +63,6 @@ class CompletionFilterModel(QSortFilterProxyModel):
|
||||
|
||||
Invalidates the filter and re-sorts the model.
|
||||
|
||||
If the current completion model overrides sort(), it is used.
|
||||
If not, the default implementation in QCompletionFilterModel is called.
|
||||
|
||||
Args:
|
||||
val: The value to set.
|
||||
"""
|
||||
@ -76,10 +73,7 @@ class CompletionFilterModel(QSortFilterProxyModel):
|
||||
self.pattern_re = re.compile(val, re.IGNORECASE)
|
||||
self.invalidateFilter()
|
||||
sortcol = 0
|
||||
try:
|
||||
self.srcmodel.sort(sortcol)
|
||||
except NotImplementedError:
|
||||
self.sort(sortcol)
|
||||
self.sort(sortcol)
|
||||
self.invalidate()
|
||||
|
||||
def count(self):
|
||||
|
Loading…
Reference in New Issue
Block a user