[ fromfile: commandpattern.xml id: commandpattern ]
Providing reversal actions (undo) in your software reduces anxiety and encourages experimentation in your users. This can be a better choice than a confirmation dialog. Qt provides classes that make it easier to write your application with undo capability.
Implementing the Command Pattern is particularly easy with Qt.
You can create several commands and queue them in an appropriate container (e.g., QQueue).
A QUndoCommand can be executed by pushing it onto a QUndoStack.
If commands need to be executed concurrently, you can derive them from QRunnable and schedule them in a thread pool with QtConcurrent::Run()
.[78]
You might serialize commands to a file and load them again later (perhaps on another machine) for batch or distributed execution [79]
Generated: 2012-03-02 | © 2012 Alan Ezust and Paul Ezust. |