13 #include <QXmlStreamReader>
30 for (
int row = 0; row < modelCurves.
rowCount (); row++) {
34 QString curveNameCurrent = modelCurves.data (idxCurrent).toString ();
36 if (!curveNameOriginal.isEmpty ()) {
41 Curve curveCurrent (*curveOriginal);
49 Curve curveCurrent (curveNameCurrent,
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");
135 m_curvesGraphsBefore.
saveXml(writer);
136 m_curvesGraphsAfter.
saveXml(writer);
137 writer.writeEndElement();
void saveXml(QXmlStreamWriter &writer) const
Serialize curves.
static LineStyle defaultGraphCurve(int index)
Initial default for index'th graph curve.
QXmlStreamReader::TokenType loadNextFromReader(QXmlStreamReader &reader)
Load next token from xml reader.
void loadXml(QXmlStreamReader &reader)
Load from serialized xml post-version 5 file.
const QString DOCUMENT_SERIALIZE_CURVES_GRAPHS
const QString CMD_DESCRIPTION("Add axis point")
Wrapper around QUndoCommand. This simplifies the more complicated feature set of QUndoCommand.
int numCurves() const
Current number of graphs curves.
QString currentCurveToOriginalCurve(const QString ¤tCurve) const
Return the original curve for the specified current curve.
virtual void cmdUndo()
Undo method that is called when QUndoStack is moved one command backward.
#define LOG4CPP_INFO_S(logger)
void addGraphCurveAtEnd(const Curve &curve)
Append new graph Curve to end of Curve list.
void saveOrCheckPostCommandDocumentStateHash(const Document &document)
Save, when called the first time, a hash value representing the state of the Document.
virtual void saveXml(QXmlStreamWriter &writer) const
Save commands as xml for later uploading.
static ColorFilterSettings defaultFilter()
Initial default for any Curve.
const QString DOCUMENT_SERIALIZE_CMD_TYPE
void saveOrCheckPreCommandDocumentStateHash(const Document &document)
Save, when called the first time, a hash value representing the state of the Document.
const QString DOCUMENT_SERIALIZE_CMD_DESCRIPTION
MainWindow & mainWindow()
Return the MainWindow so it can be updated by this command as a last step.
void setCurveName(const QString &curveName)
Change the curve name.
CmdSettingsCurveList(MainWindow &mainWindow, Document &document, const CurveNameList &modelCurves)
Constructor for normal creation.
void updateAfterCommand()
See GraphicsScene::updateAfterCommand.
Container for LineStyle and PointStyle for one Curve.
Storage of one imported image and the data attached to that image.
Container for one set of digitized Points.
const QString DOCUMENT_SERIALIZE_CMD_SETTINGS_CURVE_LIST
log4cpp::Category * mainCat
const CurvesGraphs & curvesGraphs() const
Make all Curves available, read only, for CmdAbstract classes only.
const Curve * curveForCurveName(const QString &curveName) const
See CurvesGraphs::curveForCurveNames, although this also works for AXIS_CURVE_NAME.
void xmlExitWithError(QXmlStreamReader &reader, const QString &message)
Show specified message for an error while reading xml, then quit.
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
One row per curve name.
Document & document()
Return the Document that this command will modify during redo and undo.
virtual ~CmdSettingsCurveList()
static PointStyle defaultGraphCurve(int index)
Initial default for index'th graph curve.
Model for DlgSettingsCurveList and CmdSettingsCurveList.
const QString DOCUMENT_SERIALIZE_CMD
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
virtual void cmdRedo()
Redo method that is called when QUndoStack is moved one command forward.
void updateSettingsCurveList(const CurvesGraphs &curvesGraphs)
Update with new curves.