From aa3b9596837dadcccc23506054756ea513ac78f4 Mon Sep 17 00:00:00 2001 From: cbwu <504-wuchengbo@htsdfp.com> Date: Sun, 7 Jul 2024 17:09:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E5=A4=96=E9=83=A8exe=E7=A8=8B=E5=BA=8F(=E6=9A=82=E6=97=B6?= =?UTF-8?q?=E5=85=88=E6=B3=A8=E9=87=8A)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +- PayloadAPP.pro.user | 124 ++++++++------------------------------------ main.cpp | 2 + mainwindow.cpp | 8 ++- mainwindow.h | 4 ++ msvc_make.bat | 2 + 6 files changed, 38 insertions(+), 105 deletions(-) create mode 100644 msvc_make.bat diff --git a/.gitignore b/.gitignore index d163863..d72a83e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -build/ \ No newline at end of file +build/ +*.pro.user \ No newline at end of file diff --git a/PayloadAPP.pro.user b/PayloadAPP.pro.user index 86190ba..51e068d 100644 --- a/PayloadAPP.pro.user +++ b/PayloadAPP.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {c21801a3-ae2b-45ac-9dbf-ccd10de58748} + {759415a8-4594-451e-a962-883a838b346f} ProjectExplorer.Project.ActiveTarget @@ -76,7 +76,7 @@ true true Builtin.DefaultTidyAndClazy - 10 + 8 true @@ -97,8 +97,8 @@ 0 0 - D:\QTdemo\playerApp\build\Desktop_Qt_6_5_3_MSVC2019_64bit-Debug - D:/QTdemo/playerApp/build/Desktop_Qt_6_5_3_MSVC2019_64bit-Debug + F:\MyProject\PayloadAPP\build\Desktop_Qt_6_5_3_MSVC2019_64bit-Debug + F:/MyProject/PayloadAPP/build/Desktop_Qt_6_5_3_MSVC2019_64bit-Debug true @@ -111,8 +111,8 @@ Qt4ProjectManager.MakeStep 2 - 构建 - 构建 + Build + Build ProjectExplorer.BuildSteps.Build @@ -122,8 +122,8 @@ clean 1 - 清除 - 清除 + Clean + Clean ProjectExplorer.BuildSteps.Clean 2 @@ -136,8 +136,8 @@ 2 - D:\QTdemo\playerApp\build\Desktop_Qt_6_5_3_MSVC2019_64bit-Release - D:/QTdemo/playerApp/build/Desktop_Qt_6_5_3_MSVC2019_64bit-Release + F:\MyProject\PayloadAPP\build\Desktop_Qt_6_5_3_MSVC2019_64bit-Release + F:/MyProject/PayloadAPP/build/Desktop_Qt_6_5_3_MSVC2019_64bit-Release true @@ -150,8 +150,8 @@ Qt4ProjectManager.MakeStep 2 - 构建 - 构建 + Build + Build ProjectExplorer.BuildSteps.Build @@ -161,8 +161,8 @@ clean 1 - 清除 - 清除 + Clean + Clean ProjectExplorer.BuildSteps.Clean 2 @@ -175,94 +175,12 @@ 0 0 - - 0 - D:\QTdemo\playerApp\build\Desktop_Qt_6_5_3_MSVC2019_64bit-Profile - D:/QTdemo/playerApp/build/Desktop_Qt_6_5_3_MSVC2019_64bit-Profile - - - true - QtProjectManager.QMakeBuildStep - false - - - - true - Qt4ProjectManager.MakeStep - - 2 - 构建 - 构建 - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - clean - - 1 - 清除 - 清除 - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - 0 - 0 - - - 0 - D:\QTdemo\playerApp\build\Desktop_Qt_6_5_3_MSVC2019_64bit-Debug - D:/QTdemo/playerApp/build/Desktop_Qt_6_5_3_MSVC2019_64bit-Debug - - - true - QtProjectManager.QMakeBuildStep - false - - - - true - Qt4ProjectManager.MakeStep - - 2 - 构建 - 构建 - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - clean - - 1 - 清除 - 清除 - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Debug2 - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - 4 + 2 0 - 部署 - 部署 + Deploy + Deploy ProjectExplorer.BuildSteps.Deploy 1 @@ -282,13 +200,13 @@ false -e cpu-cycles --call-graph "dwarf,4096" -F 250 - Qt4ProjectManager.Qt4RunConfiguration:D:/QTdemo/playerApp/PayloadAPP.pro - D:/QTdemo/playerApp/PayloadAPP.pro + Qt4ProjectManager.Qt4RunConfiguration:F:/MyProject/PayloadAPP/PayloadAPP.pro + F:/MyProject/PayloadAPP/PayloadAPP.pro false true true true - D:/QTdemo/playerApp/build/Desktop_Qt_6_5_3_MSVC2019_64bit-Debug + F:/MyProject/PayloadAPP/build/Desktop_Qt_6_5_3_MSVC2019_64bit-Debug 1 diff --git a/main.cpp b/main.cpp index 552469f..216e0dd 100644 --- a/main.cpp +++ b/main.cpp @@ -7,6 +7,8 @@ int main(int argc, char *argv[]) { + //QApplication::setAttribute(Qt::AA_UseOpenGLES); + QApplication a(argc, argv); QTranslator translator; const QStringList uiLanguages = QLocale::system().uiLanguages(); diff --git a/mainwindow.cpp b/mainwindow.cpp index 88f4f33..a2d3b76 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -21,7 +21,7 @@ MainWindow::MainWindow(QWidget *parent) // initMenuBar(); initToolBar(); - + process = new QProcess(this); // connect(ui->toolbar_action1,&QAction::triggered,this,[this](){ // qDebug("1111"); @@ -237,6 +237,8 @@ void MainWindow::on_pushButton_4_clicked() { m_HomePagedlg->hide(); m_GDDCdlg->hide(); + + //process->kill(); } //PDT集群 @@ -244,6 +246,10 @@ void MainWindow::on_pushButton_5_clicked() { m_HomePagedlg->hide(); m_GDDCdlg->hide(); + + + // process->setWorkingDirectory("F:/显控软件_20240606"); // 设置工作目录 + // process->start("F:/显控软件_20240606/ViewControlStudio.exe"); // 启动exe并传递参数 } //Ku卫通 diff --git a/mainwindow.h b/mainwindow.h index e8a08da..c65d1be 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -14,6 +14,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; @@ -60,5 +61,8 @@ public: //QWeb *m_qWeb; QWebEngineView *mWeb; +private: + QProcess *process; + QString exeDirPathName = ""; }; #endif // MAINWINDOW_H diff --git a/msvc_make.bat b/msvc_make.bat new file mode 100644 index 0000000..6bffabe --- /dev/null +++ b/msvc_make.bat @@ -0,0 +1,2 @@ +chcp 65001 +"F:\Qt\Tools\QtCreator\bin\jom\jom.exe" %* \ No newline at end of file