mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-06-24 15:13:49 +08:00
Revert "Merge branch 'Thunder' of gitee.com:spark-store-project/spark-store into dev"
This reverts commit 5b018a4696.
This commit is contained in:
+16
-1
@@ -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); // 设置应用程序主窗口,用于初始化关于对话框
|
||||
|
||||
|
||||
Reference in New Issue
Block a user