TreeFrogFramework 2.10
Loading...
Searching...
No Matches
tabstractmodel.h
Go to the documentation of this file.
1#pragma once
2#include <QVariant>
3#include <QtCore>
4#include <TGlobal>
5
6class TModelObject;
7
8
10public:
11 virtual ~TAbstractModel() { }
12 virtual bool create();
13 virtual bool save();
14 virtual bool update();
15 virtual bool remove();
16 virtual bool isNull() const;
17 virtual bool isNew() const;
18 virtual bool isSaved() const;
19 virtual void setProperties(const QVariantMap &properties);
20 virtual QVariantMap toVariantMap(const QStringList &properties = QStringList()) const;
21 virtual void setProperties(const QJsonObject &properties);
22 virtual QJsonObject toJsonObject(const QStringList &properties = QStringList()) const;
23 virtual void setProperties(const QJsonDocument &properties);
24 virtual QCborMap toCborMap(const QStringList &properties = QStringList()) const;
25
26 QString variableNameToFieldName(const QString &name) const;
27 static QString fieldNameToVariableName(const QString &name);
28
29protected:
30 virtual TModelObject *modelData() { return nullptr; }
31 virtual const TModelObject *modelData() const { return nullptr; }
32};
33
The TAbstractModel class is the abstract base class of models, providing functionality common to mode...
Definition tabstractmodel.h:9
virtual const TModelObject * modelData() const
This function is reimplemented in subclasses to return a pointer to the data stored in the model obje...
Definition tabstractmodel.h:31
virtual ~TAbstractModel()
Definition tabstractmodel.h:11
virtual TModelObject * modelData()
This function is reimplemented in subclasses to return a pointer to the data stored in the model obje...
Definition tabstractmodel.h:30
The TModelObject class provides an abstract base for model objects.
Definition tmodelobject.h:9
#define T_CORE_EXPORT
Definition tdeclexport.h:28