This chapter covers the
QThread class which provides fine control over threading, and support for Qt’s signals and slots mechanism. Like the previous chapter it assumes prior knowledge of threading in general and the basics of Qt threading in particular. The chapter also assumes that you have at least read the beginning of the previous chapter.
If we have a small number of items (or a small number of groups of items) to process in the background, and we want to keep track of progress and completion, then often the best solution is to create a
QThread subclass. Qt’s
QThread class (and also
QRunnable) was modeled on Java’s Thread class and so has a similar overall ...