-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMainNews.h
65 lines (57 loc) · 1.58 KB
/
MainNews.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
63
64
65
#ifndef MAINNEWS_H
#define MAINNEWS_H
#include <QObject>
#include <QDateTime>
class MainNews:
public QObject
{
Q_OBJECT
Q_PROPERTY(QString id READ id NOTIFY idChanged)
Q_PROPERTY(QString title READ title NOTIFY titleChanged)
Q_PROPERTY(QString videoPath READ videoPath NOTIFY videoPathChanged)
Q_PROPERTY(QString picPath READ picPath NOTIFY picPathChanged)
Q_PROPERTY(QString source READ source NOTIFY sourceChanged)
Q_PROPERTY(QString content READ content NOTIFY contentChanged)
Q_PROPERTY(QDateTime time READ time NOTIFY timeChanged)
Q_PROPERTY(qreal replyCount READ replyCount WRITE setReplyCount NOTIFY replyCountChanged)
public:
MainNews();
MainNews( QString id,
QString title,
QString videoPath,
QString picPath,
QString source,
QString content,
QDateTime time
);
~MainNews();
QString id();
QString title();
QString videoPath();
QString picPath();
QString source();
QString content();
QDateTime time();
qreal replyCount();
Q_INVOKABLE bool videoExists();
void setReplyCount(int count);
private:
QString _id;
QString _title;
QString _videoPath;
QString _picPath;
QString _source;
QString _content;
QDateTime _time;
qreal _replyCount;
signals:
void idChanged();
void titleChanged();
void videoPathChanged();
void picPathChanged();
void sourceChanged();
void contentChanged();
void timeChanged();
void replyCountChanged();
};
#endif // MAINNEWS_H