Tome
A generic data editor for games supporting arbitrary input and output formats.
Signals | Public Member Functions | List of all members
Tome::UndoController Class Reference

Controller for performing undo-able commands. More...

#include <undocontroller.h>

Inheritance diagram for Tome::UndoController:

Signals

void undoStackChanged (bool clean)
 Undo stack has become dirty or clean. More...
 

Public Member Functions

 UndoController ()
 Constructs a new controller for performing undo-able commands.
 
void clear ()
 Removes all recent undo-able commands from the undo stack.
 
QAction * createRedoAction (QObject *parent, const QString &prefix)
 Creates an action for re-doing the most recently undone command. More...
 
QAction * createUndoAction (QObject *parent, const QString &prefix)
 Creates an action for un-doing the most recent command. More...
 
void doCommand (QUndoCommand *command)
 Applies the passed command, pushing it to the undo stack. More...
 
bool isClean () const
 Whether any commands have been applied since the project was opened or saved. More...
 
void setClean ()
 Marks the undo stack as clean, as if no commands have been applied since the project was opened or saved.
 

Detailed Description

Controller for performing undo-able commands.

Member Function Documentation

◆ createRedoAction()

QAction * UndoController::createRedoAction ( QObject *  parent,
const QString &  prefix 
)

Creates an action for re-doing the most recently undone command.

Parameters
parentParent of the action to create.
prefixPrefix to show before the name of the command to redo.
Returns
Action for re-doing the most recently undone command.

◆ createUndoAction()

QAction * UndoController::createUndoAction ( QObject *  parent,
const QString &  prefix 
)

Creates an action for un-doing the most recent command.

Parameters
parentParent of the action to create.
prefixPrefix to show before the name of the command to undo.
Returns
Action for re-doing the most recent command.

◆ doCommand()

void UndoController::doCommand ( QUndoCommand *  command)

Applies the passed command, pushing it to the undo stack.

Parameters
commandCommand to apply.

◆ isClean()

bool UndoController::isClean ( ) const

Whether any commands have been applied since the project was opened or saved.

Returns
Whether any commands have been applied since the project was opened or saved, or not.

◆ undoStackChanged

void Tome::UndoController::undoStackChanged ( bool  clean)
signal

Undo stack has become dirty or clean.

Parameters
cleanWhether no commands have been applied since the project was opened or saved.

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