Clean up selection model properly in completion.
http://qt-project.org/doc/qt-5/qabstractitemview.html#setModel : This function will create and set a new selection model, replacing any model that was previously set with setSelectionModel(). However, the old selection model will not be deleted as it may be shared between several views. We recommend that you delete the old selection model if it is no longer required.
This commit is contained in:
parent
de86a26473
commit
fe1215c74d
@ -190,7 +190,10 @@ class CompletionView(QTreeView):
|
||||
Args:
|
||||
model: The model to use.
|
||||
"""
|
||||
sel_model = self.selectionModel()
|
||||
self.setModel(model)
|
||||
if sel_model is not None:
|
||||
sel_model.deleteLater()
|
||||
self.expandAll()
|
||||
self._resize_columns()
|
||||
model.rowsRemoved.connect(self.maybe_resize_completion)
|
||||
|
Loading…
Reference in New Issue
Block a user