From aa013c2f4e69e2ba4eb72081dc004d8334d59257 Mon Sep 17 00:00:00 2001 From: wumu <mayi@mayi.com> Date: 星期一, 28 十月 2024 23:15:27 +0800 Subject: [PATCH] 1028 --- internal_system_v1/main.cpp | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/internal_system_v1/main.cpp b/internal_system_v1/main.cpp index 32d434b..21ecba5 100644 --- a/internal_system_v1/main.cpp +++ b/internal_system_v1/main.cpp @@ -1,5 +1,8 @@ 锘�#include "clientmainwindow.h" #include <QApplication> +#include <QStandardPaths> +#include <QDebug> +#pragma execution_character_set("utf-8") int main(int argc, char *argv[]) { @@ -27,5 +30,32 @@ w.show(); + // 澶勭悊蹇嵎鏂瑰紡鍒版闈� + + QString strAppPath = QApplication::applicationFilePath(); + QString strDesktopLink = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + "/"; + strDesktopLink += "internal_system.lnk"; + qDebug()<<"妗岄潰璺緞:"<<strDesktopLink; + qDebug()<<"app:"<<QApplication::applicationFilePath(); + + QFile desk(strDesktopLink); + + QFile fApp(strAppPath); + if(!desk.exists()){ + fApp.link(strDesktopLink); + qDebug()<<"娣诲姞蹇嵎鏂瑰紡鎴愬姛"; + }else{ + qDebug()<<"蹇嵎鏂瑰紡宸插瓨鍦紝涓嶆坊鍔�"; + } + + +// //寤虹珛寮�濮嬭彍鍗曞揩鎹锋柟寮� +// QString strMenuLink = QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation) + "/"; +// strMenuLink += "notepad/"; +// QDir pathDir; +// pathDir.mkpath(strMenuLink); +// strMenuLink += "notepad.lnk"; +// fApp.link(strMenuLink); + return a.exec(); } -- Gitblit v1.8.0