完成了OTA功能,为游戏增加了图标

This commit is contained in:
2026-06-20 18:30:27 +08:00
parent 5662ddf8f1
commit 26af2f9d11
22 changed files with 655 additions and 22 deletions
+29
View File
@@ -0,0 +1,29 @@
#ifndef UPDATECHECKER_H
#define UPDATECHECKER_H
#include <QObject>
#include <QJsonObject>
class QNetworkAccessManager;
class QNetworkReply;
#define APP_VERSION "1.0.2"
class UpdateChecker : public QObject {
Q_OBJECT
public:
static UpdateChecker& instance();
void checkForUpdate(const QString& serverBaseUrl, bool silent = false);
private:
explicit UpdateChecker(QObject* parent = nullptr);
void onCheckFinished(QNetworkReply* reply, bool silent);
void showUpdateDialog(const QJsonObject& info);
void downloadAndInstall(const QString& urlPath);
QNetworkAccessManager* _nam = nullptr;
QString _baseUrl;
QString _httpBase;
};
#endif