Use Ruff for linting and fix a ton of issues

This commit is contained in:
Veronica Berglyd Olsen
2025-04-03 01:15:52 +02:00
parent d2796d27c3
commit 53a2d0e691
43 changed files with 257 additions and 235 deletions
+2 -1
View File
@@ -333,8 +333,9 @@ class ProjectModel(QAbstractItemModel):
return self.createIndex(parent.row(), 0, parent)
return QModelIndex()
def index(self, row: int, column: int, parent: QModelIndex = QModelIndex()) -> QModelIndex:
def index(self, row: int, column: int, parent: QModelIndex | None = None) -> QModelIndex:
"""Get the index of a child item of a parent."""
parent = parent or QModelIndex()
if self.hasIndex(row, column, parent):
node: ProjectNode = parent.internalPointer() if parent.isValid() else self._root
if child := node.child(row):