In the official Qt Documentation:
As mentioned, each program has one thread when it is started. This thread is called the "main thread" (also known as the "GUI thread" in Qt applications). The Qt GUI must run in this thread. All widgets and several related classes, for example QPixmap, don't work in secondary thread
Now, in a qt project i've tried the following code:
QThread* thread = new QThread;
DetectList *list = new DetectList;
list->moveToThread(thread);
connect(thread, SIGNAL(started()), list, SLOT(process()));
thread->start();
Where DetectList is a class derived by QWidget. Why the code compile and run? DetectList doesn't must be run only in the main thread?