mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Pollutants: specific way to check if we modified the data in the type combobox
This commit is contained in:
1 parent
fb8b5aa77f
commit
e573fa4197
1 file changed
+9
@@ -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
|
||||
|
||||
Reference in new issue
Block a user