[Interest] post event between threads

Riccardo Roasio riccardo.roasio at gmail.com
Tue Apr 3 09:07:37 CEST 2012


I cannot use signal/slot because is blocking and i need to continue
reading from serial port while message is processing...

Il 02 aprile 2012 18:47, Thiago Macieira <thiago.macieira at intel.com> ha scritto:
> On segunda-feira, 2 de abril de 2012 18.05.17, Riccardo Roasio wrote:
>> Hi,
>>
>> how can i post an event from a thread to another?
>>
>> my application have a thread that read from a serial port and another
>> thread that wait for something received on the serial port.
>>
>> I cannot use postEvent because in one thread i don'e have reference to
>> the other...
>>
>> How can i do that?
>
> You don't post events to threads. You post events to objects only.
>
> The events are delivered in each object's associated thread.
>
> So, use:
>
>        QCoreApplication::postEvent(myObject, new MyEvent);
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>  Software Architect - Intel Open Source Technology Center
>     Intel Sweden AB - Registration Number: 556189-6027
>     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>



More information about the Interest mailing list