Editor API
UnigineEditor public API
UnigineEditor::Undo Class Reference

Undo manager class. This class is used to manage undo/redo operations for user actions in the Editor. More...

#include <UnigineUndo.h>

Inherits QObject.

Signals

void worldModified ()
 This signal is emitted when an action brings any changes to the scene. More...
 
void activity ()
 This signal is emitted when an action has been applied, undone, redone, or pushed to transaction stack. More...
 

Static Public Member Functions

static Undoinstance ()
 Returns the instance of the Undo class. This method is used to subscribe to signals. More...
 
static void apply (Action *action)
 Applies the specified action. More...
 
static void push (Action *action)
 Pushes the specified action to the transaction stack. More...
 
static void undo ()
 Reverts the last action in the stack. More...
 
static void redo ()
 Redoes the last action that was undone (reverses the undo method). More...
 
static void reset ()
 Clears the undo/redo stack. More...
 
static void begin ()
 Begins a transaction (i.e. a sequence of actions applied to be applied or reverted as a whole). Use commit() to apply all actions of the current transaction, or rollback() to revert them. More...
 
static void commit ()
 Commits the last transaction (i.e. a sequence of actions applied since the last call of the begin() method). More...
 
static void rollback ()
 Reverts the last transaction (i.e. a sequence of actions applied since the last call of the begin() method). More...
 

Detailed Description

Undo manager class. This class is used to manage undo/redo operations for user actions in the Editor.

Member Function Documentation

◆ activity

void UnigineEditor::Undo::activity ( )
signal

This signal is emitted when an action has been applied, undone, redone, or pushed to transaction stack.

◆ apply()

static void UnigineEditor::Undo::apply ( Action action)
static

Applies the specified action.

Parameters
actionAction to be applied.

◆ begin()

static void UnigineEditor::Undo::begin ( )
static

Begins a transaction (i.e. a sequence of actions applied to be applied or reverted as a whole). Use commit() to apply all actions of the current transaction, or rollback() to revert them.

◆ commit()

static void UnigineEditor::Undo::commit ( )
static

Commits the last transaction (i.e. a sequence of actions applied since the last call of the begin() method).

◆ instance()

static Undo* UnigineEditor::Undo::instance ( )
static

Returns the instance of the Undo class. This method is used to subscribe to signals.

Returns
Undo class instance.

Example:

, this, &SomeClass::world_modified);

◆ push()

static void UnigineEditor::Undo::push ( Action action)
static

Pushes the specified action to the transaction stack.

Parameters
actionAction to be pushed.

◆ redo()

static void UnigineEditor::Undo::redo ( )
static

Redoes the last action that was undone (reverses the undo method).

◆ reset()

static void UnigineEditor::Undo::reset ( )
static

Clears the undo/redo stack.

◆ rollback()

static void UnigineEditor::Undo::rollback ( )
static

Reverts the last transaction (i.e. a sequence of actions applied since the last call of the begin() method).

◆ undo()

static void UnigineEditor::Undo::undo ( )
static

Reverts the last action in the stack.

◆ worldModified

void UnigineEditor::Undo::worldModified ( )
signal

This signal is emitted when an action brings any changes to the scene.