Qt's default threads

Viewed 1192

When I start a new Qt application with a minimal amount of code and run it, I see that there are a number of threads running, which at a minimum is 2 and can be as many as 5. It usually settles at 2, until I drag the window around, at which time I see up to 4 threads running.

This is all the code I'm using: -

#include <QApplication>
#include <QWidget>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QWidget mainWindow;
    mainWindow.show();

    return a.exec();
}

Can someone explain why there are different threads and what they're likely to be for? Originally I expected just one, but wouldn't be surprised if a second was used for handling messages. However, what could account for the other threads?

1 Answers
Related