HS: Fix checkbox state at undo add command.

setup.py
Pierre-Antoine Rouby 2023-12-11 11:12:57 +01:00
parent 6951b82339
commit ac2a2002b7
1 changed files with 5 additions and 7 deletions

View File

@ -164,14 +164,10 @@ class HydraulicStructuresWindow(PamhyrWindow):
self._checkbox.stateChanged.connect(self._set_structure_state)
table = self.find(QTableView, "tableView")
table.selectionModel()\
.selectionChanged\
.connect(self._set_checkbox_state)
table.selectionModel()\
.selectionChanged\
.connect(self.update)
#self._delegate_kp.currentItemChanged.connect(lambda:x, print("toto"))
#self._delegate_reach.currentItemChanged.connect(lambda:x, print("titi"))
self._table.dataChanged.connect(self.update)
self._table.layoutChanged.connect(self.update)
@ -266,6 +262,8 @@ class HydraulicStructuresWindow(PamhyrWindow):
self._hs_lst.get(row).enabled = self._checkbox.isChecked()
def update(self):
self._set_checkbox_state()
rows = self.index_selected_rows()
if len(rows) > 0 and len(self._hs_lst) > 0: