mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-15 13:22:04 +08:00
首页链接调用浏览器打开 Log: 使用自定义 WebEngineView 和 WebEnginePage 替代 QWebEngineView,重写 createWindow 方法,当页面存在新建窗口或标签页动作时调用浏览器打开网址;修改 Widget UI 布局,在 page1 添加 QVBoxLayout,保证 WebEngineView 自动撑满布局,去除 webFoot 填充控件;更新翻译文件,添加“请勿频繁搜索”翻译文案,去除残留翻译
27 lines
461 B
C++
27 lines
461 B
C++
#ifndef WEBENGINEPAGE_H
|
|
#define WEBENGINEPAGE_H
|
|
|
|
#include <QWebEnginePage>
|
|
|
|
class WebEnginePage : public QWebEnginePage
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit WebEnginePage(QObject *parent = nullptr);
|
|
~WebEnginePage() override;
|
|
|
|
void setUrl(const QUrl &url);
|
|
|
|
protected:
|
|
QWebEnginePage *createWindow(WebWindowType type) override;
|
|
|
|
private slots:
|
|
void slotUrlChanged(const QUrl &url);
|
|
|
|
private:
|
|
QUrl m_currentUrl;
|
|
};
|
|
|
|
#endif // WEBENGINEPAGE_H
|