Qt Model Utilities  0.0.1
A set of utilities for the model/view framework of Qt
Public Member Functions | Protected Member Functions | Properties | List of all members
AbstractSingleRoleSerialiser Class Referenceabstract

The interface for model serialisers saving only one role. More...

Inheritance diagram for AbstractSingleRoleSerialiser:
AbstractModelSerialiser CsvModelSerialiser

Public Member Functions

 AbstractSingleRoleSerialiser (QAbstractItemModel *model=Q_NULLPTR)
 
 AbstractSingleRoleSerialiser (const QAbstractItemModel *model)
 
 ~AbstractSingleRoleSerialiser ()=0
 
int roleToSave () const
 
void setRoleToSave (int val)
 setter of roleToSave property More...
 
- Public Member Functions inherited from AbstractModelSerialiser
 AbstractModelSerialiser (QAbstractItemModel *model=Q_NULLPTR)
 
 AbstractModelSerialiser (const QAbstractItemModel *model)
 
virtual ~AbstractModelSerialiser ()=0
 
virtual const QAbstractItemModel * constModel () const
 
virtual Q_INVOKABLE bool loadModel (QIODevice *source)=0
 
virtual Q_INVOKABLE bool loadModel (const QByteArray &source)=0
 
virtual QAbstractItemModel * model () const
 
virtual Q_INVOKABLE bool saveModel (QIODevice *destination) const =0
 
virtual Q_INVOKABLE bool saveModel (QByteArray *destination) const =0
 
void setModel (QAbstractItemModel *val)
 setter of model property More...
 
void setModel (const QAbstractItemModel *val)
 set the model over which the serialiser will operate More...
 

Protected Member Functions

 AbstractSingleRoleSerialiser (AbstractSingleRoleSerialiserPrivate &d)
 
- Protected Member Functions inherited from AbstractModelSerialiser
 AbstractModelSerialiser (AbstractModelSerialiserPrivate &d)
 

Properties

int roleToSave
 the role that will be serialised More...
 
- Properties inherited from AbstractModelSerialiser
const QAbstractItemModel constModel
 the model over which the serialiser will operate More...
 
QAbstractItemModel model
 the model over which the serialiser will operate More...
 

Additional Inherited Members

- Protected Attributes inherited from AbstractModelSerialiser
AbstractModelSerialiserPrivate * d_ptr
 

Detailed Description

The interface for model serialisers saving only one role.

Constructor & Destructor Documentation

AbstractSingleRoleSerialiser::AbstractSingleRoleSerialiser ( QAbstractItemModel *  model = Q_NULLPTR)

Constructs a serialiser operating over model

See also
isEmpty()
AbstractSingleRoleSerialiser::AbstractSingleRoleSerialiser ( const QAbstractItemModel *  model)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

loadModel will always fail as the model is not editable

AbstractSingleRoleSerialiser::~AbstractSingleRoleSerialiser ( )
pure virtualdefault

Destroys the object.

Member Function Documentation

void AbstractSingleRoleSerialiser::setRoleToSave ( int  val)

setter of roleToSave property

Property Documentation

int AbstractSingleRoleSerialiser::roleToSave
readwrite

the role that will be serialised

getter of roleToSave property

by default this property is set to Qt::DisplayRole