14 #ifndef XMLMODELSERIALISER_H
15 #define XMLMODELSERIALISER_H
17 #include "abstractstringserialiser.h"
18 class XmlModelSerialiserPrivate;
19 class QXmlStreamWriter;
20 class QXmlStreamReader;
24 Q_PROPERTY(
bool printStartDocument READ printStartDocument WRITE setPrintStartDocument)
32 bool printStartDocument()
const;
33 void setPrintStartDocument(
bool val);
34 virtual bool saveModel(QXmlStreamWriter &stream)
const;
35 bool saveModel(QIODevice *destination)
const Q_DECL_OVERRIDE;
36 bool saveModel(QByteArray *destination)
const Q_DECL_OVERRIDE;
37 bool saveModel(QString *destination)
const Q_DECL_OVERRIDE;
38 bool loadModel(QString *source) Q_DECL_OVERRIDE;
39 bool loadModel(QIODevice *source) Q_DECL_OVERRIDE;
40 bool loadModel(
const QByteArray &source) Q_DECL_OVERRIDE;
41 virtual bool loadModel(QXmlStreamReader &stream);
46 #ifdef MS_DECLARE_STREAM_OPERATORS
47 friend QXmlStreamWriter &operator<<(QXmlStreamWriter &stream,
const QAbstractItemModel &model);
48 friend QXmlStreamReader &operator>>(QXmlStreamReader &stream, QAbstractItemModel &model);
51 #ifdef MS_DECLARE_STREAM_OPERATORS
52 QXmlStreamWriter &operator<<(QXmlStreamWriter &stream,
const QAbstractItemModel &model);
53 QXmlStreamReader &operator>>(QXmlStreamReader &stream, QAbstractItemModel &model);
The interface for model serialisers saving to strings.
Definition: abstractstringserialiser.h:23
virtual Q_INVOKABLE bool saveModel(QString *destination) const =0
virtual Q_INVOKABLE bool loadModel(QString *source)=0
Serialiser to save and load models in XML format.
Definition: xmlmodelserialiser.h:22