mirror of https://gitlab.com/pamhyr/pamhyr2
fix delete function for BCAdisTS
parent
c014f0ef34
commit
102702e1df
|
|
@ -215,9 +215,14 @@ class TableModel(PamhyrTableModel):
|
|||
def delete(self, rows, parent=QModelIndex()):
|
||||
self.beginRemoveRows(parent, rows[0], rows[-1])
|
||||
|
||||
global_rows = list(
|
||||
map(self._global_row, rows)
|
||||
)
|
||||
row_by_bc = {
|
||||
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(
|
||||
DelCommand(
|
||||
self._bc_list, global_rows
|
||||
|
|
|
|||
Loading…
Reference in New Issue