22 lines
309 B
C
22 lines
309 B
C
|
#ifndef BASEENTITY_H
|
||
|
#define BASEENTITY_H
|
||
|
|
||
|
#include <QJsonObject>
|
||
|
|
||
|
class BaseEntity
|
||
|
{
|
||
|
public:
|
||
|
BaseEntity();
|
||
|
|
||
|
int id() const;
|
||
|
void setId(int newId);
|
||
|
|
||
|
virtual void fromJson(const QJsonObject &) {}
|
||
|
virtual QJsonObject toJson() const = 0;
|
||
|
|
||
|
private:
|
||
|
int _id = 0;
|
||
|
};
|
||
|
|
||
|
#endif // BASEENTITY_H
|