1 #ifndef UNDOCOMMANDFROMACTION_H 2 #define UNDOCOMMANDFROMACTION_H 4 #include <QUndoCommand> 22 template<
typename Func1,
typename Func2>
43 : QUndoCommand(text, parent)
47 std::function<void()> mRedo;
48 std::function<void()> mUndo;
51 #endif // UNDOCOMMANDFROMACTION_H static UndoCommandFromFunctions * make(Func1 redo, Func2 undo, const QString &text="", QUndoCommand *parent=nullptr)
performCommand Creates the command and performs it immediately.
Definition: undocommandfromfunctions.h:23
void undo() override
Definition: undocommandfromfunctions.h:35
Creates an undo command that invokes the provided functions on undo() and redo(). ...
Definition: undocommandfromfunctions.h:14
void redo() override
Definition: undocommandfromfunctions.h:30