From 4e654011c3d86b64e1a4b102002ed919db63066e Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Mon, 2 Sep 2024 18:35:41 +0100 Subject: [PATCH] gui/models: Add DictSyncModel default args to match C++ [nfc] --- artiq/gui/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/artiq/gui/models.py b/artiq/gui/models.py index 810fa4505..a6a316367 100644 --- a/artiq/gui/models.py +++ b/artiq/gui/models.py @@ -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]