diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-07-28 16:35:16 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-07-30 12:45:12 +0200 |
commit | a99922affdc7953f092dcfcf34ea741567a5bddc (patch) | |
tree | 3c6a0c272060c4e35b345e17803d76c4e29b641e /examples/webenginewidgets/browser/webview.h | |
parent | e1b98a164799d90f51336c718724fe8e6db01568 (diff) |
Add api to get the favicon URL
Adds one of the missing pieces of the QWebFrame and QWebView APIs.
Unlike the QtWebKit version this only fetches the favicon URL, and not
the icon. This is because we do not want to implement an icon database,
and that the icon would be loaded asynchronous anyway, bringing no
guarantee to be a valid icon/image yet.
Change-Id: I227311ae3676044da850e687b82bee752b5079c8
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'examples/webenginewidgets/browser/webview.h')
-rw-r--r-- | examples/webenginewidgets/browser/webview.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/webenginewidgets/browser/webview.h b/examples/webenginewidgets/browser/webview.h index aaf2aab13..352954c8d 100644 --- a/examples/webenginewidgets/browser/webview.h +++ b/examples/webenginewidgets/browser/webview.h @@ -42,6 +42,7 @@ #ifndef WEBVIEW_H #define WEBVIEW_H +#include <QIcon> #include <QWebEngineView> QT_BEGIN_NAMESPACE @@ -98,6 +99,7 @@ public: void loadUrl(const QUrl &url); QUrl url() const; + QIcon icon() const; QString lastStatusBarText() const; inline int progress() const { return m_progress; } @@ -108,6 +110,9 @@ protected: void contextMenuEvent(QContextMenuEvent *event); void wheelEvent(QWheelEvent *event); +signals: + void iconChanged(); + private slots: void setProgress(int progress); void loadFinished(); @@ -115,12 +120,16 @@ private slots: void downloadRequested(const QNetworkRequest &request); void openLinkInNewTab(); void onFeaturePermissionRequested(const QUrl &securityOrigin, QWebEnginePage::Feature); + void onIconUrlChanged(const QUrl &url); + void iconLoaded(); private: QString m_statusBarText; QUrl m_initialUrl; int m_progress; WebPage *m_page; + QIcon m_icon; + QNetworkReply *m_iconReply; }; #endif |