-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexposeclass.h
62 lines (49 loc) · 1.31 KB
/
exposeclass.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
61
62
#ifndef EXPOSECLASS_H
#define EXPOSECLASS_H
// We include our model here
#include <exposemodel.h>
#include <QObject>
#include <QStandardItemModel>
#include <QTimer>
#include "users.h"
class ExposeClass : public QObject
{
Q_OBJECT
// This is the model that we want to expose to QML
Q_PROPERTY(QString fild READ fild WRITE setFild NOTIFY fildChanged)
Q_PROPERTY(QString idFild READ idFild WRITE setIdFild NOTIFY idFildChanged)
QStandardItemModel *m_model;
public:
// Our data enum containing our roles
enum DataRoles {
ScoreRole ,
Score1Role ,
Score2Role ,
PassRole,
DateRole,
AdminRole,
NameRole,
};
explicit ExposeClass(Users *userinfo, QObject *parent = 0);
// The getter for our model
QStandardItemModel *model() const;
signals:
void fildChanged();
void idFildChanged();
public slots:
// The names explain themselves
void clearModel();
void updateModel();
void updateSort();
void deleteUser(QString name);
void adddata(QString name , QString score, QString pass, QString admin, QString date);
QString fild();
void setFild(QString value);
QString idFild();
void setIdFild(QString value);
private:
QString Fild;
QString IDFild;
Users *userinfo;
};
#endif // EXPOSECLASS_H