My program consists of several QLineEdit in my QMainWindow . The user can change the text in any QLineEdit . I can currently cancel the default re-implementation for each QLineEdit when the corresponding QLineEdit selected. However, I want to add functionality so that when you press the cancel buttons * redo *, the appropriately edited QLineEdit will cancel / redo. i.e. L1, L2, etc. are my QLineEdit . Then the user performs the following actions: 1. L2-> text added ... 5. L5-> text added ... 9. L3-> text deleted 10. L5-> undo (by choosing L5 and then "ctrl + z" )
Now, when the user presses the Undo / Redo button as follows: 1. Undo β Undo the undo in step 10 2. Undo β Undo the text deleted in step 9 3. Repeat β Undo the text deleted in step 9 4. Undo β You must cancel the operation in step 8
Currently, I can vaguely think about the mechanism for creating History, but it will be quite tiring. So I would like to know if Qt provides any built-in functions for this? Thanks.
Cool_coder
source share