It's usually neatest to wrap manipulations to the document in a 'Command' (src/commands/*).

Commands know how to undo themselves. When you add a command to the history (e.g. via 'RosegardenGUIDoc::getCommandHistory()→addCommand(my_command);'), the command will be executed and added to the undo history.

Adding a command to the history also sets the 'modified'-flag for the document, which is used to popup a 'do you want to save your changes?' when needed. If you have to make changes in some other way, you have to make sure that gets set in some other way (e.g. RosegardenGUIDoc::slotDocumentModified()).

dev/manipulating_the_document.txt · Last modified: 2022/05/06 16:07 (external edit)
Recent changes RSS feed Creative Commons License Valid XHTML 1.0 Valid CSS Driven by DokuWiki