forked from lemirep/Models
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathListItem.h
43 lines (34 loc) · 914 Bytes
/
ListItem.h
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
34
35
36
37
38
39
40
41
42
43
#ifndef LISTITEM_H
#define LISTITEM_H
#include <QObject>
#include <QVariant>
#include <QHash>
#include <QJsonObject>
#include <QJsonArray>
namespace Models
{
class ListModel;
class ListItem : public QObject
{
Q_OBJECT
public:
public :
ListItem(QObject *parent = 0);
virtual ~ListItem() {}
virtual int id() const = 0;
virtual QVariant data(int role) const = 0;
virtual bool setData(int role, const QVariant &value);
virtual QHash<int, QByteArray> roleNames() const = 0;
QHash<QByteArray, int> roleTypesFromName();
virtual void triggerItemUpdate();
virtual bool operator<(const ListItem &nextElem) const;
virtual ListItem& operator=(const ListItem &);
virtual ListItem* getNewItemInstance(QObject *parent = 0) const = 0;
ListItem *getParentItem() const;
protected :
ListItem *parentItem;
signals:
void dataChanged();
};
}
#endif // LISTITEM_H