Creates an undo command that invokes the provided functions on undo() and redo().
More...
#include <undocommandfromfunctions.h>
|
void | redo () override |
|
void | undo () override |
|
|
template<typename Func1 , typename Func2 > |
static UndoCommandFromFunctions * | make (Func1 redo, Func2 undo, const QString &text="", QUndoCommand *parent=nullptr) |
| performCommand Creates the command and performs it immediately. More...
|
|
Creates an undo command that invokes the provided functions on undo() and redo().
This is helpful when the undo / redo code already exists as a method for some other object.
◆ make()
template<typename Func1 , typename Func2 >
static UndoCommandFromFunctions* UndoCommandFromFunctions::make |
( |
Func1 |
redo, |
|
|
Func2 |
undo, |
|
|
const QString & |
text = "" , |
|
|
QUndoCommand * |
parent = nullptr |
|
) |
| |
|
inlinestatic |
performCommand Creates the command and performs it immediately.
- Parameters
-
redo | The function to call on redo. |
undo | The function to call on undo. |
◆ redo()
void UndoCommandFromFunctions::redo |
( |
| ) |
|
|
inlineoverride |
◆ undo()
void UndoCommandFromFunctions::undo |
( |
| ) |
|
|
inlineoverride |
The documentation for this class was generated from the following file: