BC: Edit: Fix update plot.

This commit is contained in:
Pierre-Antoine Rouby committed 2023-05-04 10:22:39 +02:00
1 parent 63d7541062
commit f8355021e7
2 files changed
+23 -4

No files matched your search

+15
View File
@@ -95,6 +95,11 @@ class EditBoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
self.copy_sc.activated.connect(self.copy)
self.paste_sc.activated.connect(self.paste)
self._table.dataChanged.connect(self.update)
def update(self):
self.plot.update()
def index_selected_row(self):
table = self.find(QTableView, "tableView")
return table.selectionModel()\
@@ -121,33 +126,43 @@ class EditBoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
else:
self._table.add(rows[0])
self.plot.update()
def delete(self):
rows = self.index_selected_rows()
if len(rows) == 0:
return
self._table.delete(rows)
self.plot.update()
def sort(self):
self._table.sort(False)
self.plot.update()
def move_up(self):
row = self.index_selected_row()
self._table.move_up(row)
self.plot.update()
def move_down(self):
row = self.index_selected_row()
self._table.move_down(row)
self.plot.update()
def copy(self):
print("TODO")
self.plot.update()
def paste(self):
print("TODO")
self.plot.update()
def undo(self):
self._table.undo()
self.plot.update()
def redo(self):
self._table.redo()
self.plot.update()