mirror of
https://gitee.com/spark-store-project/spark-web-app-runtime.git
synced 2025-07-23 05:52:24 +08:00
使用 DApplication::setSingleInstance,使用 标题_uid 创建进程锁,单例运行时新进程自动退出,并拉起原有进程主窗口显示;重写 QWebEnginePage,createWindow 时若链接与原来不同,则调用浏览器打开 Log: 支持单例运行;支持浏览器打开外部链接;修复访问深度论坛默认语言错误问题
14 lines
364 B
C++
14 lines
364 B
C++
#include "webengineurlrequestinterceptor.h"
|
|
|
|
#include <QLocale>
|
|
|
|
WebEngineUrlRequestInterceptor::WebEngineUrlRequestInterceptor(QObject *parent)
|
|
: QWebEngineUrlRequestInterceptor(parent)
|
|
{
|
|
}
|
|
|
|
void WebEngineUrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
|
|
{
|
|
info.setHttpHeader("Accept-Language", QLocale::system().name().toUtf8());
|
|
}
|