Qt Model Utilities
2.0.3
A set of utilities for the model/view framework of Qt
|
The interface for model serialisers saving only one role. More...
Public Member Functions | |
AbstractSingleRoleSerialiser (const QAbstractItemModel *model, QObject *parent) | |
AbstractSingleRoleSerialiser (QAbstractItemModel *model, QObject *parent) | |
AbstractSingleRoleSerialiser (QObject *parent=Q_NULLPTR) | |
~AbstractSingleRoleSerialiser ()=0 | |
void | addRoleToSave (int role) Q_DECL_OVERRIDE |
void | clearRoleToSave () Q_DECL_OVERRIDE |
void | removeRoleToSave (int role) Q_DECL_OVERRIDE |
void | resetRoleToSave () Q_DECL_OVERRIDE |
int | roleToSave () const |
void | setRoleToSave (const QList< int > &val) Q_DECL_OVERRIDE |
void | setRoleToSave (int 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) |
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 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 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) |
Q_INVOKABLE QDataStream::Version | streamVersion () const |
The datastream version used to serialise binary data. More... | |
Protected Member Functions | |
AbstractSingleRoleSerialiser (AbstractSingleRoleSerialiserPrivate &d, QObject *parent) | |
![]() | |
AbstractStringSerialiser (AbstractStringSerialiserPrivate &d, QObject *parent) | |
![]() | |
AbstractModelSerialiser (AbstractModelSerialiserPrivate &d, QObject *parent) | |
Properties | |
int | roleToSave |
The role that will be serialised. 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 () |
The interface for model serialisers saving only one role.
|
explicit |
Construct a serialiser
AbstractSingleRoleSerialiser::AbstractSingleRoleSerialiser | ( | QAbstractItemModel * | model, |
QObject * | parent | ||
) |
Construct a read/write serialiser
AbstractSingleRoleSerialiser::AbstractSingleRoleSerialiser | ( | 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
|
virtual |
Reimplemented from base class Equivalent to setRoleToSave
Reimplemented from AbstractModelSerialiser.
|
virtual |
Reimplemented from base class Resets the role to save to Qt::DisplayRole
Reimplemented from AbstractModelSerialiser.
|
virtual |
Reimplemented from base class If role is the currently saved role, resets the role to save to Qt::DisplayRole
Reimplemented from AbstractModelSerialiser.
|
virtual |
Reimplemented from base class Resets the role to save to Qt::DisplayRole
Reimplemented from AbstractModelSerialiser.
|
virtual |
Reimplemented from base class If val contains more than one value only the first one is considered
Reimplemented from AbstractModelSerialiser.
|
readwrite |
The role that will be serialised.
By default this property is set to Qt::DisplayRole