From 6717d58192a9e4fb87b4721a34f3715766863851 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Thu, 12 Feb 2015 20:17:40 +0100 Subject: Move navigationHistory out of experimental Add an offset role to the models. Implement goBackAndForward that uses this offset. Also add a complete model, items, that includes current navigation entry (at offset 0) to allow for the Firefox-style single menu, and add that one to the nano browser example. The models are now instantiated lazily as it's unlikely the three models will be used by the same app. Change-Id: Ib551738611497c7eb9c501f045cda315968a2ada Reviewed-by: Andras Becsi --- src/webengine/api/qquickwebengineview_p.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/webengine/api/qquickwebengineview_p.h') diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h index 91fd4f654..a9f387e87 100644 --- a/src/webengine/api/qquickwebengineview_p.h +++ b/src/webengine/api/qquickwebengineview_p.h @@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE class QQmlWebChannel; class QQuickWebEngineCertificateError; +class QQuickWebEngineHistory; class QQuickWebEngineLoadRequest; class QQuickWebEngineNavigationRequest; class QQuickWebEngineNewViewRequest; @@ -64,6 +65,7 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem { Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor NOTIFY zoomFactorChanged REVISION 1) Q_PROPERTY(QQuickWebEngineProfile *profile READ profile WRITE setProfile FINAL REVISION 1) Q_PROPERTY(QQuickWebEngineSettings *settings READ settings REVISION 1) + Q_PROPERTY(QQuickWebEngineHistory *navigationHistory READ navigationHistory CONSTANT FINAL REVISION 1) Q_PROPERTY(QQmlWebChannel *webChannel READ webChannel WRITE setWebChannel NOTIFY webChannelChanged REVISION 1) Q_ENUMS(NavigationRequestAction); Q_ENUMS(NavigationType); @@ -147,12 +149,14 @@ public: QQuickWebEngineSettings *settings() const; QQmlWebChannel *webChannel(); void setWebChannel(QQmlWebChannel *); + QQuickWebEngineHistory *navigationHistory() const; public Q_SLOTS: void runJavaScript(const QString&, const QJSValue & = QJSValue()); void loadHtml(const QString &html, const QUrl &baseUrl = QUrl()); void goBack(); void goForward(); + void goBackOrForward(int index); void reload(); void stop(); -- cgit v1.2.3