Multithreading with QThread
Waiting is sometimes unavoidable. Whether querying the network, accessing a filesystem, or running a complex computation, sometimes a program just needs time to complete a process. While we're waiting, though, there's no reason for our GUI to become completely unresponsive. Modern systems with multiple CPU cores and threading technology allow us to run concurrent processes, and there's no reason why we can't take advantage of this to make responsive GUIs. Although Python has its own threading library, Qt offers us the QThread object, which can be used to build multithreaded applications easily. It has the additional advantage of being integrated into Qt and being compatible with signals and slots.
In this section, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access