For example, basically thread'e doing

connect(this,SIGNAL(runIt(int)),obj,SLOT(run(int)));//посл. арг. ауто _future = QtConcurrent::run(this,&Server::serverThreadAlt);//асинхронно 

Now serverThreadAlt is called in a separate one. And there already calling

 void Server::serverThreadAlt() { emit runIt(0); } 

Will the slot be called and in which thread? Basically or in the same, in which serverThreadAlt?

    1 answer 1

    Event processing is performed from the context of the object belonging to the stream, that is, its events will be processed in the stream to which the object belongs.

    from Max Schlee's book "Qt 4.5 Programming"

    • that is, you can not? And is there about this in the official qt documentation? - asianirish
    • one
      Well, you can do it, but the slot will be called in the main thread. It turns out that you imitated the signal transferred to another stream, but it does not change anything. Yes, it is of. doc Threads and QObjects. ... A QObject has been created. Events to that object are dispatched by that thread's event loop. QObject life is available using QObject :: thread (). - nicolai