summaryrefslogtreecommitdiffstats
path: root/src/plugins/wasm/qwasmwebview.cpp
diff options
context:
space:
mode:
authorKaloyan Chehlarski <kaloyan.chehlarski@qt.io>2025-11-05 16:25:46 +0100
committerMichal Klocek <michal.klocek@qt.io>2025-12-01 17:39:09 +0100
commit388251ce343c617fc7a383485e9417a5306adb14 (patch)
treed658d527356e3ebea469c59ef15af5dc05d3a8e8 /src/plugins/wasm/qwasmwebview.cpp
parentc0b0855c702854c65ecdfe39a97d3f969b8780ad (diff)
Add runJavascript() to C++ API
The API follows what we have in WebEngine, with an optional std::function callback. No world ID argument is provided, however; most of the backends don't support the concept. The new function is not exposed to QML, since we cannot expose std::function arguments. Instead, the existing QML API is kept, and calls to it simply redirect to the C++ implementation. Also removes runJavaScriptPrivate() from QWebView, and its related implementation details in the plugins. Task-number: QTBUG-131837 Change-Id: Idc1e492916e17caa3f061c0b2738b3c735837cf8 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/plugins/wasm/qwasmwebview.cpp')
-rw-r--r--src/plugins/wasm/qwasmwebview.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/wasm/qwasmwebview.cpp b/src/plugins/wasm/qwasmwebview.cpp
index ca93c5e..31a7579 100644
--- a/src/plugins/wasm/qwasmwebview.cpp
+++ b/src/plugins/wasm/qwasmwebview.cpp
@@ -195,11 +195,12 @@ void QWasmWebViewPrivate::deleteAllCookies()
qWarning("deleteAllCookies() not supported on this platform");
}
-void QWasmWebViewPrivate::runJavaScriptPrivate(const QString &script, int callbackId)
+void QWasmWebViewPrivate::runJavaScript(const QString &script,
+ const std::function<void(const QVariant &)> &resultCallback)
{
Q_UNUSED(script);
- Q_UNUSED(callbackId);
- qWarning("runJavaScriptPrivate() not supported on this platform");
+ Q_UNUSED(resultCallback);
+ qWarning("runJavaScript() not supported on this platform");
}
QWebViewSettingsPrivate *QWasmWebViewPrivate::settings() const