Only clear selection model if it exists
This commit is contained in:
parent
f959c0c137
commit
88b522fa16
@ -288,8 +288,10 @@ class CompletionView(QTreeView):
|
|||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def on_clear_completion_selection(self):
|
def on_clear_completion_selection(self):
|
||||||
"""Clear the selection model when an item is activated."""
|
"""Clear the selection model when an item is activated."""
|
||||||
self.selectionModel().clearSelection()
|
selmod = self.selectionModel()
|
||||||
self.selectionModel().clearCurrentIndex()
|
if selmod is not None:
|
||||||
|
selmod.clearSelection()
|
||||||
|
selmod.clearCurrentIndex()
|
||||||
|
|
||||||
|
|
||||||
class _CompletionItemDelegate(QStyledItemDelegate):
|
class _CompletionItemDelegate(QStyledItemDelegate):
|
||||||
|
Loading…
Reference in New Issue
Block a user