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 | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 51 insertions(+), 1 deletions(-) diff --git a/internal_system_v1/main.cpp b/internal_system_v1/main.cpp index 10f11bd..21ecba5 100644 --- a/internal_system_v1/main.cpp +++ b/internal_system_v1/main.cpp @@ -1,11 +1,61 @@ -#include "clientmainwindow.h" +锘�#include "clientmainwindow.h" #include <QApplication> +#include <QStandardPaths> +#include <QDebug> +#pragma execution_character_set("utf-8") int main(int argc, char *argv[]) { QApplication a(argc, argv); ClientMainWindow w; + //w.setStyleSheet("background-color:#FFC7F0"); + // 钃濊壊娓愬彉 + //w.setStyleSheet("background-color:qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #7bbfea,stop:0.5 #afdfe4 ,stop:1 #7bbfea)"); + + // 缁胯壊娓愬彉 + //w.setStyleSheet("background-color:qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #a3cf62,stop:0.5 #bed742 ,stop:1 #a3cf62)"); + + +// QLinearGradient gradient(0, 0, 1, 1); // 鍒涘缓绾挎�ф笎鍙樺璞� +// gradient.setColorAt(0.0, QColor(255, 0, 0)); // 璁剧疆璧峰棰滆壊 +// gradient.setColorAt(1.0, QColor(0, 255, 0)); // 璁剧疆缁撴潫棰滆壊 + +// // 灏嗘笎鍙樻晥鏋滃簲鐢ㄥ埌 QWidget 涓� +// QPalette palette; +// palette.setBrush(QPalette::Background,gradient); +// w.setBackgroundRole(QPalette::Highlight); +// w.setPalette(palette); +// w.setAutoFillBackground(true); + + 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