
Public Member Functions | |
| CommandGroup (ContextItem *parent, const QString &des, bool historable=true) | |
| int | prepare_actions () |
| int | do_action () |
| int | undo_action () |
| void | add_command (Command *cmd) |
| int CommandGroup::prepare_actions | ( | ) | [virtual] |
Virtual function, needs to be reimplemented for all type of Commands
Use this function to do any kind of calculation or information gathering to be able to perform the actual action in do_action()
Reimplemented from Command.
References Command::prepare_actions().
| int CommandGroup::do_action | ( | ) | [virtual] |
Virtual function, needs to be reimplemented for all type of Commands
This function is called after the action is finished and each time the historystack 'redoes' an action.
Normally the data created in prepare_actions() will be used here to do the actuall action, which most of the case will be one or a few functions calls.
In case of a Single fact type of Command, you should also retrieve
the 'old' state here to be able to restore it in undo_action()
Reimplemented from Command.
References Command::do_action().
| int CommandGroup::undo_action | ( | ) | [virtual] |
Virtual function, needs to be reimplemented for all type of Commands
This function is called each time the historystack 'undoes' an action,
use prepare_actions(), or in case of a hold type command begin_hold() to
store the old value(s), your command will change in do_action(), and use
those here to restore the old state.
Reimplemented from Command.
References Command::undo_action().
1.5.5