@@ -553,11 +560,48 @@ information than a classic QAbstractTableModel class.
"bar": self.my_delegate, # Custom delegate for column 'bar'
},
data = self._my_lst, # The data
undo = self._undo_stack, # The undo command stack
undo = self._undo_stack, # The window undo command stack
)
#+end_src
*** UndoCommand
All model modification must be done by an QUndoCommand, this command
allow to undo and redo an action. This a Qt class wi can inherit to
define custom undo command (see example Listing [[undo-cmd]])
#+NAME: undo-cmd
#+CAPTION: Example of custom UndoCommand, this command allow to add a node to graph in river network window (method redo), and delete it to graph with undo method