Revert "Merge branch 'Thunder' of gitee.com:spark-store-project/spark-store into dev"

This reverts commit 5b018a4696.
This commit is contained in:
2024-10-07 15:17:47 +00:00
committed by Gitee
parent adbb2f2b11
commit 267eae076e
27 changed files with 120 additions and 223 deletions
+16 -1
View File
@@ -12,6 +12,7 @@
#include <execinfo.h>
#include <DSysInfo>
#include <DApplicationSettings>
#include <QDate>
#include <QProcessEnvironment>
@@ -146,10 +147,13 @@ int main(int argc, char *argv[])
// qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-web-security");
// 全平台软件渲染Webkit
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-gpu");
#if defined (__sw_64__) || defined (__loongarch__)
#ifdef __sw_64__
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--no-sandbox");
#endif
#ifdef __loongarch__
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--no-sandbox");
#endif
/**
* NOTE: https://zhuanlan.zhihu.com/p/550285855
* 避免 wayland 环境下从 QtWebEngine 后退回到 QWidget 时黑屏闪烁
@@ -159,6 +163,15 @@ int main(int argc, char *argv[])
DApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);
}
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
// 开启 Hidpi 支持
qDebug() << "Enable HiDPI Support.";
DApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
DApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
// 强制使用 DTK 平台插件
QVector<char *> fakeArgs(argc + 2);
fakeArgs[0] = argv[0];
@@ -180,6 +193,8 @@ int main(int argc, char *argv[])
return -1;
}
DApplicationSettings settings; // 定义 DApplicationSettings,自动保存主题设置
MainWindow w;
a.setMainWindow(&w); // 设置应用程序主窗口,用于初始化关于对话框