diff options
| author | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2019-01-29 14:40:51 +0100 |
|---|---|---|
| committer | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2019-01-30 08:49:15 +0000 |
| commit | 6ca1681204f28f0ecfcbacc64d457593822e1520 (patch) | |
| tree | 3321343409c2da0611c78f843dde8fd6ab070611 /src/plugins/platforms/webgl/qwebglintegration.cpp | |
| parent | 845d4804905c82d76d0fed8f7d0e9ee333c32116 (diff) | |
Add platform plugin parameter for websockerserver
When using the webgl backend in a container, one needs to specify the
port of the websocket server in addition to the http server.
While using QT_WEBGL_WEBSOCKETSERVER is an option, it requires to pass a
hostname in addition.
Change-Id: Iefce12f049a81711a52586d60dd34bddbb9de12e
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/plugins/platforms/webgl/qwebglintegration.cpp')
| -rw-r--r-- | src/plugins/platforms/webgl/qwebglintegration.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/platforms/webgl/qwebglintegration.cpp b/src/plugins/platforms/webgl/qwebglintegration.cpp index 1b4214a..08a432c 100644 --- a/src/plugins/platforms/webgl/qwebglintegration.cpp +++ b/src/plugins/platforms/webgl/qwebglintegration.cpp @@ -70,12 +70,13 @@ QWebGLIntegrationPrivate *QWebGLIntegrationPrivate::instance() return static_cast<QWebGLIntegration *>(platformIntegration)->d_ptr.data(); } -QWebGLIntegration::QWebGLIntegration(quint16 port) : +QWebGLIntegration::QWebGLIntegration(quint16 port, quint16 wssport) : d_ptr(new QWebGLIntegrationPrivate) { Q_D(QWebGLIntegration); d->q_ptr = this; d->httpPort = port; + d->wssPort = wssport; d->touchDevice = new QTouchDevice; d->touchDevice->setName("EmulatedTouchDevice"); d->touchDevice->setType(QTouchDevice::TouchScreen); @@ -112,7 +113,7 @@ void QWebGLIntegration::initialize() d->screen = new QWebGLScreen; screenAdded(d->screen, true); - d->webSocketServer = new QWebGLWebSocketServer; + d->webSocketServer = new QWebGLWebSocketServer(d->wssPort); d->httpServer = new QWebGLHttpServer(d->webSocketServer, this); bool ok = d->httpServer->listen(QHostAddress::Any, d->httpPort); if (!ok) { |
