-
Notifications
You must be signed in to change notification settings - Fork 3
/
checkupdate.h
88 lines (53 loc) · 1.3 KB
/
checkupdate.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#pragma once
#pragma execution_character_set("utf-8")
#ifndef CHECKUPDATE_H
#define CHECKUPDATE_H
#include <QObject>
#include <QLabel>
#include <QDir>
#include <QFile>
#include <QEventLoop>
#include <QMessageBox>
#include <QDesktopServices>
//Network
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkRequest>
#include <QtNetwork/QNetworkReply>
//JSON
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
class checkUpdate : public QObject
{
Q_OBJECT
public:
checkUpdate();
~checkUpdate();
bool parse_UpdateJson();
QString getCurVersion();
QString getLatestVersion();
void homeCheckUpdate();
bool getUpdateInfo();
QString getErrorInfo();
//QUrl getUrl(); 已废弃
QString getUpdateString();
bool getIsForce();
private:
QNetworkAccessManager *manager; //定义网络请求对象
QString CurVersion; //定义当前软件的版本号
QString LatestVersion;
QString Version;
bool isForce = false;
QString Url;
QString Notice;
QString UpdateTime;
QString ReleaseNote;
QString errorInfo;
QString updateStr;
int AutoUpdateToolVersion;
void writeVersion();
signals:
void finished(QString res);
void homeCheckUpdateFinished(bool res);
};
#endif // CHECKUPDATE_H