Engauge Digitizer  2
Public Member Functions | Protected Member Functions | List of all members
CmdAbstract Class Referenceabstract

Wrapper around QUndoCommand. This simplifies the more complicated feature set of QUndoCommand. More...

#include <CmdAbstract.h>

Inheritance diagram for CmdAbstract:
CmdCopy CmdPointChangeBase CmdRedoForTest CmdSelectCoordSystem CmdSettingsAxesChecker CmdSettingsColorFilter CmdSettingsCoords CmdSettingsCurveAddRemove CmdSettingsCurveProperties CmdSettingsDigitizeCurve CmdSettingsExportFormat CmdSettingsGeneral CmdSettingsGridDisplay CmdSettingsGridRemoval CmdSettingsPointMatch CmdSettingsSegments CmdUndoForTest

Public Member Functions

 CmdAbstract (MainWindow &mainWindow, Document &document, const QString &cmdDescription)
 Single constructor.
 
virtual void cmdRedo ()=0
 Redo method that is called when QUndoStack is moved one command forward.
 
virtual void cmdUndo ()=0
 Undo method that is called when QUndoStack is moved one command backward.
 
virtual void saveXml (QXmlStreamWriter &writer) const =0
 Save commands as xml for later uploading.
 

Protected Member Functions

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. 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

Wrapper around QUndoCommand. This simplifies the more complicated feature set of QUndoCommand.

Definition at line 19 of file CmdAbstract.h.

Member Function Documentation

◆ resetSelection()

void CmdAbstract::resetSelection ( const PointIdentifiers pointIdentifiersToSelect)
protected

Since the set of selected points has probably changed, changed that set back to the specified set.

This lets the user move selected point(s) repeatedly using arrow keys. Also provides expected behavior when pasting

Definition at line 81 of file CmdAbstract.cpp.

◆ saveOrCheckPostCommandDocumentStateHash()

void CmdAbstract::saveOrCheckPostCommandDocumentStateHash ( const Document document)
protected

Save, when called the first time, a hash value representing the state of the Document.

Then on succeeding calls the hash is recomputed and compared to the original value to check for consistency. This "post" method is called immediately after the redo method of the subclass has done its processing. See also saveOrCheckPreCommandDocumentState

Definition at line 102 of file CmdAbstract.cpp.

◆ saveOrCheckPreCommandDocumentStateHash()

void CmdAbstract::saveOrCheckPreCommandDocumentStateHash ( const Document document)
protected

Save, when called the first time, a hash value representing the state of the Document.

Then on succeeding calls the hash is recomputed and compared to the original value to check for consistency. This "pre" method is called immediately after the redo method of the subclass has done its processing. See also saveOrCheckPostCommandDocumentState

Definition at line 125 of file CmdAbstract.cpp.


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