summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_view_qt.cpp
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2018-06-07 09:58:31 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2019-01-31 07:51:32 +0000
commit713cfd8a684b2fd4e1d4a74d19415c36c370adbb (patch)
tree72b4da49e1dd4d2f5176bd97d8c97a8ec4336fb2 /src/core/web_contents_view_qt.cpp
parent94d2cba36b8a1c3e02ca2abf16b11963fd1801d5 (diff)
Implement touch text selection for QQuickWebEngineView
Touch handle and touch selection menu are not implemented for widget. Task-number: QTBUG-59999 Change-Id: Ia492e58b83d3ad38cdf6877d468724c399f34367 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_contents_view_qt.cpp')
-rw-r--r--src/core/web_contents_view_qt.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp
index f44668019..648e0fd8f 100644
--- a/src/core/web_contents_view_qt.cpp
+++ b/src/core/web_contents_view_qt.cpp
@@ -44,6 +44,7 @@
#include "render_widget_host_view_qt.h"
#include "render_widget_host_view_qt_delegate.h"
#include "render_widget_host_view_qt.h"
+#include "touch_selection_controller_client_qt.h"
#include "type_conversion.h"
#include "web_contents_adapter_client.h"
#include "web_contents_adapter.h"
@@ -189,6 +190,11 @@ static inline WebEngineContextMenuData fromParams(const content::ContextMenuPara
void WebContentsViewQt::ShowContextMenu(content::RenderFrameHost *, const content::ContextMenuParams &params)
{
+ if (auto rwhv = static_cast<RenderWidgetHostViewQt *>(m_webContents->GetRenderWidgetHostView())) {
+ if (rwhv && rwhv->getTouchSelectionControllerClient()->handleContextMenu(params))
+ return;
+ }
+
WebEngineContextMenuData contextMenuData(fromParams(params));
#if QT_CONFIG(webengine_spellchecker)
// Do not use params.spellcheck_enabled, since it is never