Now, we have seen an array of different Qt classes supporting threading in addition to the C++ standard library ones. That's a lot, so how can we decide which class to use in our application? Let's have a look:
- QThread
We can use QThread with a reimplemented run() method to perform one-shot computation and emit signals to update progress from it. We can also use a QThread with a worker object, which can perform different tasks upon request. We will send commands and receive updates over queued signal-slot connections in this case. A third possibility is a thread which will periodically perform an expensive operation and doesn't need to receive any signals or events. We will use QThread with a reimplemented ...