forked from HuijunXu/CUMT-Daily
-
Notifications
You must be signed in to change notification settings - Fork 0
/
User.h
36 lines (33 loc) · 891 Bytes
/
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
#ifndef USER_H
#define USER_H
#include <QObject>
#include "News.h"
class User
:public QObject
{
Q_OBJECT
Q_PROPERTY(QString uid READ uid NOTIFY uidChanged)
Q_PROPERTY(QString userIcon READ userIcon NOTIFY userIconChanged)
Q_PROPERTY(QString nicName READ nicName NOTIFY nicNameChanged)
Q_PROPERTY(bool loginState READ loginState NOTIFY loginStateChanged)
public:
User();
~User();
QString uid();
QString userIcon();
QString nicName();
bool loginState();
Q_INVOKABLE bool userLogin(QString user,QString password);
Q_INVOKABLE bool logOff();
private:
bool _loginState=false;
QString _uid;
QString _nicName="FaintzZ";
QString _userIcon=QString(HOME)+"/timeline/pic/user.ico";
signals:
void uidChanged();
void userIconChanged();
void nicNameChanged();
void loginStateChanged();
};
#endif // USER_H