diff options
author | Michal Klocek <michal.klocek@qt.io> | 2020-07-29 15:30:44 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2020-08-12 15:57:59 +0200 |
commit | 0dca1220141c1aa0ce983e27f1f09425f47f062d (patch) | |
tree | 7ed5a37e17589daeda3e164042a435efc38dac89 /src/webengine/plugin/plugin.cpp | |
parent | c2b43bc93d81ed2e768501e680430a1df22166b6 (diff) |
Merge all webenginecontextmenudata wrappers into one class
Introduce new class qwebenginecontextmenurequest in core which merges:
* qquickwebenginecontextmenurequest
* qwebenginecontextmenudata
* implictly shared webenginecontextdata
Unfortunately new class has to be QObject, since we want to reuse it qml.
Q_GADGET can be used only as a value type, however we need to know if
request is accepted or not in qml, therefore it must be passed
as pointer. Since we use QObject now, class is no longer implicitly
shared, however we only allocate request once and reuse the object for
every new request (it is still copied in qml just to keep it aligned
with other request handlers)
[ChangleLog] QWebEngineContextMenuRequest is replacement for
QWebEngineContextMenuData
Change-Id: Ib387ec2065361a4bacc20675ca7352ab75a0e436
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/webengine/plugin/plugin.cpp')
-rw-r--r-- | src/webengine/plugin/plugin.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/webengine/plugin/plugin.cpp b/src/webengine/plugin/plugin.cpp index a74373b23..2603e91ef 100644 --- a/src/webengine/plugin/plugin.cpp +++ b/src/webengine/plugin/plugin.cpp @@ -42,7 +42,6 @@ #include <QtWebEngine/private/qquickwebenginecertificateerror_p.h> #include <QtWebEngine/private/qquickwebengineclientcertificateselection_p.h> -#include <QtWebEngine/private/qquickwebenginecontextmenurequest_p.h> #include <QtWebEngine/private/qquickwebenginedialogrequests_p.h> #include <QtWebEngine/private/qquickwebenginedownloaditem_p.h> #include <QtWebEngine/private/qquickwebenginehistory_p.h> @@ -59,6 +58,7 @@ #include <QtWebEngineCore/qwebenginenotification.h> #include <QtWebEngineCore/qwebenginequotarequest.h> #include <QtWebEngineCore/qwebengineregisterprotocolhandlerrequest.h> +#include <QtWebEngineCore/qwebenginecontextmenurequest.h> QT_BEGIN_NAMESPACE @@ -144,10 +144,8 @@ public: qmlRegisterUncreatableType<QQuickWebEngineFullScreenRequest>(uri, 1, 1, "FullScreenRequest", msgUncreatableType("FullScreenRequest")); - qmlRegisterUncreatableType<QQuickWebEngineContextMenuRequest>(uri, 1, 4, "ContextMenuRequest", - msgUncreatableType("ContextMenuRequest")); - qmlRegisterUncreatableType<QQuickWebEngineContextMenuRequest, 1>(uri, 1, 7, "ContextMenuRequest", - msgUncreatableType("ContextMenuRequest")); + qmlRegisterUncreatableType<QWebEngineContextMenuRequest, 1>( + uri, 1, 7, "ContextMenuRequest", msgUncreatableType("ContextMenuRequest")); qmlRegisterUncreatableType<QQuickWebEngineAuthenticationDialogRequest>(uri, 1, 4, "AuthenticationDialogRequest", msgUncreatableType("AuthenticationDialogRequest")); qmlRegisterUncreatableType<QQuickWebEngineJavaScriptDialogRequest>(uri, 1, 4, "JavaScriptDialogRequest", |