-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnote.h
More file actions
41 lines (31 loc) · 944 Bytes
/
note.h
File metadata and controls
41 lines (31 loc) · 944 Bytes
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
#ifndef NOTE_H
#define NOTE_H
#include <QString>
#include <QDateTime>
#include <QVariant>
class Note
{
public:
Note();
Note(int id, const QString &title, const QString &content, const QDateTime &createTime, const QDateTime &updateTime);
int id() const;
void setId(int id);
QString title() const;
void setTitle(const QString &title);
QString content() const;
void setContent(const QString &content);
QDateTime createTime() const;
void setCreateTime(const QDateTime &createTime);
QDateTime updateTime() const;
void setUpdateTime(const QDateTime &updateTime);
// 用于将Note对象转换为QVariant,便于在QListWidget中使用
QVariant toVariant() const;
static Note fromVariant(const QVariant &variant);
private:
int m_id;
QString m_title;
QString m_content;
QDateTime m_createTime;
QDateTime m_updateTime;
};
#endif // NOTE_H