mirror of
https://gitee.com/spark-store-project/spark-web-app-runtime.git
synced 2025-12-15 03:22:05 +08:00
feat: 限制同标题进程单例运行;网页链接调用浏览器打开
使用 DApplication::setSingleInstance,使用 标题_uid 创建进程锁,单例运行时新进程自动退出,并拉起原有进程主窗口显示;重写 QWebEnginePage,createWindow 时若链接与原来不同,则调用浏览器打开 Log: 支持单例运行;支持浏览器打开外部链接;修复访问深度论坛默认语言错误问题
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <QWebEngineView>
|
||||
|
||||
// class WebEngineUrlRequestInterceptor;
|
||||
class WebEngineView : public QWebEngineView
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -10,12 +11,8 @@ class WebEngineView : public QWebEngineView
|
||||
public:
|
||||
explicit WebEngineView(QWidget *parent = nullptr);
|
||||
|
||||
protected:
|
||||
QWebEngineView *createWindow(QWebEnginePage::WebWindowType type) override;
|
||||
|
||||
private slots:
|
||||
void on_urlChanged(QUrl url);
|
||||
|
||||
private:
|
||||
// WebEngineUrlRequestInterceptor *interceptor = nullptr;
|
||||
};
|
||||
|
||||
#endif // WEBENGINEVIEW_H
|
||||
|
||||
Reference in New Issue
Block a user