TreeFrogFramework  1.18
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
TAbstractModel Class Reference

#include <tabstractmodel.h>

Public Member Functions

virtual ~TAbstractModel ()
 
virtual bool create ()
 
virtual bool save ()
 
virtual bool update ()
 
virtual bool remove ()
 
virtual bool isNull () const
 
virtual bool isNew () const
 
virtual bool isSaved () const
 
virtual void setProperties (const QVariantMap &properties)
 
virtual QVariantMap toVariantMap () const
 
QString variableNameToFieldName (const QString &name) const
 

Static Public Member Functions

static QString fieldNameToVariableName (const QString &name)
 

Protected Member Functions

virtual TModelObjectmodelData ()
 
virtual const TModelObjectmodelData () const
 

Detailed Description

The TAbstractModel class is the abstract base class of models, providing functionality common to models.

Constructor & Destructor Documentation

virtual TAbstractModel::~TAbstractModel ( )
inlinevirtual

Member Function Documentation

bool TAbstractModel::create ( )
virtual

Creates the model as a new data to the data storage.

QString TAbstractModel::fieldNameToVariableName ( const QString &  name)
static
bool TAbstractModel::isNew ( ) const
virtual

Returns true if this model is new, not created; otherwise returns false.

bool TAbstractModel::isNull ( ) const
virtual

Returns true if this model is null; otherwise returns false.

bool TAbstractModel::isSaved ( ) const
virtual

Returns true if this model is not saved; otherwise returns false.

TModelObject * TAbstractModel::modelData ( )
inlineprotectedvirtual

This function is reimplemented in subclasses to return a pointer to the data stored in the model object.

const TModelObject * TAbstractModel::modelData ( ) const
inlineprotectedvirtual

This function is reimplemented in subclasses to return a pointer to the data stored in the model object.

bool TAbstractModel::remove ( )
virtual

Removes the model from the data storage.

bool TAbstractModel::save ( )
virtual

Saves the model to the data storage.

If the model exists in the data storage, calls update(); otherwise calls create().

void TAbstractModel::setProperties ( const QVariantMap &  properties)
virtual

Sets the properties.

QVariantMap TAbstractModel::toVariantMap ( ) const
virtual

Returns a map with all properties of this text format.

bool TAbstractModel::update ( )
virtual

Updates the model to the data storage.

QString TAbstractModel::variableNameToFieldName ( const QString &  name) const

The documentation for this class was generated from the following files: