feat: 限制同标题进程单例运行;网页链接调用浏览器打开

使用 DApplication::setSingleInstance,使用 标题_uid 创建进程锁,单例运行时新进程自动退出,并拉起原有进程主窗口显示;重写 QWebEnginePage,createWindow 时若链接与原来不同,则调用浏览器打开

Log: 支持单例运行;支持浏览器打开外部链接;修复访问深度论坛默认语言错误问题
This commit is contained in:
zty199
2022-11-20 15:57:54 +08:00
parent d6b5895812
commit 1aed5532a3
18 changed files with 494 additions and 285 deletions

View File

@@ -0,0 +1,15 @@
#ifndef WEBENGINEURLREQUESTINTERCEPTOR_H
#define WEBENGINEURLREQUESTINTERCEPTOR_H
#include <QWebEngineUrlRequestInterceptor>
class WebEngineUrlRequestInterceptor : public QWebEngineUrlRequestInterceptor
{
Q_OBJECT
public:
explicit WebEngineUrlRequestInterceptor(QObject *parent = nullptr);
void interceptRequest(QWebEngineUrlRequestInfo &info) override;
};
#endif // WEBENGINEURLREQUESTINTERCEPTOR_H