This commit is contained in:
JackLee 2025-03-23 18:14:04 +08:00
parent 4e4189a8ed
commit b44855bf6e
3 changed files with 47 additions and 18 deletions

28
compatibility.manifest Normal file
View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<description>ctai</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"
/>
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
</application>
</compatibility>
</assembly>

View File

@ -8,12 +8,9 @@
#include "QCefWidget/CefWidget.h"
int main(int argc, char *argv[])
{
QString exeDir = QDir::currentPath();
QCoreApplication::addLibraryPath(exeDir+"/cef_binary/Release");
qDebug()<<"error:"<<exeDir;
QApplication a(argc, argv);
QCefConfig config;
config.setUserAgent("QCefViewTest");
config.setUserAgent("Mozilla/5.0 (Windows NT 10.0; CEF/3.2272.2035) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 SoftwareInformer/1.6.1400");
config.setLogLevel(QCefConfig::LOGSEVERITY_VERBOSE);
config.setBridgeObjectName("CallBridge");
config.setBuiltinSchemeName("CefView");
@ -22,25 +19,28 @@ int main(int argc, char *argv[])
config.addCommandLineSwitch("use-alloy-style");
config.addCommandLineSwitch("off-screen-rendering-enabled");
config.addCommandLineSwitch("multi-threaded-message-loop");
config.addCommandLineSwitch("external-message-pump");
config.addCommandLineSwitch("enable-chrome-runtime");
config.addCommandLineSwitch("enable-gpu");
config.addCommandLineSwitch("use-views");
config.addCommandLineSwitch("site-per-process");
//config.addCommandLineSwitch("external-message-pump");
//config.addCommandLineSwitch("enable-chrome-runtime");
//config.addCommandLineSwitch("enable-gpu");
//config.addCommandLineSwitch("use-views");
//config.addCommandLineSwitch("site-per-process");
config.addCommandLineSwitch("no-sandbox");
config.addCommandLineSwitch("in-process-gpu");
//config.addCommandLineSwitch("in-process-gpu");
config.addCommandLineSwitch("use-mock-keychain");
config.addCommandLineSwitchWithValue("ignore-certificate-errors","true");
config.addCommandLineSwitchWithValue("enable-gpu-rasterizatio","true");
config.addCommandLineSwitchWithValue("enable-accelerated-video","true");
config.addCommandLineSwitchWithValue("use-fake-ui-for-media-stream","true");
config.addCommandLineSwitchWithValue("use-fake-device-for-media-stream","true");
config.addCommandLineSwitchWithValue("renderer-process-limit", "1");
config.addCommandLineSwitchWithValue("disable-features", "BlinkGenPropertyTrees,TranslateUI,site-per-process");
config.addCommandLineSwitch("enable-chrome-runtime");
config.addCommandLineSwitch("start-stack-profiler");
//config.addCommandLineSwitchWithValue("type","gpu-process");
//config.addCommandLineSwitchWithValue("ignore-certificate-errors","true");
//config.addCommandLineSwitchWithValue("enable-gpu-rasterizatio","true");
//config.addCommandLineSwitchWithValue("enable-accelerated-video","true");
//config.addCommandLineSwitchWithValue("use-fake-ui-for-media-stream","true");
//config.addCommandLineSwitchWithValue("use-fake-device-for-media-stream","true");
//config.addCommandLineSwitchWithValue("renderer-process-limit", "1");
//config.addCommandLineSwitchWithValue("disable-features", "BlinkGenPropertyTrees,TranslateUI,site-per-process");
QCefContext cefContext(&a, argc, argv, &config);
CefWidget cw;
cw.show();
qputenv("QT_QPA_PLATFORM", "windows:fontengine=freetype");
// 加载语言包
QTranslator qtBaseTranslator;

1
sui.rc
View File

@ -1 +1,2 @@
1 24 compatibility.manifest
IDI_ICON1 ICON DISCARDABLE "res\\img\\sui.ico"