Qt Model Utilities
2.0.3
A set of utilities for the model/view framework of Qt
|
Serialiser to save and load models in HTML format. More...
Public Member Functions | |
HtmlModelSerialiser (const QAbstractItemModel *model, QObject *parent) | |
HtmlModelSerialiser (QAbstractItemModel *model, QObject *parent) | |
HtmlModelSerialiser (QObject *parent=Q_NULLPTR) | |
bool | loadModel (const QByteArray &source) Q_DECL_OVERRIDE |
bool | loadModel (QIODevice *source) Q_DECL_OVERRIDE |
bool | loadModel (QString *source) Q_DECL_OVERRIDE |
bool | printStartDocument () const |
bool | saveModel (QByteArray *destination) const Q_DECL_OVERRIDE |
bool | saveModel (QIODevice *destination) const Q_DECL_OVERRIDE |
bool | saveModel (QString *destination) const Q_DECL_OVERRIDE |
void | setPrintStartDocument (bool val) |
![]() | |
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) |
![]() | |
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 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 |
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 | |
HtmlModelSerialiser (HtmlModelSerialiserPrivate &d, QObject *parent) | |
![]() | |
AbstractStringSerialiser (AbstractStringSerialiserPrivate &d, QObject *parent) | |
![]() | |
AbstractModelSerialiser (AbstractModelSerialiserPrivate &d, QObject *parent) | |
Properties | |
bool | printStartDocument |
This property determines if the start of the html document should be written. More... | |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
void | setStreamVersion (QDataStream::Version ver) |
Set the datastream version used to serialise binary data. More... | |
![]() | |
static QList< int > | modelDefaultRoles () |
Serialiser to save and load models in HTML format.
|
explicit |
Constructs a serialiser
HtmlModelSerialiser::HtmlModelSerialiser | ( | QAbstractItemModel * | model, |
QObject * | parent | ||
) |
Constructs a serialiser operating over model
HtmlModelSerialiser::HtmlModelSerialiser | ( | const QAbstractItemModel * | model, |
QObject * | parent | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
the model will only be allowed to be saved, not loaded
|
virtual |
Reimplemented from base class
Implements AbstractModelSerialiser.
|
virtual |
Reimplemented from base class
Implements AbstractModelSerialiser.
|
virtual |
Reimplemented from base class
Implements AbstractStringSerialiser.
|
virtual |
Reimplemented from base class
Implements AbstractModelSerialiser.
|
virtual |
Reimplemented from base class
Implements AbstractModelSerialiser.
|
virtual |
Reimplemented from base class
Implements AbstractStringSerialiser.
|
readwrite |
This property determines if the start of the html document should be written.
If this property is set to true
(the default) the serialiser will write the <html>
starting block. Set this to false to save the model as part of a larger html document or if you want to specify your custom css in the <head>