gui/models: Add DictSyncModel default args to match C++ [nfc]

This commit is contained in:
David Nadlinger 2024-09-02 18:35:41 +01:00 committed by Sébastien Bourdeauducq
parent 5912142836
commit 4e654011c3
1 changed files with 4 additions and 4 deletions

View File

@ -84,20 +84,20 @@ class DictSyncModel(QtCore.QAbstractTableModel):
key=lambda k: self.sort_key(k, self.backing_store[k]))
QtCore.QAbstractTableModel.__init__(self)
def rowCount(self, parent):
def rowCount(self, parent=QtCore.QModelIndex()):
return len(self.backing_store)
def columnCount(self, parent):
def columnCount(self, parent=QtCore.QModelIndex()):
return len(self.headers)
def data(self, index, role):
def data(self, index, role=QtCore.Qt.ItemDataRole.DisplayRole):
if not index.isValid() or role != QtCore.Qt.ItemDataRole.DisplayRole:
return None
else:
k = self.row_to_key[index.row()]
return self.convert(k, self.backing_store[k], index.column())
def headerData(self, col, orientation, role):
def headerData(self, col, orientation, role=QtCore.Qt.ItemDataRole.DisplayRole):
if (orientation == QtCore.Qt.Orientation.Horizontal and
role == QtCore.Qt.ItemDataRole.DisplayRole):
return self.headers[col]