13#include <QXmlStreamReader>
27 m_curvesGraphsBefore =
document.curvesGraphs ();
30 for (
int row = 0; row < modelCurves.
rowCount (); row++) {
34 QString curveNameCurrent = modelCurves.data (idxCurrent).toString ();
36 if (!curveNameOriginal.isEmpty ()) {
41 Curve curveCurrent (*curveOriginal);
44 m_curvesGraphsAfter.addGraphCurveAtEnd (curveCurrent);
49 Curve curveCurrent (curveNameCurrent,
54 m_curvesGraphsAfter.addGraphCurveAtEnd (curveCurrent);
61 const QString &cmdDescription,
62 QXmlStreamReader &reader) :
73 while ((reader.tokenType() != QXmlStreamReader::EndElement) ||
79 .arg (QObject::tr (
"Reached end of file before finding end element for"))
85 if ((reader.tokenType() == QXmlStreamReader::StartElement) &&
90 m_curvesGraphsBefore.loadXml (reader);
95 m_curvesGraphsAfter.loadXml (reader);
102 reader.raiseError (
"Cannot read curve add/remove settings");
138 m_curvesGraphsBefore.saveXml(writer);
139 m_curvesGraphsAfter.saveXml(writer);
140 writer.writeEndElement();
const QString CMD_DESCRIPTION("Add axis point")
const QString CMD_DESCRIPTION("Curve list")
@ CURVE_NAME_LIST_COLUMN_CURRENT
const QString DOCUMENT_SERIALIZE_CURVES_GRAPHS
const QString DOCUMENT_SERIALIZE_CMD_SETTINGS_CURVE_LIST
const QString DOCUMENT_SERIALIZE_CMD
const QString DOCUMENT_SERIALIZE_CMD_TYPE
const QString DOCUMENT_SERIALIZE_CMD_DESCRIPTION
log4cpp::Category * mainCat
QXmlStreamReader::TokenType loadNextFromReader(QXmlStreamReader &reader)
Load next token from xml reader.
void xmlExitWithError(QXmlStreamReader &reader, const QString &message)
Show specified message for an error while reading xml, then quit.
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.
void saveOrCheckPostCommandDocumentStateHash(const Document &document)
Save, when called the first time, a hash value representing the state of the Document.
void restoreState()
Before any other operations associated with a Cmd class are performed, this method is called to resto...
void saveOrCheckPreCommandDocumentStateHash(const Document &document)
Save, when called the first time, a hash value representing the state of the Document.
void baseAttributes(QXmlStreamWriter &writer) const
After writing leaf class attributes, this writes the base class atributes.
CmdAbstract(MainWindow &mainWindow, Document &document, const QString &cmdDescription)
Single constructor.
virtual ~CmdSettingsCurveList()
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.
CmdSettingsCurveList(MainWindow &mainWindow, Document &document, const CurveNameList &modelCurves)
Constructor for normal creation.
static ColorFilterSettings defaultFilter()
Initial default for any Curve.
Model for DlgSettingsCurveList and CmdSettingsCurveList.
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
One row per curve name.
QString currentCurveToOriginalCurve(const QString ¤tCurve) const
Return the original curve for the specified current curve.
Container for LineStyle and PointStyle for one Curve.
Container for one set of digitized Points.
void setCurveName(const QString &curveName)
Change the curve name.
Storage of one imported image and the data attached to that image.
const Curve * curveForCurveName(const QString &curveName) const
See CurvesGraphs::curveForCurveNames, although this also works for AXIS_CURVE_NAME.
static LineStyle defaultGraphCurve(int index)
Initial default for index'th graph curve.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
void updateSettingsCurveList(const CurvesGraphs &curvesGraphs)
Update with new curves.
void updateAfterCommand()
See GraphicsScene::updateAfterCommand.
static PointStyle defaultGraphCurve(int index)
Initial default for index'th graph curve.
#define LOG4CPP_INFO_S(logger)