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

Command for removing one X/T Guideline value. More...

#include <CmdGuidelineRemoveXT.h>

Inheritance diagram for CmdGuidelineRemoveXT:
Inheritance graph
Collaboration diagram for CmdGuidelineRemoveXT:
Collaboration graph

Public Member Functions

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

Additional Inherited Members

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

Detailed Description

Command for removing one X/T Guideline value.

Definition at line 16 of file CmdGuidelineRemoveXT.h.

Constructor & Destructor Documentation

◆ CmdGuidelineRemoveXT() [1/2]

CmdGuidelineRemoveXT::CmdGuidelineRemoveXT ( MainWindow & mainWindow,
Document & document,
const QString & identifier,
double valueBefore )

Constructor for normal creation.

Definition at line 16 of file CmdGuidelineRemoveXT.cpp.

19 :
23 m_identifier (identifier),
24 m_valueBefore (valueBefore)
25{
26 LOG4CPP_INFO_S ((*mainCat)) << "CmdGuidelineRemoveXT::CmdGuidelineRemoveXT";
27}
const QString CMD_DESCRIPTION("Add axis point")
const int INNER_RADIUS_MIN
log4cpp::Category * mainCat
Definition Logger.cpp:14
Wrapper around QUndoCommand. This simplifies the more complicated feature set of QUndoCommand.
Definition CmdAbstract.h:20
Document & document()
Return the Document that this command will modify during redo and undo.
MainWindow & mainWindow()
Return the MainWindow so it can be updated by this command as a last step.
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

◆ CmdGuidelineRemoveXT() [2/2]

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

Constructor for parsing error report file xml.

Definition at line 29 of file CmdGuidelineRemoveXT.cpp.

32 :
35 cmdDescription)
36{
37 LOG4CPP_INFO_S ((*mainCat)) << "CmdGuidelineRemoveXT::CmdGuidelineRemoveXT";
38
40
41 if (!attributes.hasAttribute(DOCUMENT_SERIALIZE_IDENTIFIER) ||
44 QString ("%1 %2 %3 %4")
45 .arg (QObject::tr ("Missing attribute(s)"))
47 .arg (QObject::tr ("and/or"))
49 }
50
51 m_identifier = attributes.value(DOCUMENT_SERIALIZE_IDENTIFIER).toString();
52 m_valueBefore = attributes.value(DOCUMENT_SERIALIZE_GRAPH_BEFORE).toDouble();
53}
const QString DOCUMENT_SERIALIZE_IDENTIFIER
const QString DOCUMENT_SERIALIZE_GRAPH_BEFORE
void xmlExitWithError(QXmlStreamReader &reader, const QString &message)
Show specified message for an error while reading xml, then quit.
Definition Xml.cpp:25

◆ ~CmdGuidelineRemoveXT()

CmdGuidelineRemoveXT::~CmdGuidelineRemoveXT ( )
virtual

Definition at line 55 of file CmdGuidelineRemoveXT.cpp.

56{
57}

Member Function Documentation

◆ cmdRedo()

void CmdGuidelineRemoveXT::cmdRedo ( )
virtual

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

Implements CmdAbstract.

Definition at line 59 of file CmdGuidelineRemoveXT.cpp.

60{
61 LOG4CPP_INFO_S ((*mainCat)) << "CmdGuidelineRemoveXT::cmdRedo"
62 << " identifier=" << m_identifier.toLatin1().data();
63
64 mainWindow().guidelineRemove (m_identifier);
65}
void guidelineRemove(const QString &identifier)
Remove a X/T or Y/R Guideline.

◆ cmdUndo()

void CmdGuidelineRemoveXT::cmdUndo ( )
virtual

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

Implements CmdAbstract.

Definition at line 67 of file CmdGuidelineRemoveXT.cpp.

68{
69 LOG4CPP_INFO_S ((*mainCat)) << "CmdGuidelineRemoveXT::cmdUndo"
70 << " identifier=" << m_identifier.toLatin1().data()
71 << " value=" << m_valueBefore;
72
73 mainWindow().guidelineAddXT (m_identifier,
74 m_valueBefore);
75}
void guidelineAddXT(const QString &identifier, double xT)
Add a X/T Guideline.

◆ saveXml()

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

Save commands as xml for later uploading.

Implements CmdAbstract.

Definition at line 77 of file CmdGuidelineRemoveXT.cpp.

78{
79 writer.writeStartElement(DOCUMENT_SERIALIZE_CMD);
81 writer.writeAttribute(DOCUMENT_SERIALIZE_CMD_DESCRIPTION, QUndoCommand::text ());
82 writer.writeAttribute(DOCUMENT_SERIALIZE_IDENTIFIER, m_identifier);
83 writer.writeAttribute(DOCUMENT_SERIALIZE_GRAPH_BEFORE, QString::number (m_valueBefore));
84 writer.writeEndElement();
85}
const QString DOCUMENT_SERIALIZE_CMD
const QString DOCUMENT_SERIALIZE_CMD_TYPE
const QString DOCUMENT_SERIALIZE_CMD_GUIDELINE_REMOVE_X_T
const QString DOCUMENT_SERIALIZE_CMD_DESCRIPTION

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