Pollutants: specific way to check if we modified the data in the type combobox

dev_dylan
Dylan Jeannin 2026-05-27 09:35:10 +02:00
parent fb8b5aa77f
commit e573fa4197
1 changed files with 9 additions and 0 deletions

View File

@ -96,6 +96,15 @@ class ComboBoxDelegate(QItemDelegate):
class TableModel(PamhyrTableModel):
def is_same_data(self, index, value):
row = index.row()
column = index.column()
if self._headers[column] == "type":
return int(self._data.data[row][column]) == int(value)
return super(TableModel, self).is_same_data(index, value)
def data(self, index, role):
if role == Qt.TextAlignmentRole:
return Qt.AlignHCenter | Qt.AlignVCenter