summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qquickwebengineview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webengine/api/qquickwebengineview.cpp')
-rw-r--r--src/webengine/api/qquickwebengineview.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index c6c67ff0..a47defb7 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -61,6 +61,7 @@
#include <QQmlContext>
#include <QQmlEngine>
#include <QQmlProperty>
+#include <QQmlWebChannel>
#include <QScreen>
#include <QStringBuilder>
#include <QUrl>
@@ -811,6 +812,23 @@ QQuickWebEngineHistory *QQuickWebEngineViewExperimental::navigationHistory() con
return d_ptr->m_history.data();
}
+QQmlWebChannel *QQuickWebEngineViewExperimental::webChannel() const
+{
+ d_ptr->ensureContentsAdapter();
+ QQmlWebChannel *qmlWebChannel = qobject_cast<QQmlWebChannel *>(d_ptr->adapter->webChannel());
+ Q_ASSERT(!d_ptr->adapter->webChannel() || qmlWebChannel);
+ if (!qmlWebChannel) {
+ qmlWebChannel = new QQmlWebChannel;
+ d_ptr->adapter->setWebChannel(qmlWebChannel);
+ }
+ return qmlWebChannel;
+}
+
+void QQuickWebEngineViewExperimental::setWebChannel(QQmlWebChannel *webChannel)
+{
+ d_ptr->adapter->setWebChannel(webChannel);
+}
+
void QQuickWebEngineViewExperimental::grantFeaturePermission(const QUrl &securityOrigin, QQuickWebEngineViewExperimental::Feature feature, bool granted)
{
if (!d_ptr->adapter)