Engauge Digitizer 2
Loading...
Searching...
No Matches
Public Slots | Public Member Functions | List of all members
CmdStackShadow Class Reference

Command stack that shadows the CmdMediator command stack at startup when reading commands from an error report file. More...

#include <CmdStackShadow.h>

Inheritance diagram for CmdStackShadow:

Public Slots

void slotRedo ()
 Move next command from list to CmdMediator. Noop if there are no more commands.
 
void slotUndo ()
 Throw away every command since trying to reconcile two different command stacks after an undo is too dangerous.
 

Public Member Functions

 CmdStackShadow ()
 Single constructor.
 
bool canRedo () const
 Return true if there is a command available.
 
void loadCommands (MainWindow &mainWindow, Document &document, QXmlStreamReader &reader)
 Load commands from serialized xml.
 

Detailed Description

Command stack that shadows the CmdMediator command stack at startup when reading commands from an error report file.

The commands are loaded into this container rather than CmdMediator, since CmdMediator would try to execute all the commands immediately. For the best debugging, we want to be able to execute each command one by one. This container nicely stores commands until we want to copy them to CmdMediator so they can be executed.

This class is not subclassed from QUndoStack since that class is designed to prevent access to individual commands, to preserve their integrity

This class is not named CmdMediatorShadow since does not maintain a Document like CmdMediator, although in some ways that name might be a useful alias

Definition at line 30 of file CmdStackShadow.h.

Constructor & Destructor Documentation

◆ CmdStackShadow()

CmdStackShadow::CmdStackShadow ( )

Single constructor.

Definition at line 19 of file CmdStackShadow.cpp.

Member Function Documentation

◆ canRedo()

bool CmdStackShadow::canRedo ( ) const

Return true if there is a command available.

Definition at line 25 of file CmdStackShadow.cpp.

◆ loadCommands()

void CmdStackShadow::loadCommands ( MainWindow mainWindow,
Document document,
QXmlStreamReader &  reader 
)

Load commands from serialized xml.

Definition at line 34 of file CmdStackShadow.cpp.

◆ slotRedo

void CmdStackShadow::slotRedo ( )
slot

Move next command from list to CmdMediator. Noop if there are no more commands.

Definition at line 58 of file CmdStackShadow.cpp.

◆ slotUndo

void CmdStackShadow::slotUndo ( )
slot

Throw away every command since trying to reconcile two different command stacks after an undo is too dangerous.

Definition at line 74 of file CmdStackShadow.cpp.


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