diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index 85a36df507118cec1bc4d7e2755f44bc21583915..c6c67ff019a16c1eae18133228a6535cd790700d 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -661,6 +661,12 @@ void QQuickWebEngineView::setProfile(QQuickWebEngineProfile *profile) d->setProfile(profile); } +QQuickWebEngineSettings *QQuickWebEngineView::settings() const +{ + Q_D(const QQuickWebEngineView); + return d->m_settings.data(); +} + void QQuickWebEngineViewPrivate::setProfile(QQuickWebEngineProfile *profile) { if (profile == m_profile) @@ -781,11 +787,6 @@ QQmlComponent *QQuickWebEngineViewExperimental::extraContextMenuEntriesComponent return d_ptr->contextMenuExtraItems; } -QQuickWebEngineSettings *QQuickWebEngineViewExperimental::settings() const -{ - return d_ptr->m_settings.data(); -} - void QQuickWebEngineViewExperimental::findText(const QString &subString, FindFlags options, const QJSValue &callback) { Q_D(QQuickWebEngineView); diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h index 983cc90a67225244edc9a1dfe1436f646133c9e6..b8f2fb896199b58add57420367026e4e14b519c2 100644 --- a/src/webengine/api/qquickwebengineview_p.h +++ b/src/webengine/api/qquickwebengineview_p.h @@ -47,6 +47,7 @@ class QQuickWebEngineLoadRequest; class QQuickWebEngineNavigationRequest; class QQuickWebEngineNewViewRequest; class QQuickWebEngineProfile; +class QQuickWebEngineSettings; class QQuickWebEngineViewExperimental; class QQuickWebEngineViewPrivate; @@ -61,6 +62,7 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem { Q_PROPERTY(bool canGoForward READ canGoForward NOTIFY urlChanged) Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor NOTIFY zoomFactorChanged) Q_PROPERTY(QQuickWebEngineProfile *profile READ profile WRITE setProfile FINAL) + Q_PROPERTY(QQuickWebEngineSettings *settings READ settings REVISION 1) Q_ENUMS(NavigationRequestAction); Q_ENUMS(NavigationType); Q_ENUMS(LoadStatus); @@ -139,6 +141,8 @@ public: QQuickWebEngineProfile *profile() const; void setProfile(QQuickWebEngineProfile *); + QQuickWebEngineSettings *settings() const; + public Q_SLOTS: void runJavaScript(const QString&, const QJSValue & = QJSValue()); void loadHtml(const QString &html, const QUrl &baseUrl = QUrl()); diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h index 28c8ff44ec75e956ee662cac9a1cf1661d7e05ee..48eb25cb3294bd96e7b543714e6cd706cf98f469 100644 --- a/src/webengine/api/qquickwebengineview_p_p.h +++ b/src/webengine/api/qquickwebengineview_p_p.h @@ -80,7 +80,6 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineViewExperimental : public QObjec Q_PROPERTY(QQmlComponent *extraContextMenuEntriesComponent READ extraContextMenuEntriesComponent WRITE setExtraContextMenuEntriesComponent NOTIFY extraContextMenuEntriesComponentChanged) Q_PROPERTY(bool isFullScreen READ isFullScreen WRITE setIsFullScreen NOTIFY isFullScreenChanged) Q_PROPERTY(QQuickWebEngineHistory *navigationHistory READ navigationHistory CONSTANT FINAL) - Q_PROPERTY(QQuickWebEngineSettings *settings READ settings) Q_ENUMS(Feature) Q_FLAGS(FindFlags) @@ -104,7 +103,6 @@ public: void setExtraContextMenuEntriesComponent(QQmlComponent *); QQmlComponent *extraContextMenuEntriesComponent() const; QQuickWebEngineHistory *navigationHistory() const; - QQuickWebEngineSettings *settings() const; public Q_SLOTS: void goBackTo(int index); diff --git a/src/webengine/plugin/experimental/plugin.cpp b/src/webengine/plugin/experimental/plugin.cpp index 6e4853fea43e957bffb8b1f20c510e47f39ef3fb..cd38f744cee003c30df0103e2ed62d841ad4e0c2 100644 --- a/src/webengine/plugin/experimental/plugin.cpp +++ b/src/webengine/plugin/experimental/plugin.cpp @@ -38,7 +38,6 @@ #include "qquickwebenginedownloaditem_p.h" #include "qquickwebenginehistory_p.h" -#include "qquickwebenginesettings_p.h" #include "qquickwebenginesingleton_p.h" #include "qquickwebengineview_p.h" #include "qquickwebengineview_p_p.h" @@ -79,8 +78,6 @@ public: QObject::tr("Cannot create a separate instance of NavigationHistory")); qmlRegisterUncreatableType<QQuickWebEngineHistoryListModel>(uri, 1, 0, "NavigationHistoryListModel", QObject::tr("Cannot create a separate instance of NavigationHistory")); - qmlRegisterUncreatableType<QQuickWebEngineSettings>(uri, 1, 0, "WebEngineSettings", - QObject::tr("Cannot create a separate instance of WebEngineSettings")); qmlRegisterUncreatableType<QQuickWebEngineDownloadItem>(uri, 1, 0, "WebEngineDownloadItem", QObject::tr("Cannot create a separate instance of WebEngineDownloadItem")); qmlRegisterSingletonType<QQuickWebEngineSingleton>(uri, 1, 0, "WebEngine", webEngineSingletonProvider); diff --git a/src/webengine/plugin/plugin.cpp b/src/webengine/plugin/plugin.cpp index 163bb356713b673625fefb97953c4f270657297a..486151b04b0b91ebadf20d55817773133737061e 100644 --- a/src/webengine/plugin/plugin.cpp +++ b/src/webengine/plugin/plugin.cpp @@ -41,6 +41,7 @@ #include "qquickwebenginenavigationrequest_p.h" #include "qquickwebenginenewviewrequest_p.h" #include "qquickwebengineprofile_p.h" +#include "qquickwebenginesettings_p.h" #include "qquickwebengineview_p.h" #include "qtwebengineversion.h" @@ -67,6 +68,7 @@ public: qmlRegisterType<QQuickWebEngineView, 1>(uri, 1, 1, "WebEngineView"); qmlRegisterType<QQuickWebEngineProfile>(uri, 1, 1, "WebEngineProfile"); qmlRegisterUncreatableType<QQuickWebEngineNewViewRequest>(uri, 1, 1, "WebEngineNewViewRequest", QObject::tr("Cannot create separate instance of WebEngineNewViewRequest")); + qmlRegisterUncreatableType<QQuickWebEngineSettings>(uri, 1, 1, "WebEngineSettings", QObject::tr("Cannot create a separate instance of WebEngineSettings")); } };