1 #include "CmdSettingsCoords.h"
2 #include "DocumentModelCoords.h"
4 #include "DocumentSerialize.h"
6 #include "MainWindow.h"
7 #include <QXmlStreamReader>
9 const QString CMD_DESCRIPTION (
"Coordinate settings");
18 m_modelCoordsBefore (modelCoordsBefore),
19 m_modelCoordsAfter (modelCoordsAfter)
21 LOG4CPP_INFO_S ((*mainCat)) <<
"CmdSettingsCoords::CmdSettingsCoords";
26 const QString &cmdDescription,
27 QXmlStreamReader &reader) :
32 LOG4CPP_INFO_S ((*mainCat)) <<
"CmdSettingsCoords::CmdSettingsCoords";
34 m_modelCoordsBefore.
loadXml (reader);
35 m_modelCoordsAfter.
loadXml (reader);
38 CmdSettingsCoords::~CmdSettingsCoords ()
44 LOG4CPP_INFO_S ((*mainCat)) <<
"CmdSettingsCoords::cmdRedo";
52 LOG4CPP_INFO_S ((*mainCat)) <<
"CmdSettingsCoords::cmdUndo";
60 writer.writeStartElement(DOCUMENT_SERIALIZE_CMD);
61 writer.writeAttribute(DOCUMENT_SERIALIZE_CMD_TYPE, DOCUMENT_SERIALIZE_CMD_SETTINGS_COORDS);
62 writer.writeAttribute(DOCUMENT_SERIALIZE_CMD_DESCRIPTION, QUndoCommand::text ());
63 m_modelCoordsBefore.
saveXml(writer);
64 m_modelCoordsAfter.
saveXml(writer);
65 writer.writeEndElement();
virtual void cmdRedo()
Redo method that is called when QUndoStack is moved one command forward.
virtual void saveXml(QXmlStreamWriter &writer) const
Save commands as xml for later uploading.
Wrapper around QUndoCommand. This simplifies the more complicated feature set of QUndoCommand.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
CmdSettingsCoords(MainWindow &mainWindow, Document &document, const DocumentModelCoords &modelCoordsBefore, const DocumentModelCoords &modelCoordsAfter)
Constructor for normal creation.
MainWindow & mainWindow()
Return the MainWindow so it can be updated by this command as a last step.
Model for DlgSettingsCoords and CmdSettingsCoords.
void updateAfterCommand()
See GraphicsScene::updateAfterCommand.
Storage of one imported image and the data attached to that image.
void updateSettingsCoords(const DocumentModelCoords &modelCoords)
Update with new coordinate properties.
virtual void cmdUndo()
Undo method that is called when QUndoStack is moved one command backward.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...