[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Inter-thread signals/slots?
From:       Thiago Macieira <thiago () kde ! org>
Date:       2006-05-02 15:39:04
Message-ID: 200605021739.11494.thiago () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Vladimir Prus wrote:
>Hello!
>
>The Qt4 docs say that signal/slot invocation can now cross thread
>boundaries. I wonder if anything like that is available for Qt3 or
> KDE3.*?

No. You have to hand-tailor it yourself.

In Qt3, signals are delivered to the slots in the thread the signal is 
emitted. But QObjects are not supported outside the GUI thread, so your 
problem is solved: signals and slots can only be used in the GUI thread.

Events, however, are thread-safe. You can use QApplication::postEvent (you 
must, of course, make sure that the QObject that you're targetting won't 
be deleted during the call to postEvent).

This is, incidentally, how the queued connections work in Qt4: by posting 
an event.

>That feature will allow me to greatly simplify KDevelop's debugger part,
>since I'll be able to do blocking wait for gdb reply in a separate
> thread, instead of using callbacks all over.

Post events or write Qt4 code.

-- 
Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
  thiago.macieira (AT) trolltech.com     Trolltech AS
    GPG: 0x6EF45358                   |  Sandakerveien 116,
    E067 918B B660 DBD1 105C          |  NO-0402
    966C 33F5 F005 6EF4 5358          |  Oslo, Norway

[Attachment #5 (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic