Engauge Digitizer  2
Public Member Functions | List of all members
CmdUndoForTest Class Reference

Command for performing Undo during testing. More...

#include <CmdUndoForTest.h>

Inheritance diagram for CmdUndoForTest:
Inheritance graph
Collaboration diagram for CmdUndoForTest:
Collaboration graph

Public Member Functions

 CmdUndoForTest (MainWindow &mainWindow, Document &document)
 Constructor for normal creation. More...
 
 CmdUndoForTest (MainWindow &mainWindow, Document &document, const QString &cmdDescription, QXmlStreamReader &reader)
 Constructor for parsing error report file xml. More...
 
virtual ~CmdUndoForTest ()
 
virtual void cmdRedo ()
 Redo method that is called when QUndoStack is moved one command forward. More...
 
virtual void cmdUndo ()
 Undo method that is called when QUndoStack is moved one command backward. More...
 
virtual void saveXml (QXmlStreamWriter &writer) const
 Save commands as xml for later uploading. More...
 
- Public Member Functions inherited from CmdAbstract
 CmdAbstract (MainWindow &mainWindow, Document &document, const QString &cmdDescription)
 Single constructor. More...
 
virtual ~CmdAbstract ()
 

Additional Inherited Members

- Protected Member Functions inherited from CmdAbstract
Documentdocument ()
 Return the Document that this command will modify during redo and undo. More...
 
const Documentdocument () const
 Return a const copy of the Document for non redo/undo interaction. More...
 
MainWindowmainWindow ()
 Return the MainWindow so it can be updated by this command as a last step. More...
 
void resetSelection (const PointIdentifiers &pointIdentifiersToSelect)
 Since the set of selected points has probably changed, changed that set back to the specified set. More...
 
void saveOrCheckPostCommandDocumentStateHash (const Document &document)
 Save, when called the first time, a hash value representing the state of the Document. More...
 
void saveOrCheckPreCommandDocumentStateHash (const Document &document)
 Save, when called the first time, a hash value representing the state of the Document. More...
 

Detailed Description

Command for performing Undo during testing.

This command is never created automatically, since when the user triggers an Undo that just results in the command stack getting backed up by one command. This command is manually created by editing an xml test file

Definition at line 19 of file CmdUndoForTest.h.

Constructor & Destructor Documentation

◆ CmdUndoForTest() [1/2]

CmdUndoForTest::CmdUndoForTest ( MainWindow mainWindow,
Document document 
)

Constructor for normal creation.

Definition at line 17 of file CmdUndoForTest.cpp.

19  :
21  document,
23 {
24  LOG4CPP_INFO_S ((*mainCat)) << "CmdUndoForTest::CmdUndoForTest";

◆ CmdUndoForTest() [2/2]

CmdUndoForTest::CmdUndoForTest ( MainWindow mainWindow,
Document document,
const QString &  cmdDescription,
QXmlStreamReader &  reader 
)

Constructor for parsing error report file xml.

Definition at line 26 of file CmdUndoForTest.cpp.

30  :
32  document,
33  cmdDescription)
34 {
35  LOG4CPP_INFO_S ((*mainCat)) << "CmdUndoForTest::CmdUndoForTest";

◆ ~CmdUndoForTest()

CmdUndoForTest::~CmdUndoForTest ( )
virtual

Definition at line 37 of file CmdUndoForTest.cpp.

39 {

Member Function Documentation

◆ cmdRedo()

void CmdUndoForTest::cmdRedo ( )
virtual

Redo method that is called when QUndoStack is moved one command forward.

Implements CmdAbstract.

Definition at line 41 of file CmdUndoForTest.cpp.

43 {
44  LOG4CPP_INFO_S ((*mainCat)) << "CmdUndoForTest::cmdRedo";
45 
46  // Noop. Real Undo processing is performed externally on the command stack

◆ cmdUndo()

void CmdUndoForTest::cmdUndo ( )
virtual

Undo method that is called when QUndoStack is moved one command backward.

Implements CmdAbstract.

Definition at line 48 of file CmdUndoForTest.cpp.

50 {
51  LOG4CPP_INFO_S ((*mainCat)) << "CmdUndoForTest::cmdUndo";
52 
53  // Noop. Undo of an undo does not even make sense

◆ saveXml()

void CmdUndoForTest::saveXml ( QXmlStreamWriter &  writer) const
virtual

Save commands as xml for later uploading.

Implements CmdAbstract.

Definition at line 55 of file CmdUndoForTest.cpp.

57 {
58  // Noop. This command must be manually added to xml test files

The documentation for this class was generated from the following files:
CMD_DESCRIPTION
const QString CMD_DESCRIPTION("UndoForTest")
CmdAbstract::document
Document & document()
Return the Document that this command will modify during redo and undo.
Definition: CmdAbstract.cpp:35
LOG4CPP_INFO_S
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
mainCat
log4cpp::Category * mainCat
Definition: Logger.cpp:14
CmdAbstract::mainWindow
MainWindow & mainWindow()
Return the MainWindow so it can be updated by this command as a last step.
Definition: CmdAbstract.cpp:45
CmdAbstract
Wrapper around QUndoCommand. This simplifies the more complicated feature set of QUndoCommand.
Definition: CmdAbstract.h:18