Engauge Digitizer
2
Cmd
CmdUndoForTest.cpp
1
/******************************************************************************************************
2
* (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3
* under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4
* LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5
******************************************************************************************************/
6
7
#include "CmdUndoForTest.h"
8
#include "DataKey.h"
9
#include "Document.h"
10
#include "DocumentSerialize.h"
11
#include "Logger.h"
12
#include "MainWindow.h"
13
#include <QXmlStreamReader>
14
#include "Xml.h"
15
16
const
QString CMD_DESCRIPTION (
"UndoForTest"
);
17
18
CmdUndoForTest::CmdUndoForTest
(
MainWindow
&mainWindow,
19
Document
&document) :
20
CmdAbstract
(mainWindow,
21
document,
22
CMD_DESCRIPTION)
23
{
24
LOG4CPP_INFO_S ((*mainCat)) <<
"CmdUndoForTest::CmdUndoForTest"
;
25
}
26
27
CmdUndoForTest::CmdUndoForTest
(
MainWindow
&
mainWindow
,
28
Document
&
document
,
29
const
QString &cmdDescription,
30
QXmlStreamReader &
/* reader */
) :
31
CmdAbstract
(mainWindow,
32
document,
33
cmdDescription)
34
{
35
LOG4CPP_INFO_S ((*mainCat)) <<
"CmdUndoForTest::CmdUndoForTest"
;
36
}
37
38
CmdUndoForTest::~CmdUndoForTest ()
39
{
40
}
41
42
void
CmdUndoForTest::cmdRedo
()
43
{
44
LOG4CPP_INFO_S ((*mainCat)) <<
"CmdUndoForTest::cmdRedo"
;
45
46
// Noop. Real Undo processing is performed externally on the command stack
47
}
48
49
void
CmdUndoForTest::cmdUndo
()
50
{
51
LOG4CPP_INFO_S ((*mainCat)) <<
"CmdUndoForTest::cmdUndo"
;
52
53
// Noop. Undo of an undo does not even make sense
54
}
55
56
void
CmdUndoForTest::saveXml
(QXmlStreamWriter &
/* writer */
)
const
57
{
58
// Noop. This command must be manually added to xml test files
59
}
CmdAbstract
Wrapper around QUndoCommand. This simplifies the more complicated feature set of QUndoCommand.
Definition:
CmdAbstract.h:19
CmdUndoForTest::CmdUndoForTest
CmdUndoForTest(MainWindow &mainWindow, Document &document)
Constructor for normal creation.
Definition:
CmdUndoForTest.cpp:18
CmdUndoForTest::cmdRedo
virtual void cmdRedo()
Redo method that is called when QUndoStack is moved one command forward.
Definition:
CmdUndoForTest.cpp:42
CmdUndoForTest::saveXml
virtual void saveXml(QXmlStreamWriter &writer) const
Save commands as xml for later uploading.
Definition:
CmdUndoForTest.cpp:56
CmdUndoForTest::cmdUndo
virtual void cmdUndo()
Undo method that is called when QUndoStack is moved one command backward.
Definition:
CmdUndoForTest.cpp:49
CmdAbstract::mainWindow
MainWindow & mainWindow()
Return the MainWindow so it can be updated by this command as a last step.
Definition:
CmdAbstract.cpp:45
Document
Storage of one imported image and the data attached to that image.
Definition:
Document.h:41
CmdAbstract::document
Document & document()
Return the Document that this command will modify during redo and undo.
Definition:
CmdAbstract.cpp:35
MainWindow
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition:
MainWindow.h:89
Generated on Sat Oct 21 2017 12:50:35 for Engauge Digitizer by
1.8.13