Interacting with sockets in the worker

Now that the SDK is completed, we can turn to the worker. The project is complex enough; we can refresh our memory with the mandelbrot-worker architecture:

We will start by implementing the Job class. Inside the mandelbrot-worker project, create a new C++ class named Job. Here is the Job.h content:

#include <QObject> #include <QRunnable> #include <QAtomicInteger> #include "JobRequest.h" #include "JobResult.h" class Job : public QObject, public QRunnable { Q_OBJECT public: explicit Job(const JobRequest& jobRequest, QObject *parent = 0); void run() override; signals: void jobCompleted(JobResult jobResult); ...

Get Mastering Qt 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.