-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathowneranimaltreemodel.h
61 lines (37 loc) · 1.22 KB
/
owneranimaltreemodel.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef OWNERANIMALTREEMODEL_H
#define OWNERANIMALTREEMODEL_H
/*#include"conteneur.hpp"
#include<QAbstractItemModel>
#include<QWidget>
#include<QModelIndex>
class Etre;
class Owner;
class Animal;
class OwnerAnimalTreeModel : public QAbstractItemModel
{
public:
OwnerAnimalTreeModel(QObject *parent = 0);
// ~OwnerAnimalTreeModel(){delete rootItem;} // à cause du fait que j'ai moi meme définit ma classe d'item
public:
QVariant data(const QModelIndex &index, int role)const Q_DECL_OVERRIDE; // renvoi la donnée stockée en fonction du role
Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE;
int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
public:
void appendRow(Owner *etre);
void appendRow(Animal *etre);
private:
Etre* rootItem;
};
*/
#include<QFile>
#include<QWidget>
class TestModel : public QWidget
{
Q_OBJECT
public:
Test();
};
#endif // OWNERANIMALTREEMODEL_H