Commit 8f68ade7 authored by Laurent Montel's avatar Laurent Montel 😁

Move code in webenginepage directly

parent 1a88cf1f
......@@ -36,13 +36,3 @@ MailWebEnginePage::~MailWebEnginePage()
{
}
bool MailWebEnginePage::acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame)
{
Q_UNUSED(type);
Q_UNUSED(isMainFrame);
if (isMainFrame && type == NavigationTypeLinkClicked) {
Q_EMIT urlClicked(url);
}
return false;
}
......@@ -29,12 +29,6 @@ class MESSAGEVIEWER_EXPORT MailWebEnginePage : public WebEngineViewer::WebEngine
public:
explicit MailWebEnginePage(QObject *parent = Q_NULLPTR);
~MailWebEnginePage();
Q_SIGNALS:
void urlClicked(const QUrl &url);
protected:
bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame) Q_DECL_OVERRIDE;
};
}
#endif // MAILWEBENGINEPAGE_H
......@@ -68,3 +68,14 @@ QVariant WebEnginePage::execJavaScript(const QString &scriptSource, int timeout)
return result;
}
bool WebEnginePage::acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame)
{
Q_UNUSED(type);
Q_UNUSED(isMainFrame);
if (isMainFrame && type == NavigationTypeLinkClicked) {
Q_EMIT urlClicked(url);
}
return false;
}
......@@ -34,6 +34,12 @@ public:
WebEngineViewer::WebHitTest *hitTestContent(const QPoint &pos);
QVariant execJavaScript(const QString &scriptSource, int timeout = 500);
Q_SIGNALS:
void urlClicked(const QUrl &url);
protected:
bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame) Q_DECL_OVERRIDE;
private:
WebEnginePagePrivate *const d;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment