Walls And Holes  1
UndoCommandFromFunctions Class Reference

Creates an undo command that invokes the provided functions on undo() and redo(). More...

#include <undocommandfromfunctions.h>

Inheritance diagram for UndoCommandFromFunctions:
Collaboration diagram for UndoCommandFromFunctions:

Public Member Functions

void redo () override
 
void undo () override
 

Static Public Member Functions

template<typename Func1 , typename Func2 >
static UndoCommandFromFunctionsmake (Func1 redo, Func2 undo, const QString &text="", QUndoCommand *parent=nullptr)
 performCommand Creates the command and performs it immediately. More...
 

Detailed Description

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.

Member Function Documentation

◆ 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
redoThe function to call on redo.
undoThe function to call on undo.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ redo()

void UndoCommandFromFunctions::redo ( )
inlineoverride
Here is the caller graph for this function:

◆ undo()

void UndoCommandFromFunctions::undo ( )
inlineoverride
Here is the caller graph for this function:

The documentation for this class was generated from the following file: