O'Reilly logo

Qt 5 Projects by Marco Piccolino

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding WebEngineView to cmmonitor

We will create a WebEngineView QML component in cmmonitor, with the goal of having an HTML5 graph underneath the QML graph. In this way, we will be able to see that they are consuming the very same sensor data that is coming over the HTTP channel, despite the two very different UI technologies.

To add QtWebEngine to cmmonitor, after having installed the module for your intended target platform, you'll need to add it to cmmonitor.pro:

# cmmonitor.proQT += quick charts webengine...

Then, in main.cpp, you will have to initialize webengine before being able to use it in the QML engine. This is achieved by calling the QtWebEngine::initialize() static method:

// cmmonitor/main.cpp#include <QApplication>#include ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required