Displaying the fractal with MandelbrotWidget

Here we are, the Mandelbrot algorithm is done and the multi-threading system is ready to compute complex fractals over all your CPU cores. We can now create the widget that will convert all JobResult to display a pretty picture. Create a new C++ class called MandelbrotWidget. For this widget, we will handle the painting ourselves.

Thus, we do not need any .uiQt Designer Form file. Let's begin with the MandelbrotWidget.h file:

#include <memory> #include <QWidget> #include <QPoint> #include <QThread> #include <QList> #include "MandelbrotCalculator.h" class QResizeEvent; class MandelbrotWidget : public QWidget { Q_OBJECT public: explicit MandelbrotWidget(QWidget *parent = 0); ~MandelbrotWidget(); ...

Get End to End GUI Development with Qt5 now with O’Reilly online learning.

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