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:

Interacting with sockets in the worker

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); public ...

Get Mastering Qt 5 now with O’Reilly online learning.

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