summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2018-08-01 15:04:35 +0200
committerMichal Klocek <michal.klocek@qt.io>2018-08-09 09:39:56 +0000
commitdb62139e1daea171e08d95592c63f663789d6391 (patch)
treeddce513a2e74bf656466a6f83b57a8efbd3cbe18 /src/webenginewidgets
parente50fb187dc4467ac28a724e6ea9f2d51a1f131ba (diff)
Make WebChannel an optional feature
Add webengine-webchannel feature. Change-Id: I600572180f8169aafe79cf0408527cc087d9a007 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'src/webenginewidgets')
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index 5b42b871a..6a4554b57 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -282,8 +282,10 @@ void QWebEnginePagePrivate::initializationFinished()
{
if (m_backgroundColor != Qt::white)
adapter->backgroundColorChanged();
+#if QT_CONFIG(webengine_webchannel)
if (webChannel)
adapter->setWebChannel(webChannel, webChannelWorldId);
+#endif
if (defaultAudioMuted != adapter->isAudioMuted())
adapter->setAudioMuted(defaultAudioMuted);
if (!qFuzzyCompare(adapter->currentZoomFactor(), defaultZoomFactor))
@@ -925,8 +927,12 @@ QWebEngineSettings *QWebEnginePage::settings() const
*/
QWebChannel *QWebEnginePage::webChannel() const
{
+#if QT_CONFIG(webengine_webchannel)
Q_D(const QWebEnginePage);
return d->webChannel;
+#endif
+ qWarning("WebEngine compiled without webchannel support");
+ return nullptr;
}
/*!
@@ -963,12 +969,18 @@ void QWebEnginePage::setWebChannel(QWebChannel *channel)
*/
void QWebEnginePage::setWebChannel(QWebChannel *channel, uint worldId)
{
+#if QT_CONFIG(webengine_webchannel)
Q_D(QWebEnginePage);
if (d->webChannel != channel || d->webChannelWorldId != worldId) {
d->webChannel = channel;
d->webChannelWorldId = worldId;
d->adapter->setWebChannel(channel, worldId);
}
+#else
+ Q_UNUSED(channel)
+ Q_UNUSED(worldId)
+ qWarning("WebEngine compiled without webchannel support");
+#endif
}
/*!