fix delete function for BCAdisTS

disable_edition_parent_scenario
Dylan Jeannin 2026-05-04 14:52:31 +02:00
parent c014f0ef34
commit 102702e1df
1 changed files with 8 additions and 3 deletions

View File

@ -215,9 +215,14 @@ class TableModel(PamhyrTableModel):
def delete(self, rows, parent=QModelIndex()): def delete(self, rows, parent=QModelIndex()):
self.beginRemoveRows(parent, rows[0], rows[-1]) self.beginRemoveRows(parent, rows[0], rows[-1])
global_rows = list( row_by_bc = {
map(self._global_row, rows) id(bc): row for row, bc in enumerate(self._bc_list._lst)
) }
global_rows = [
row_by_bc[id(self._lst[row])]
for row in rows
if 0 <= row < len(self._lst)
]
self._undo.push( self._undo.push(
DelCommand( DelCommand(
self._bc_list, global_rows self._bc_list, global_rows