Integrating C++ and QML codes

Even though the QML libraries have grown into a fully-fledged collection of types that can handle visuals, networking, cameras, and so on, it's still important to be able 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 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 ...

Get Computer Vision with OpenCV 3 and Qt5 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.