hi all,
i hav to implement undo and redo functionality in my project. The purpose is to cancel (undo) or redo some actions of cut copy paste etc. are there some existing functions for this. or i hav to make my own.
ne ideas ???
hi all,
i hav to implement undo and redo functionality in my project. The purpose is to cancel (undo) or redo some actions of cut copy paste etc. are there some existing functions for this. or i hav to make my own.
ne ideas ???
Do what u r afraid to do, and the death of fear is sure.
What actually you want do with "Undo", "Redo" buttons?
a life without programming is like an empty bottle
Qt Solutions: Undo/Redo Framework
And there is a design pattern called Command which fits for undo/redo purposes.
ankurjain (28th March 2006)
ankurjain, if you wnat to do it manually, I did it in a photo editor. I used a list of "identificators" of the operators that the user has executed.
hi zlatko,
i m having a table. if i cut the contents of the table on undo it must paste back the contents in it. on redo it must again cut. such operations that are generally done on excel file.
hi SkripT,
can u explain a bit by code, how u did it.
Do what u r afraid to do, and the death of fear is sure.
I think that could be more complex ways to do it, but what I do is everytime that the user executes an action that can be "undoned" I insert its identificator (I have an enum with all the identificator for all the actions) in a QList that I use it like a queue of operators. As you may notice you need also a list for each kind of variables that you enter in each action to execute it. Then when the user wants to undo the last operation, what I do is execute again all the operations in the list till the last operation. How this could be lengthy what I do is clear the list of operations after some operations. I repeat that I use it for a photo editor maybe in your case could differOriginally Posted by ankurjain
Last edited by SkripT; 28th March 2006 at 14:59.
Bookmarks