<p>Am 20.01.2014 14:47 schrieb "Michael Schnell" <<a href="mailto:mschnell@lumino.de">mschnell@lumino.de</a>>:<br>
><br>
> On 01/20/2014 11:01 AM, Michael Van Canneyt wrote:<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> <a href="http://qt-project.org/doc/qt-4.8/threads-starting.html">http://qt-project.org/doc/qt-4.8/threads-starting.html</a><br>
>><br>
>> "Note that QCoreApplication::exec() must always be called from the main thread<br>
>>  (the thread that executes main()), not from a QThread. In GUI applications,<br>
>>  the main thread is also called the GUI thread because it's the only thread<br>
>>   that is allowed to perform GUI-related operations."<br>
>><br>
><br>
> I didn't think that in Linux with NPTL there not even is a thing like a "main thread" of a program, but (before binding to a GUI provider) all threads of a project are equivalent. As a consequence, multiple  of them should be able to be bound to a GUI provider instance - as long as same does not impose global variable.</p>

<p>For Qt the main thread is the thread that first called QCoreApplication::exec() (or that first constructed a QCoreApplication instance? I'd need to check that again...). This is ensured using the thread's ID.</p>

<p>Regards,<br>
Sven</p>