Paste in WebEngineView
Unsolved
QtWebEngine
-
Is paste failing in webengineview a known issue?
It works in the webengineview nanobrowser example - but there's some sort of 'action' mapping in that sample (that I do not know if it is necessary or not.)
Is this something I need to manually add to my qml code in order for paste/copy to work?
-
@VRHans This barebones example works. Nothing extra is added.
QtWebEngine::initialize(); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
main.qml
WebEngineView { anchors.fill: parent }
Which Qt version/OS are you using ?
-
I just used a subsection from the sample's BrowserWindow.qml:
Action { shortcut: StandardKey.Copy onTriggered: currentWebView.triggerWebAction(WebEngineView.Copy) } Action { shortcut: StandardKey.Cut onTriggered: currentWebView.triggerWebAction(WebEngineView.Cut) } Action { shortcut: StandardKey.Paste onTriggered: currentWebView.triggerWebAction(WebEngineView.Paste) } Action { shortcut: "Shift+"+StandardKey.Paste onTriggered: currentWebView.triggerWebAction(WebEngineView.PasteAndMatchStyle) } Action { shortcut: StandardKey.SelectAll onTriggered: currentWebView.triggerWebAction(WebEngineView.SelectAll) } Action { shortcut: StandardKey.Undo onTriggered: currentWebView.triggerWebAction(WebEngineView.Undo) } Action { shortcut: StandardKey.Redo onTriggered: currentWebView.triggerWebAction(WebEngineView.Redo) }
-
@VRHans Can you try setting javascriptCanAccessClipboard ?
-
@VRHans Can you try setting javascriptCanAccessClipboard ?
-
No. In the code that I posted.