Integrating C++ and QML codes
Even though the QML libraries have into a fully-fledged collection of types that can handle visuals, networking, cameras, and so on, it's still important to be to extend them by using the power of C++ classes. Fortunately, QML and the Qt Framework provides enough provisions to be able to easily handle this. In this section, we are going to learn how to create a non-visual C++ class that can be used within QML codes to process images using OpenCV. Then, we'll create a C++ class that can be used as a visual item within QML codes to display images.
Note
Note that there is an Image type by default in QML that can be used to display images saved on disk by providing their URL to the Image item. However, we'll be creating an image viewer QML type that can be used to display QImage objects, and use this opportunity to learn about the integration of C++ classes (visual) in QML codes.
Start by adding the OpenCV framework to our project that we created in the previous...