Skip to content

Commit 2ad0147

Browse files
shenmo7192gitee-org
authored andcommitted
!1 通过在main函数强行加入参数修复一些样式问题
Merge pull request !1 from RigoLigo/N/A
2 parents c303cde + 20da4c8 commit 2ad0147

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

spark-webapp-runtime/main.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <QCommandLineOption>
1212
#include <QFileInfo>
1313
#include <QSettings>
14+
#include <QVector>
1415

1516
#include "globaldefine.h"
1617
#include "httpd.h"
@@ -35,7 +36,14 @@ int main(int argc, char *argv[])
3536
Dtk::Widget::DApplication::loadDXcbPlugin();
3637
#endif
3738

38-
DApplication a(argc, argv);
39+
// 强制使用DTK平台插件
40+
QVector<char *> fakeArgv(argc + 2);
41+
fakeArgv[0] = argv[0];
42+
fakeArgv[1] = "-platformtheme";
43+
fakeArgv[2] = "deepin";
44+
for(int i = 1; i < argc; i++) fakeArgv[i + 2] = argv[i];
45+
int fakeArgc = argc + 2;
46+
DApplication a(fakeArgc, fakeArgv.data());
3947

4048
a.loadTranslator();
4149
a.setAttribute(Qt::AA_UseHighDpiPixmaps);

0 commit comments

Comments
 (0)