forked from treefrogframework/treefrog-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtabstractmodel.h
More file actions
34 lines (28 loc) · 1.07 KB
/
Copy pathtabstractmodel.h
File metadata and controls
34 lines (28 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
#include <QVariant>
#include <QtCore>
#include <TGlobal>
class TModelObject;
class T_CORE_EXPORT TAbstractModel {
public:
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 QStringList &properties = QStringList()) const;
virtual void setProperties(const QJsonDocument &properties);
virtual QJsonObject toJsonObject(const QStringList &properties = QStringList()) const;
#if QT_VERSION >= 0x050c00 // 5.12.0
virtual QCborMap toCborMap(const QStringList &properties = QStringList()) const;
#endif
QString variableNameToFieldName(const QString &name) const;
static QString fieldNameToVariableName(const QString &name);
protected:
virtual TModelObject *modelData() { return nullptr; }
virtual const TModelObject *modelData() const { return nullptr; }
};