diff options
author | Christian Strømme <[email protected]> | 2015-01-26 18:26:51 +0100 |
---|---|---|
committer | Christian Stromme <[email protected]> | 2015-02-10 12:20:20 +0000 |
commit | 083323c8b7c37092fedcec4fd34f568c4a674c03 (patch) | |
tree | 530fdea8e737cb0aef3b29490647991e8f0c78d8 /src/webview/qquickwebview.h | |
parent | e59d6a79fd5cd208fece67f79e544807bd2d72f9 (diff) |
Add loadRequest item and necessary classes to enable status reporting.
This makes it possible to listen and check the load status through the
loadingChanges signal. The new loadRequest type contains information
about the load status (started, succeeded or failed) for a specific url
and an error string if available.
[ChangeLog][WebView] Improved status reporting through a new
loadRequest item.
Task-number: QTBUG-43767
Change-Id: I65ffb91524b2e0d57875d6728b0558087d91cc0f
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
Diffstat (limited to 'src/webview/qquickwebview.h')
-rw-r--r-- | src/webview/qquickwebview.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/webview/qquickwebview.h b/src/webview/qquickwebview.h index 8b2207a..004fe10 100644 --- a/src/webview/qquickwebview.h +++ b/src/webview/qquickwebview.h @@ -57,6 +57,9 @@ QT_BEGIN_NAMESPACE +class QQuickWebViewLoadRequest; +class QWebViewLoadRequestPrivate; + class Q_WEBVIEW_EXPORT QQuickWebView : public QQuickViewController, public QWebViewInterface { Q_OBJECT @@ -66,8 +69,16 @@ class Q_WEBVIEW_EXPORT QQuickWebView : public QQuickViewController, public QWebV Q_PROPERTY(QString title READ title NOTIFY titleChanged) Q_PROPERTY(bool canGoBack READ canGoBack NOTIFY loadingChanged) Q_PROPERTY(bool canGoForward READ canGoForward NOTIFY loadingChanged) + Q_ENUMS(LoadStatus) public: + enum LoadStatus { // Changes here needs to be done in QWebView as well + LoadStartedStatus, + LoadStoppedStatus, + LoadSucceededStatus, + LoadFailedStatus + }; + QQuickWebView(QQuickItem *parent = 0); ~QQuickWebView(); @@ -91,7 +102,7 @@ public Q_SLOTS: Q_SIGNALS: void titleChanged(); void urlChanged(); - void loadingChanged(); + void loadingChanged(QQuickWebViewLoadRequest *loadRequest); void loadProgressChanged(); protected: @@ -101,6 +112,7 @@ protected: private Q_SLOTS: void onRunJavaScriptResult(int id, const QVariant &variant); void onFocusRequest(bool focus); + void onLoadingChanged(const QWebViewLoadRequestPrivate &loadRequest); private: QScopedPointer<QWebView> m_webView; |