-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.h
58 lines (46 loc) · 1.26 KB
/
user.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
#ifndef USER_H
#define USER_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QQuickItem>
class User : public QQuickItem
{
Q_OBJECT
Q_INTERFACES(QQmlParserStatus)
Q_PROPERTY(QString name READ name NOTIFY nameChanged)
Q_PROPERTY(double founds READ founds NOTIFY foundsChanged)
Q_PROPERTY(QString loggedin READ loggedin NOTIFY loggedinChanged)
Q_PROPERTY(QString loginUrl READ loginUrl CONSTANT)
public:
explicit User(QQuickItem *parent = 0);
void setNetworkAccessManager(QNetworkAccessManager*);
QNetworkAccessManager* networkAccessManager() const;
QString name() const;
double founds() const;
QString loginUrl() const;
bool loggedin() const;
public slots:
void loadData();
signals:
void nameChanged();
void foundsChanged();
void loggedinChanged();
void loginRequired();
void loginSucessful();
private slots:
void dataReady();
// QQmlParserStatus interface
public:
virtual void classBegin();
virtual void componentComplete();
private:
QNetworkAccessManager* m_nam;
QString m_name;
double m_founds;
bool m_loggedin;
bool m_uptodate;
void setName(QString &name);
void setFounds(double value);
void setLoggedIn(bool value);
};
#endif // USER_H