Integrating JavaScript and C++

One powerful feature of using Qt's web engine module is that it can call JavaScript functions from C++, as well as calling C++ functions from JavaScript. This makes it more than just a web browser. You can use this to access features that are not supported by the web browser standard, such as file management and hardware integration. Things like that are not possible with W3C standards; hence, it is not possible to do it in native JavaScript. However, you can implement these features using C++ and Qt, then simply call the C++ functions from your JavaScript. Let's take a look at how we can achieve this with Qt.

Get Hands-On GUI Programming with C++ and Qt5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.