diff --git a/src/Mod/Web/Gui/BrowserView.cpp b/src/Mod/Web/Gui/BrowserView.cpp index c2e288e9b2..7259342d42 100644 --- a/src/Mod/Web/Gui/BrowserView.cpp +++ b/src/Mod/Web/Gui/BrowserView.cpp @@ -105,7 +105,7 @@ public: { if (info.navigationType() == QWebEngineUrlRequestInfo::NavigationTypeLink) { // invoke thread safe. - QMetaObject::invokeMethod(m_parent, "onLinkClicked", + QMetaObject::invokeMethod(m_parent, "urlFilter", Q_ARG(QUrl, info.requestUrl())); } @@ -346,6 +346,9 @@ BrowserView::BrowserView(QWidget* parent) interceptLinks = new WebEngineUrlRequestInterceptor(this); profile->setRequestInterceptor(interceptLinks); + + view->settings()->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, true); + #endif view->setAttribute(Qt::WA_OpaquePaintEvent, true); @@ -386,7 +389,11 @@ BrowserView::~BrowserView() delete view; } +#ifdef QTWEBENGINE +void BrowserView::urlFilter(const QUrl &url) +#else void BrowserView::onLinkClicked (const QUrl & url) +#endif { QString scheme = url.scheme(); QString host = url.host(); diff --git a/src/Mod/Web/Gui/BrowserView.h b/src/Mod/Web/Gui/BrowserView.h index 4a3185e6b3..b8a5b8fba6 100644 --- a/src/Mod/Web/Gui/BrowserView.h +++ b/src/Mod/Web/Gui/BrowserView.h @@ -108,15 +108,16 @@ protected Q_SLOTS: void onLoadStarted(); void onLoadProgress(int); void onLoadFinished(bool); - void onLinkClicked (const QUrl& url); bool chckHostAllowed(const QString& host); #ifdef QTWEBENGINE void onDownloadRequested(QWebEngineDownloadItem *request); void setWindowIcon(const QIcon &icon); + void urlFilter(const QUrl &url); void onViewSource(const QUrl &url); #else void onDownloadRequested(const QNetworkRequest& request); void onUnsupportedContent(QNetworkReply* reply); + void onLinkClicked (const QUrl& url); #endif void onOpenLinkInExternalBrowser(const QUrl& url); void onOpenLinkInNewWindow(const QUrl&);