Skip to content

QtWebChannel – Bridging the Gap between HTML and Qt Milian Wolff

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 *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

By continuing to use the site, you agree to the use of cookies. More information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close