Fix empty selection model bug (#2173)
This commit is contained in:
@@ -1020,7 +1020,9 @@ class GuiProjectTree(QTreeView):
|
|||||||
def _clearSelection(self) -> None:
|
def _clearSelection(self) -> None:
|
||||||
"""Clear the currently selected items."""
|
"""Clear the currently selected items."""
|
||||||
self.clearSelection()
|
self.clearSelection()
|
||||||
self.selectionModel().clearCurrentIndex()
|
if model := self.selectionModel():
|
||||||
|
# Selection model can be None (#2173)
|
||||||
|
model.clearCurrentIndex()
|
||||||
return
|
return
|
||||||
|
|
||||||
def _selectedRows(self) -> list[QModelIndex]:
|
def _selectedRows(self) -> list[QModelIndex]:
|
||||||
|
|||||||
Reference in New Issue
Block a user