Rajagopalan Srinivasan wrote:
> Curious about the compatibility between Ada (gnat) tasks and qt windows.

GNAT maps Ada's tasks to OS threads, so you can mean 'task' when read
'thread' in Qt's documentation.

> for example, can we have a task sending messages to a qt widget? TIA for 
> points.

Yes, it is possible using QCoreApplication::postEvent, but this
operation is not supported by QtAda for now.

Another way to communicate between threads (which is used by many QtAda
users) is use of queued signal/slot connection. Each QObject is
associated with one thread (task) in which it is created. All GUI
widgets MUST be created in the same task, this task also must call
Qt_Ada.Application.Initialize and Qt_Ada.Application.Execute. But you
can create non-GUI QObjects in another threads. When you create
connection between signal of one object and slot of another object Qt
automatically uses queued mode if connected objects belongs to different
threads. In this mode, when object emit signal, the slot is not executed
directly, instead all arguments "packed" into the internal event and
this event is send to the thread of receiver object. Event loop in the
receiver's thread "unpack" parameters from the event and actually
executes slot.


_______________________________________________
qtada-users mailing list
[email protected]
http://lists.qtada.com/mailman/listinfo/qtada-users_lists.qtada.com

Reply via email to