modify:优化

This commit is contained in:
2026-04-29 23:16:10 +08:00
parent 21556d6b77
commit af1d3c37e8
6 changed files with 664 additions and 258 deletions
+12 -3
View File
@@ -1,12 +1,20 @@
#include <QApplication>
#include <QApplication>
#include <QFile>
#include <QTextStream>
//#include <QDebug>
#include "updaterdialog.h"
/**
* @brief 加载更新器暗色样式。
*
* 设计意图:样式资源不存在时只输出提示,不阻塞更新主流程。
* 资源风险:QFile 为栈对象,函数退出自动关闭;读取失败时保留 Qt 默认样式。
*/
void loadQss()
{
QFile f(":qdarkstyle/dark/darkstyle.qss");
// QFile f(":qdarkstyle/light/lightstyle.qss");
if (!f.exists())
if(!f.exists())
{
printf("Unable to set stylesheet, file not found\n");
}
@@ -24,7 +32,8 @@ int main(int argc, char *argv[])
loadQss();
if(argc > 1)
// 参数由主程序启动更新器时传入,数量不足时进入手动输入模式,避免访问 argv 越界。
if(argc >= 5)
{
APPNAME = argv[1];
APPVERSION = argv[2];