June 2019
Intermediate to advanced
348 pages
8h 28m
English
Finally, we have the OpenCV library installed and configured. Now, let's try to use it to blur the image in the slot that's connected to our blur action.
First, we will add the following lines to the beginning of the mainwindow.cpp file so that we can include the OpenCV header file:
#include "opencv2/opencv.hpp"
The preparation is now done, so let's focus on the implementation of the slot method. Like any slot that intends to operate on a single open image, before doing anything, we need to check whether there is an image open at the current time:
if (currentImage == nullptr) { QMessageBox::information(this, "Information", "No image to edit."); return; }
As you can see, we prompt a message box and return immediately from ...
Read now
Unlock full access