Skip to content

QtWebChannel – Bridging the Gap between HTML and Qt

Abstract: The new QtWebChannel module is a ready-to-use solution to make any QObject accessible to arbitrary JavaScript clients. KDAB already uses it in production for a client project on embedded devices, where it proofed to be an essential part for the HTML app framework embedded in a QML chrome.

Thanks to QObject introspection, any object can be mocked on the fly for the JavaScript side. Thus any properties, signals and public slots are seamlessly accessible. An asynchronous message passing interface based on either WebSockets or the internal QtWebKit or QtWebEngine IPC mechanism allows to connect the C++/QML server side with the JavaScript/HTML client side. With WebSockets, one can even cross the machine boundary and publish QObjects to remote JavaScript clients. Furthermore, it also allows you to access these objects from node.js applications or from within a non-Qt browser, such as Firefox, Chrome or Internet Explorer.

This presentation will show you how simple it is to setup the QtWebChannel. We will share some tips and tricks learned from using it in production. At the end some more creative use-cases will be shown, such as accessing C++ QObjects from within node.js.

View slides

Categories: Presentation videos / Qt

Tags:
Leave a Reply

Your email address will not be published. Required fields are marked *