通过在main函数强行加入参数修复一些样式问题

This commit is contained in:
RigoLigo 2022-04-07 07:10:32 +00:00 committed by Gitee
parent c303cde973
commit 20da4c852d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -11,6 +11,7 @@
#include <QCommandLineOption>
#include <QFileInfo>
#include <QSettings>
#include <QVector>
#include "globaldefine.h"
#include "httpd.h"
@ -35,7 +36,14 @@ int main(int argc, char *argv[])
Dtk::Widget::DApplication::loadDXcbPlugin();
#endif
DApplication a(argc, argv);
// 强制使用DTK平台插件
QVector<char *> fakeArgv(argc + 2);
fakeArgv[0] = argv[0];
fakeArgv[1] = "-platformtheme";
fakeArgv[2] = "deepin";
for(int i = 1; i < argc; i++) fakeArgv[i + 2] = argv[i];
int fakeArgc = argc + 2;
DApplication a(fakeArgc, fakeArgv.data());
a.loadTranslator();
a.setAttribute(Qt::AA_UseHighDpiPixmaps);