mirror of https://gitlab.com/pamhyr/pamhyr2
Pollutants: specific way to check if we modified the data in the type combobox
parent
fb8b5aa77f
commit
e573fa4197
|
|
@ -96,6 +96,15 @@ class ComboBoxDelegate(QItemDelegate):
|
||||||
|
|
||||||
|
|
||||||
class TableModel(PamhyrTableModel):
|
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):
|
def data(self, index, role):
|
||||||
if role == Qt.TextAlignmentRole:
|
if role == Qt.TextAlignmentRole:
|
||||||
return Qt.AlignHCenter | Qt.AlignVCenter
|
return Qt.AlignHCenter | Qt.AlignVCenter
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue