From e2f53a4bd0b74ed8e6242b23bcc03a89c07fd142 Mon Sep 17 00:00:00 2001 From: luoliangyi <87842688@qq.com> Date: Thu, 14 Jul 2022 12:01:39 +0800 Subject: [PATCH] =?UTF-8?q?HGUpgrade=E7=94=9F=E6=88=90=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/upgrade/main.cpp | 2 +- app/upgrade/mainwindow.cpp | 3 ++- app/upgrade/mainwindow.h | 3 ++- build-qt/HGSolution/HGUpgrade/HGUpgrade.pro | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/upgrade/main.cpp b/app/upgrade/main.cpp index 5752dd16..c2488a89 100644 --- a/app/upgrade/main.cpp +++ b/app/upgrade/main.cpp @@ -54,7 +54,7 @@ int main(int argc, char *argv[]) while (AppIsRun(appName)) QThread::msleep(20); - MainWindow w(pkgPath); + MainWindow w(appName, pkgPath); QScreen *screen = QGuiApplication::primaryScreen(); w.move((screen->size().width() - w.width()) / 2, (screen->size().height() - w.height()) / 2); w.show(); diff --git a/app/upgrade/mainwindow.cpp b/app/upgrade/mainwindow.cpp index fbf94b64..41daf08d 100644 --- a/app/upgrade/mainwindow.cpp +++ b/app/upgrade/mainwindow.cpp @@ -2,9 +2,10 @@ #include "ui_mainwindow.h" #include "HGUpgrade.h" -MainWindow::MainWindow(const std::string& pkgPath, QWidget *parent) +MainWindow::MainWindow(const std::string &appName, const std::string& pkgPath, QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) + , m_appName(appName) , m_pkgPath(pkgPath) , m_thread(nullptr) { diff --git a/app/upgrade/mainwindow.h b/app/upgrade/mainwindow.h index cf64eee8..968fe5b1 100644 --- a/app/upgrade/mainwindow.h +++ b/app/upgrade/mainwindow.h @@ -13,7 +13,7 @@ class MainWindow : public QMainWindow Q_OBJECT public: - MainWindow(const std::string &pkgPath, QWidget *parent = nullptr); + MainWindow(const std::string &appName, const std::string &pkgPath, QWidget *parent = nullptr); ~MainWindow(); signals: @@ -25,6 +25,7 @@ private: private: Ui::MainWindow *ui; + std::string m_appName; std::string m_pkgPath; HGThread m_thread; }; diff --git a/build-qt/HGSolution/HGUpgrade/HGUpgrade.pro b/build-qt/HGSolution/HGUpgrade/HGUpgrade.pro index 3de9a407..3ef125f2 100644 --- a/build-qt/HGSolution/HGUpgrade/HGUpgrade.pro +++ b/build-qt/HGSolution/HGUpgrade/HGUpgrade.pro @@ -20,7 +20,7 @@ RC_ICONS = ../../../app/scanner/image_rsc/logo/logo.ico # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 -TARGET = HuaGoScanUpgrade +TARGET = HGUpgrade win32 { DEFINES += _CRT_SECURE_NO_WARNINGS