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/plugin/experimental/plugin.cpp | 5 ----- src/webengine/plugin/plugin.cpp | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/webengine/plugin') diff --git a/src/webengine/plugin/experimental/plugin.cpp b/src/webengine/plugin/experimental/plugin.cpp index 857f1de0e..29b5413f4 100644 --- a/src/webengine/plugin/experimental/plugin.cpp +++ b/src/webengine/plugin/experimental/plugin.cpp @@ -36,7 +36,6 @@ #include -#include "qquickwebenginehistory_p.h" #include "qquickwebengineview_p.h" #include "qquickwebengineview_p_p.h" @@ -67,10 +66,6 @@ public: QObject::tr("Cannot create a separate instance of WebEngineViewExperimental")); qmlRegisterUncreatableType(uri, 1, 0, "WebEngineViewport", QObject::tr("Cannot create a separate instance of WebEngineViewport")); - qmlRegisterUncreatableType(uri, 1, 0, "NavigationHistory", - QObject::tr("Cannot create a separate instance of NavigationHistory")); - qmlRegisterUncreatableType(uri, 1, 0, "NavigationHistoryListModel", - QObject::tr("Cannot create a separate instance of NavigationHistory")); // Use the latest revision of QQuickWebEngineView when importing QtWebEngine.experimental 1.0 qmlRegisterRevision(uri, 1, 0); diff --git a/src/webengine/plugin/plugin.cpp b/src/webengine/plugin/plugin.cpp index da1b4f81b..b752315f7 100644 --- a/src/webengine/plugin/plugin.cpp +++ b/src/webengine/plugin/plugin.cpp @@ -38,6 +38,7 @@ #include "qquickwebenginecertificateerror_p.h" #include "qquickwebenginedownloaditem_p.h" +#include "qquickwebenginehistory_p.h" #include "qquickwebengineloadrequest_p.h" #include "qquickwebenginenavigationrequest_p.h" #include "qquickwebenginenewviewrequest_p.h" @@ -75,6 +76,10 @@ public: qmlRegisterUncreatableType(uri, 1, 1, "WebEngineNewViewRequest", QObject::tr("Cannot create separate instance of WebEngineNewViewRequest")); qmlRegisterUncreatableType(uri, 1, 1, "WebEngineSettings", QObject::tr("Cannot create a separate instance of WebEngineSettings")); qmlRegisterSingletonType(uri, 1, 1, "WebEngine", webEngineSingletonProvider); + qmlRegisterUncreatableType(uri, 1, 1, "NavigationHistory", + QObject::tr("Cannot create a separate instance of NavigationHistory")); + qmlRegisterUncreatableType(uri, 1, 1, "NavigationHistoryListModel", + QObject::tr("Cannot create a separate instance of NavigationHistory")); } }; -- cgit v1.2.3