Qt Model Utilities
2.0.3
A set of utilities for the model/view framework of Qt
|
The interface for model serialisers saving to strings. More...
Public Member Functions | |
AbstractStringSerialiser (const QAbstractItemModel *model, QObject *parent) | |
AbstractStringSerialiser (QAbstractItemModel *model, QObject *parent) | |
AbstractStringSerialiser (QObject *parent=Q_NULLPTR) | |
virtual | ~AbstractStringSerialiser ()=0 |
Q_INVOKABLE bool | loadModel (const QString &source) |
virtual Q_INVOKABLE bool | loadModel (QString *source)=0 |
virtual Q_INVOKABLE bool | saveModel (QString *destination) const =0 |
![]() | |
AbstractModelSerialiser (const QAbstractItemModel *model, QObject *parent) | |
AbstractModelSerialiser (QAbstractItemModel *model, QObject *parent) | |
AbstractModelSerialiser (QObject *parent=Q_NULLPTR) | |
virtual | ~AbstractModelSerialiser ()=0 |
virtual Q_INVOKABLE void | addRoleToSave (int role) |
Appends role to the list of roles to save. More... | |
virtual Q_INVOKABLE void | clearRoleToSave () |
empties the list of roles to save More... | |
virtual const QAbstractItemModel * | constModel () const |
virtual Q_INVOKABLE bool | loadModel (const QByteArray &source)=0 |
virtual Q_INVOKABLE bool | loadModel (QIODevice *source)=0 |
virtual QAbstractItemModel * | model () const |
virtual Q_INVOKABLE void | removeRoleToSave (int role) |
Removes role from the list of roles to save. More... | |
virtual void | resetRoleToSave () |
resetter of rolesToSave property More... | |
virtual const QList< int > & | rolesToSave () const |
virtual Q_INVOKABLE bool | saveModel (QByteArray *destination) const =0 |
virtual Q_INVOKABLE bool | saveModel (QIODevice *destination) const =0 |
void | setModel (const QAbstractItemModel *val) |
void | setModel (QAbstractItemModel *val) |
virtual void | setRoleToSave (const QList< int > &val) |
Q_INVOKABLE QDataStream::Version | streamVersion () const |
The datastream version used to serialise binary data. More... | |
Protected Member Functions | |
AbstractStringSerialiser (AbstractStringSerialiserPrivate &d, QObject *parent) | |
![]() | |
AbstractModelSerialiser (AbstractModelSerialiserPrivate &d, QObject *parent) | |
Additional Inherited Members | |
![]() | |
void | setStreamVersion (QDataStream::Version ver) |
Set the datastream version used to serialise binary data. More... | |
![]() | |
static QList< int > | modelDefaultRoles () |
![]() | |
const QAbstractItemModel * | constModel |
The model over which the serialiser will operate in read mode. More... | |
QAbstractItemModel * | model |
The model over which the serialiser will operate for reading/writing. More... | |
QList< int > | rolesToSave |
The roles that will be serialised. More... | |
The interface for model serialisers saving to strings.
|
explicit |
Construct a serialiser
AbstractStringSerialiser::AbstractStringSerialiser | ( | QAbstractItemModel * | model, |
QObject * | parent | ||
) |
Construct a read/write serialiser
AbstractStringSerialiser::AbstractStringSerialiser | ( | const QAbstractItemModel * | model, |
QObject * | parent | ||
) |
Construct a write-only serialiser
|
pure virtualdefault |
Destructor
|
protected |
Constructor used only while subclassing the private class. Not part of the public API
bool AbstractStringSerialiser::loadModel | ( | const QString & | source | ) |
Loads the model from the given source
Data previously stored in the model will be removed
|
pure virtual |
Loads the model from the given source
Data previously stored in the model will be removed
Implemented in XmlModelSerialiser, JsonModelSerialiser, HtmlModelSerialiser, and CsvModelSerialiser.
|
pure virtual |
Saves the model to the given destination
Implemented in XmlModelSerialiser, JsonModelSerialiser, HtmlModelSerialiser, and CsvModelSerialiser.