[Interest] post event between threads

Thiago Macieira thiago.macieira at intel.com
Mon Apr 2 18:47:20 CEST 2012


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120402/d1c3b56d/attachment.sig>


More information about the Interest mailing list