diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2024-06-11 13:21:32 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2024-06-11 13:31:01 +0300 |
commit | 3cd4e0aa7961889eb06374885ed648f5b9bd85bc (patch) | |
tree | 6a089aedea155b1f1a74b553f4d1b57c70554a8f /src/webenginequick | |
parent | 6d029165d1593c514db08c34d6b08a00a4435d5e (diff) | |
parent | 38063a6332b9f948a0381763271e9a9ac7af0999 (diff) |
Merge tag 'v6.2.9-lts' into tqtc/lts-6.2-opensource6.2.9
Qt 6.2.9-lts release
Conflicts solved:
dependencies.yaml
examples/webenginewidgets/push-notifications/CMakeLists.txt
Change-Id: I0127c2575369f6939df89f3301659470d481b9bf
Diffstat (limited to 'src/webenginequick')
20 files changed, 315 insertions, 56 deletions
diff --git a/src/webenginequick/CMakeLists.txt b/src/webenginequick/CMakeLists.txt index ebe1ddf54..0081edb7f 100644 --- a/src/webenginequick/CMakeLists.txt +++ b/src/webenginequick/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + add_subdirectory(ui) qt_internal_add_qml_module(WebEngineQuick @@ -34,7 +37,6 @@ qt_internal_add_qml_module(WebEngineQuick api/qquickwebengineforeigntypes_p.h api/qtwebenginequickglobal.cpp api/qtwebenginequickglobal.h api/qtwebenginequickglobal_p.h - qquickwebengine_accessible.cpp qquickwebengine_accessible.h render_widget_host_view_qt_delegate_quickwindow.cpp render_widget_host_view_qt_delegate_quickwindow.h ui_delegates_manager.cpp ui_delegates_manager.h DEFINES @@ -55,6 +57,11 @@ qt_internal_add_qml_module(WebEngineQuick Qt::WebEngineCore ) +qt_internal_extend_target(WebEngineQuick CONDITION QT_FEATURE_accessibility + SOURCES + qquickwebengine_accessible.cpp qquickwebengine_accessible.h +) + qt_internal_extend_target(qtwebenginequickplugin SOURCES plugin.cpp diff --git a/src/webenginequick/api/qquickwebengineaction.cpp b/src/webenginequick/api/qquickwebengineaction.cpp index 70205f883..006715c70 100644 --- a/src/webenginequick/api/qquickwebengineaction.cpp +++ b/src/webenginequick/api/qquickwebengineaction.cpp @@ -20,7 +20,7 @@ QT_BEGIN_NAMESPACE method. It provides information about the action, such as whether it is \l enabled. - The following code uses the \l WebEngineView::action() method to check if the + The following code uses the \l WebEngineView::action() method to check if the copy action is enabled: \code @@ -30,6 +30,14 @@ QT_BEGIN_NAMESPACE else console.log("Copy is disabled."); \endcode + + A \l ToolButton can be connected to a WebEngineAction as follows: + + \snippet qtwebengine_webengineaction.qml 0 + + A context menu could be implemented like this: + + \snippet qtwebengine_webengineaction.qml 1 */ QQuickWebEngineActionPrivate::QQuickWebEngineActionPrivate(const QVariant &data, const QString &text, const QString &iconName, bool enabled) diff --git a/src/webenginequick/api/qquickwebenginedialogrequests.cpp b/src/webenginequick/api/qquickwebenginedialogrequests.cpp index 3c9f8a9a7..d49f17397 100644 --- a/src/webenginequick/api/qquickwebenginedialogrequests.cpp +++ b/src/webenginequick/api/qquickwebenginedialogrequests.cpp @@ -685,6 +685,35 @@ void QQuickWebEngineFileDialogRequest::dialogReject() \since QtWebEngine 1.10 \brief A request for showing a tooltip to the user. + + A TooltipRequest is a request object that is passed as a + parameter of the WebEngineView::tooltipRequested signal. Use the + \c onTooltipRequested signal handler to handle requests for + custom tooltip menus at specific positions. + + The \l accepted property of the request indicates whether the request + is handled by the user code or the default tooltip should + be displayed. + + The following code uses a custom tooltip to handle the request: + + \code + WebEngineView { + // ... + onTooltipRequested: function(request) { + if (request.type == TooltipRequest.Show) { + tooltip.visible = true; + tooltip.x = request.x; + tooltip.y = request.y; + tooltip.text = request.text; + } else { + tooltip.visible = false; + } + request.accepted = true; + } + // ... + } + \endcode */ QQuickWebEngineTooltipRequest::QQuickWebEngineTooltipRequest( diff --git a/src/webenginequick/api/qquickwebengineprofile.cpp b/src/webenginequick/api/qquickwebengineprofile.cpp index 3c7989cf0..8292da894 100644 --- a/src/webenginequick/api/qquickwebengineprofile.cpp +++ b/src/webenginequick/api/qquickwebengineprofile.cpp @@ -823,6 +823,41 @@ QString QQuickWebEngineProfile::downloadPath() const } /*! + \qmlproperty bool WebEngineProfile::isPushServiceEnabled + \since QtWebEngine 6.5 + + Whether the push messaging service is enabled. + \note By default the push messaging service is disabled. + \note \QWE uses the \l {https://firebase.google.com}{Firebase Cloud Messaging (FCM)} as a browser push service. + Therefore, all push messages will go through the Google push service and its respective servers. +*/ + +/*! + \property QQuickWebEngineProfile::isPushServiceEnabled + \since QtWebEngine 6.5 + + Whether the push messaging service is enabled. + \note By default the push messaging service is disabled. + \note \QWE uses the \l {https://firebase.google.com}{Firebase Cloud Messaging (FCM)} as a browser push service. + Therefore, all push messages will go through the Google push service and its respective servers. +*/ + +bool QQuickWebEngineProfile::isPushServiceEnabled() const +{ + const Q_D(QQuickWebEngineProfile); + return d->profileAdapter()->pushServiceEnabled(); +} + +void QQuickWebEngineProfile::setPushServiceEnabled(bool enabled) +{ + Q_D(QQuickWebEngineProfile); + if (isPushServiceEnabled() == enabled) + return; + d->profileAdapter()->setPushServiceEnabled(enabled); + emit pushServiceEnabledChanged(); +} + +/*! Returns the cookie store for this profile. */ diff --git a/src/webenginequick/api/qquickwebengineprofile.h b/src/webenginequick/api/qquickwebengineprofile.h index 77e367d02..29d6ee0b2 100644 --- a/src/webenginequick/api/qquickwebengineprofile.h +++ b/src/webenginequick/api/qquickwebengineprofile.h @@ -37,6 +37,7 @@ class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineProfile : public QObject { Q_PROPERTY(bool spellCheckEnabled READ isSpellCheckEnabled WRITE setSpellCheckEnabled NOTIFY spellCheckEnabledChanged FINAL REVISION(1,3)) Q_PROPERTY(QQuickWebEngineScriptCollection *userScripts READ userScripts) Q_PROPERTY(QString downloadPath READ downloadPath WRITE setDownloadPath NOTIFY downloadPathChanged FINAL REVISION(1,5)) + Q_PROPERTY(bool isPushServiceEnabled READ isPushServiceEnabled WRITE setPushServiceEnabled NOTIFY pushServiceEnabledChanged FINAL REVISION(6,5)) QML_NAMED_ELEMENT(WebEngineProfile) QML_ADDED_IN_VERSION(1, 1) QML_EXTRA_VERSION(2, 0) @@ -108,6 +109,9 @@ public: QString downloadPath() const; void setDownloadPath(const QString &path); + bool isPushServiceEnabled() const; + void setPushServiceEnabled(bool enable); + QWebEngineClientCertificateStore *clientCertificateStore(); static QQuickWebEngineProfile *defaultProfile(); @@ -125,6 +129,7 @@ Q_SIGNALS: Q_REVISION(1,3) void spellCheckLanguagesChanged(); Q_REVISION(1,3) void spellCheckEnabledChanged(); Q_REVISION(1,5) void downloadPathChanged(); + Q_REVISION(6,5) void pushServiceEnabledChanged(); void downloadRequested(QQuickWebEngineDownloadRequest *download); void downloadFinished(QQuickWebEngineDownloadRequest *download); diff --git a/src/webenginequick/api/qquickwebengineview.cpp b/src/webenginequick/api/qquickwebengineview.cpp index deb68c6d3..5e248327d 100644 --- a/src/webenginequick/api/qquickwebengineview.cpp +++ b/src/webenginequick/api/qquickwebengineview.cpp @@ -24,7 +24,6 @@ #include "file_picker_controller.h" #include "find_text_helper.h" #include "javascript_dialog_controller.h" -#include "qquickwebengine_accessible.h" #include "render_widget_host_view_qt_delegate_item.h" #include "render_widget_host_view_qt_delegate_quickwindow.h" #include "touch_selection_menu_controller.h" @@ -37,7 +36,6 @@ #include <QtWebEngineCore/qwebenginefullscreenrequest.h> #include <QtWebEngineCore/qwebengineloadinginfo.h> #include <QtWebEngineCore/qwebenginenavigationrequest.h> -#include <QtWebEngineCore/qwebenginequotarequest.h> #include <QtWebEngineCore/qwebengineregisterprotocolhandlerrequest.h> #include <QtWebEngineCore/qwebenginescriptcollection.h> #include <QtWebEngineCore/private/qwebenginecontextmenurequest_p.h> @@ -59,6 +57,12 @@ #include <QtQml/qqmlengine.h> #include <QtQml/qqmlproperty.h> +#if QT_CONFIG(accessibility) +#include "qquickwebengine_accessible.h" + +#include <QtGui/qaccessible.h> +#endif + #if QT_CONFIG(webengine_printing_and_pdf) #include <QtCore/qmargins.h> #include <QtGui/qpagelayout.h> @@ -174,7 +178,6 @@ QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate() , m_fullscreenMode(false) , isLoading(false) , m_activeFocusOnPress(true) - , devicePixelRatio(QGuiApplication::primaryScreen()->devicePixelRatio()) , m_webChannel(nullptr) , m_webChannelWorld(0) , m_defaultAudioMuted(false) @@ -651,12 +654,6 @@ void QQuickWebEngineViewPrivate::runMouseLockPermissionRequest(const QUrl &secur adapter->grantMouseLockPermission(securityOrigin, false); } -void QQuickWebEngineViewPrivate::runQuotaRequest(QWebEngineQuotaRequest request) -{ - Q_Q(QQuickWebEngineView); - Q_EMIT q->quotaRequested(request); -} - void QQuickWebEngineViewPrivate::runRegisterProtocolHandlerRequest(QWebEngineRegisterProtocolHandlerRequest request) { Q_Q(QQuickWebEngineView); @@ -1349,7 +1346,11 @@ void QQuickWebEngineView::runJavaScript(const QString &script, quint32 worldId, d->ensureContentsAdapter(); if (!callback.isUndefined()) { quint64 requestId = d_ptr->adapter->runJavaScriptCallbackResult(script, worldId); - d->m_callbacks.insert(requestId, callback); + if (requestId) { + d->m_callbacks.insert(requestId, callback); + } else { + callback.call(); + } } else d->adapter->runJavaScript(script, worldId); } diff --git a/src/webenginequick/api/qquickwebengineview_p.h b/src/webenginequick/api/qquickwebengineview_p.h index 00c6f3018..906e7c3fd 100644 --- a/src/webenginequick/api/qquickwebengineview_p.h +++ b/src/webenginequick/api/qquickwebengineview_p.h @@ -16,6 +16,7 @@ // #include <QtWebEngineCore/qtwebenginecoreglobal.h> +#include <QtWebEngineCore/qwebenginequotarequest.h> #include <QtWebEngineQuick/private/qtwebenginequickglobal_p.h> #include <QtGui/qcolor.h> #include <QtQml/qqmlregistration.h> @@ -46,7 +47,6 @@ class QWebEngineHistory; class QWebEngineLoadingInfo; class QWebEngineNavigationRequest; class QWebEngineNewWindowRequest; -class QWebEngineQuotaRequest; class QWebEngineRegisterProtocolHandlerRequest; class QQuickWebEngineScriptCollection; class QQuickWebEngineTouchSelectionMenuRequest; @@ -516,7 +516,10 @@ Q_SIGNALS: Q_REVISION(1,4) void colorDialogRequested(QQuickWebEngineColorDialogRequest *request); Q_REVISION(1,4) void fileDialogRequested(QQuickWebEngineFileDialogRequest *request); Q_REVISION(1,5) void pdfPrintingFinished(const QString &filePath, bool success); - Q_REVISION(1,7) void quotaRequested(const QWebEngineQuotaRequest &request); +#if QT_DEPRECATED_SINCE(6, 5) + QT_DEPRECATED_VERSION_X_6_5("Requesting host quota is no longer supported.") + Q_REVISION(1, 7) void quotaRequested(const QWebEngineQuotaRequest &request); +#endif Q_REVISION(1,7) void geometryChangeRequested(const QRect &geometry, const QRect &frameGeometry); Q_REVISION(1,7) void inspectedViewChanged(); Q_REVISION(1,7) void devToolsViewChanged(); diff --git a/src/webenginequick/api/qquickwebengineview_p_p.h b/src/webenginequick/api/qquickwebengineview_p_p.h index 2d28a89af..aa67fd291 100644 --- a/src/webenginequick/api/qquickwebengineview_p_p.h +++ b/src/webenginequick/api/qquickwebengineview_p_p.h @@ -27,7 +27,6 @@ #include <QtCore/qscopedpointer.h> #include <QtCore/qsharedpointer.h> #include <QtCore/qstring.h> -#include <QtGui/qaccessibleobject.h> namespace QtWebEngineCore { class RenderWidgetHostViewQtDelegateItem; @@ -103,7 +102,6 @@ public: void authenticationRequired(QSharedPointer<QtWebEngineCore::AuthenticationDialogController>) override; void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) override; void runMouseLockPermissionRequest(const QUrl &securityOrigin) override; - void runQuotaRequest(QWebEngineQuotaRequest) override; void runRegisterProtocolHandlerRequest(QWebEngineRegisterProtocolHandlerRequest) override; void runFileSystemAccessRequest(QWebEngineFileSystemAccessRequest) override; QObject *accessibilityParentObject() override; @@ -158,8 +156,6 @@ public: bool m_fullscreenMode; bool isLoading; bool m_activeFocusOnPress; - bool m_navigationActionTriggered; - qreal devicePixelRatio; QMap<quint64, QJSValue> m_callbacks; QQmlWebChannel *m_webChannel; QPointer<QQuickWebEngineView> inspectedView; diff --git a/src/webenginequick/api/qtwebenginequickglobal.cpp b/src/webenginequick/api/qtwebenginequickglobal.cpp index 607777e55..f8f520a05 100644 --- a/src/webenginequick/api/qtwebenginequickglobal.cpp +++ b/src/webenginequick/api/qtwebenginequickglobal.cpp @@ -43,9 +43,13 @@ void initialize() QtWebEngineCore::initialize(); return; } + // call initialize the same way as widgets do qAddPreRoutine(QtWebEngineCore::initialize); - QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi); + auto api = QQuickWindow::graphicsApi(); + if (api != QSGRendererInterface::OpenGL && api != QSGRendererInterface::Vulkan + && api != QSGRendererInterface::Metal && api != QSGRendererInterface::Direct3D11) + QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL); } } // namespace QtWebEngineQuick diff --git a/src/webenginequick/configure.cmake b/src/webenginequick/configure.cmake index 649154301..b256e5a1d 100644 --- a/src/webenginequick/configure.cmake +++ b/src/webenginequick/configure.cmake @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + qt_feature("webenginequick-ui-delegates" PRIVATE SECTION "WebEngine" LABEL "UI Delegates" diff --git a/src/webenginequick/doc/snippets/minimal/main.cpp b/src/webenginequick/doc/snippets/minimal/main.cpp new file mode 100644 index 000000000..e17493a36 --- /dev/null +++ b/src/webenginequick/doc/snippets/minimal/main.cpp @@ -0,0 +1,18 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +//! [Minimal Example] +#include <QGuiApplication> +#include <QQmlApplicationEngine> +#include <QtWebEngineQuick/qtwebenginequickglobal.h> + +int main(int argc, char *argv[]) +{ + QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); + QtWebEngineQuick::initialize(); + QGuiApplication app(argc, argv); + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + return app.exec(); +} +//! [Minimal Example] diff --git a/src/webenginequick/doc/snippets/minimal/main.qml b/src/webenginequick/doc/snippets/minimal/main.qml new file mode 100644 index 000000000..87a8757df --- /dev/null +++ b/src/webenginequick/doc/snippets/minimal/main.qml @@ -0,0 +1,18 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +//! [Minimal Example] +import QtQuick +import QtQuick.Window +import QtWebEngine + +Window { + width: 1024 + height: 750 + visible: true + WebEngineView { + anchors.fill: parent + url: "https://www.qt.io" + } +} +//! [Minimal Example] diff --git a/src/webenginequick/doc/snippets/qtwebengine_webengineaction.qml b/src/webenginequick/doc/snippets/qtwebengine_webengineaction.qml new file mode 100644 index 000000000..2fd5f490b --- /dev/null +++ b/src/webenginequick/doc/snippets/qtwebengine_webengineaction.qml @@ -0,0 +1,123 @@ +// Copyright (C) 2018 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick.Window +import QtWebEngine +import QtQuick.Controls +import QtQuick.Layouts + +ApplicationWindow { + id: window + visible: true + width: 800 + height: 600 + title: qsTr("WebEngineAction Example") + + header: ToolBar { + RowLayout { + anchors.fill: parent +//! [0] + ToolButton { + property int itemAction: WebEngineView.Back + text: webEngineView.action(itemAction).text + enabled: webEngineView.action(itemAction).enabled + onClicked: webEngineView.action(itemAction).trigger() + icon.name: webEngineView.action(itemAction).iconName + display: AbstractButton.TextUnderIcon + } +//! [0] + ToolButton { + property int itemAction: WebEngineView.Forward + text: webEngineView.action(itemAction).text + enabled: webEngineView.action(itemAction).enabled + onClicked: webEngineView.action(itemAction).trigger() + icon.name: webEngineView.action(itemAction).iconName + display: AbstractButton.TextUnderIcon + } + + ToolButton { + property int itemAction: webEngineView.loading ? WebEngineView.Stop : WebEngineView.Reload + text: webEngineView.action(itemAction).text + enabled: webEngineView.action(itemAction).enabled + onClicked: webEngineView.action(itemAction).trigger() + icon.name: webEngineView.action(itemAction).iconName + display: AbstractButton.TextUnderIcon + } + + TextField { + Layout.fillWidth: true + + text: webEngineView.url + selectByMouse: true + onEditingFinished: webEngineView.url = utils.fromUserInput(text) + } + + ToolButton { + id: settingsButton + text: "Settings" + icon.name: "settings-configure" + display: AbstractButton.TextUnderIcon + onClicked: settingsMenu.open() + checked: settingsMenu.visible + + Menu { + id: settingsMenu + y: settingsButton.height + + MenuItem { + id: customContextMenuOption + checkable: true + checked: true + + text: "Custom context menu" + } + } + } + } + } + + WebEngineView { + id: webEngineView + url: "https://qt.io" + anchors.fill: parent + + Component.onCompleted: { + profile.downloadRequested.connect(function(download){ + download.accept(); + }) + } + +//! [1] + property Menu contextMenu: Menu { + Repeater { + model: [ + WebEngineView.Back, + WebEngineView.Forward, + WebEngineView.Reload, + WebEngineView.SavePage, + WebEngineView.Copy, + WebEngineView.Paste, + WebEngineView.Cut, + WebEngineView.ChangeTextDirectionLTR, + WebEngineView.ChangeTextDirectionRTL, + ] + MenuItem { + text: webEngineView.action(modelData).text + enabled: webEngineView.action(modelData).enabled + onClicked: webEngineView.action(modelData).trigger() + icon.name: webEngineView.action(modelData).iconName + display: MenuItem.TextBesideIcon + } + } + } + + onContextMenuRequested: function(request) { + if (customContextMenuOption.checked) { + request.accepted = true; + contextMenu.popup(); + } + } +//! [1] + } +} diff --git a/src/webenginequick/doc/src/qtwebengine-qmlmodule.qdoc b/src/webenginequick/doc/src/qtwebengine-qmlmodule.qdoc index 19348508c..ecf3a4a6e 100644 --- a/src/webenginequick/doc/src/qtwebengine-qmlmodule.qdoc +++ b/src/webenginequick/doc/src/qtwebengine-qmlmodule.qdoc @@ -17,4 +17,13 @@ in the Qt6 package and \c target_link_libraries() to link against the module: \snippet qtwebengine_build_snippet.qdoc 2 + + The minimal amount of code needed to load and display an HTML page using the QML engine + requires a proper initialization: + + \snippet minimal/main.cpp Minimal Example + + Where the content of main.qml is simply: + + \snippet minimal/main.qml Minimal Example */ diff --git a/src/webenginequick/doc/src/quota_request.qdoc b/src/webenginequick/doc/src/quota_request.qdoc index 579d78008..01f4ec286 100644 --- a/src/webenginequick/doc/src/quota_request.qdoc +++ b/src/webenginequick/doc/src/quota_request.qdoc @@ -6,8 +6,12 @@ \instantiates QWebEngineQuotaRequest \inqmlmodule QtWebEngine \since QtWebEngine 1.7 + \deprecated [6.5] Requesting host quota is no longer supported by Chromium. - \brief A utility type for the WebEngineView::quotaRequested() signal. + The behavior of navigator.webkitPersistentStorage + is identical to navigator.webkitTemporaryStorage. + + For further details, see https://crbug.com/1233525 \sa WebEngineView::quotaRequested() */ @@ -15,36 +19,18 @@ /*! \qmlproperty url QuotaRequest::origin \readonly - - The URL of the web page that issued the quota request. */ /*! \qmlproperty qint64 QuotaRequest::requestedSize \readonly - - Contains the size of the requested disk space in bytes. */ /*! \qmlmethod void QuotaRequest::accept() - - Accepts the quota request. - - \qml - WebEngineView { - onQuotaRequested: function(request) { - if (request.requestedSize <= 5 * 1024 * 1024) - request.accept(); - else - request.reject(); - } - } - \endqml */ /*! \qmlmethod void QuotaRequest::reject() - Rejects the quota request. */ diff --git a/src/webenginequick/doc/src/webengineview_lgpl.qdoc b/src/webenginequick/doc/src/webengineview_lgpl.qdoc index 6534518e7..6390c0c02 100644 --- a/src/webenginequick/doc/src/webengineview_lgpl.qdoc +++ b/src/webenginequick/doc/src/webengineview_lgpl.qdoc @@ -24,7 +24,7 @@ \l QtWebEngineQuick::initialize in the application main source file, as illustrated by the following code snippet: - \quotefromfile webenginequick/minimal/main.cpp + \quotefromfile minimal/main.cpp \skipto main \printuntil } @@ -39,7 +39,7 @@ The following sample QML application loads a web page using the \c url property: - \quotefromfile webenginequick/minimal/main.qml + \quotefromfile minimal/main.qml \skipto import \printuntil /^\}/ @@ -1230,10 +1230,13 @@ /*! \qmlsignal WebEngineView::quotaRequested(QuotaRequest request) \since QtWebEngine 1.7 + \deprecated [6.5] This signal is no longer emitted. - This signal is emitted when the web page issues a \a request for a larger persistent storage - than the application's current allocation in File System API. The default quota - is 0 bytes. + Requesting host quota is no longer supported by Chromium. + The behavior of navigator.webkitPersistentStorage + is identical to navigator.webkitTemporaryStorage. + + For further details, see https://crbug.com/1233525 \sa QuotaRequest */ @@ -1498,6 +1501,27 @@ // ... } \endcode + + The touch handles can be also switched dynamically: + + \code + Component { + id: circleTouchHandle + Rectangle { + color: "blue" + radius: 50 + } + } + function showDefaultHandle(isDefault) { + if (isDefault) + webEngineView.touchHandleDelegate = circleTouchHandle + else + webEngineView.touchHandleDelegate = null + } + \endcode + + \note If no delegate is provided, Chromium's default touch handles will appear. + */ \sa {WebEngine Qt Quick Custom Touch Handle Example} diff --git a/src/webenginequick/qquickwebengine_accessible.cpp b/src/webenginequick/qquickwebengine_accessible.cpp index 80e2adbbd..2941f01b5 100644 --- a/src/webenginequick/qquickwebengine_accessible.cpp +++ b/src/webenginequick/qquickwebengine_accessible.cpp @@ -10,8 +10,6 @@ #include "api/qquickwebengineview_p_p.h" #include "web_contents_adapter.h" - -#if QT_CONFIG(accessibility) QT_BEGIN_NAMESPACE QQuickWebEngineViewAccessible::QQuickWebEngineViewAccessible(QQuickWebEngineView *o) : QAccessibleObject(o) @@ -147,4 +145,3 @@ QQuickWebEngineViewAccessible *RenderWidgetHostViewQtDelegateQuickAccessible::vi return static_cast<QQuickWebEngineViewAccessible *>(QAccessible::queryAccessibleInterface(m_view)); } } // namespace QtWebEngineCore -#endif // QT_CONFIG(accessibility) diff --git a/src/webenginequick/qquickwebengine_accessible.h b/src/webenginequick/qquickwebengine_accessible.h index b1a4a34f5..479de9789 100644 --- a/src/webenginequick/qquickwebengine_accessible.h +++ b/src/webenginequick/qquickwebengine_accessible.h @@ -7,8 +7,6 @@ #include <QtCore/qpointer.h> #include <QtGui/qaccessibleobject.h> -#if QT_CONFIG(accessibility) - QT_BEGIN_NAMESPACE class QQuickWebEngineView; @@ -55,6 +53,4 @@ private: }; } // namespace QtWebEngineCore -#endif // QT_CONFIG(accessibility) - #endif // QQUICKWEBENGINE_ACCESSIBLE_H diff --git a/src/webenginequick/ui/CMakeLists.txt b/src/webenginequick/ui/CMakeLists.txt index f2f281ef5..96dedf016 100644 --- a/src/webenginequick/ui/CMakeLists.txt +++ b/src/webenginequick/ui/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + set(qml_files "AlertDialog.qml" "AuthenticationDialog.qml" diff --git a/src/webenginequick/ui_delegates_manager.cpp b/src/webenginequick/ui_delegates_manager.cpp index a075a4c9b..b4036c5ee 100644 --- a/src/webenginequick/ui_delegates_manager.cpp +++ b/src/webenginequick/ui_delegates_manager.cpp @@ -33,15 +33,9 @@ namespace QtWebEngineCore { #define NO_SEPARATOR -#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG) -#define FILE_NAME_CASE_STATEMENT(TYPE, COMPONENT) \ - case UIDelegatesManager::TYPE:\ - return QString::fromLatin1(#TYPE ##".qml"); -#else #define FILE_NAME_CASE_STATEMENT(TYPE, COMPONENT) \ case UIDelegatesManager::TYPE:\ return QStringLiteral(#TYPE".qml"); -#endif static QString fileNameForComponent(UIDelegatesManager::ComponentType type) { |