[Development] Qt WebChannel 5.5 roadmap: WebEngine, QtWebView

Milian Wolff milian.wolff at kdab.com
Wed Aug 27 16:49:10 CEST 2014


On Wednesday 27 August 2014 16:45:29 Jocelyn Turcotte wrote:
> On Wed, Aug 27, 2014 at 04:27:35PM +0200, Milian Wolff wrote:
> > Hey all,
> > 
> > for Qt 5.4, the new WebChannel module will only be "easily" usable for
> > WebKit users. For 5.5 I plan to add WebEngine integration, if Pierre is
> > not beating me to it. We will simply copy the QML API, and no changes on
> > the client-side HTML should be required, I think.
> > 
> > Then, recently, QtWebView was announced for Android and iOS WebViews. I
> > wonder if we can integrate the WebChannel nicely there as well.
> > Instantiating a WebChannel internally won't be the problem, nor copying
> > the QML API. But for HTML clients, I don't know if one can automatically
> > setup the transport mechanism (based on WebSockets), nor whether one can
> > even load the qwebchannel.js API via a qrc URL. Can someone working on
> > QtWebView shed some light here please?
> 
> One thing that WebSockets do is that they are a transport layer on top of
> HTTP. You can transport your qwebchannel.js or any html hook through a
> non-upgraded WebSocket's HTTP response.
> 
> QtWebSocket doesn't support this at the moment and simply ignores any HTTP
> request not asking for an upgrade, but I had a simple change that was
> manually writing the HTTP response on the QTcpSocket and it worked pretty
> well.

That is indeed an awesome idea - I really like that. Then, we'd only need to 
provide one information to the clients (i.e. where to access the socket) and 
that can be used to download the .js which could then even setup the 
WebChannel WebSocket code as well.

> The main issue is that you normally have websocket as part of an HTTP
> server and not the other way around, so we'd have to stretch the API a
> bit. I was able to hack it quickly by reusing QNetworkRequest and
> QNetworkReply but we should probably duplicate their interface into some
> kind of QWebSocketHttpRequest/Reply if we don't want to poison
> QNetworkAccessManager's API with foreign use cases.

Yes, certainly something to look at for educational purposes I think.

Thanks for the ideas!

-- 
Qt Developer Days 2014 - October 6 - 8 at BCC, Berlin

Milian Wolff | milian.wolff at kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel. Germany +49-30-521325470, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions




More information about the Development mailing list