Results 1 to 2 of 2

Thread: QT emit/signaling thread-safe?

  1. #1
    Join Date
    Oct 2005
    Qt products

    Default QT emit/signaling thread-safe?

    I was reading that QT4's emission system is thread-safe...

    However, the literature on QT3 is never really explicit on signaling/emitting's thread-safeness -- does it fall under under the whole any QObject child is not thread-safe bullet?

    Last edited by richy; 14th July 2006 at 00:08. Reason: not well formed question

  2. #2
    Join Date
    Jan 2006
    Warsaw, Poland
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Unix/X11 Windows

    Default Re: QT emit/signaling thread-safe?

    Quote Originally Posted by richy
    does it fall under under the whole any QObject child is not thread-safe bullet?
    Yes, slots are invoked just like ordinary methods (with all consequences of this fact). The biggest problem is that many Qt3 classes aren't reentrant.

    Qt docs say:
    Threads and Signals and Slots
    The Signals and Slots mechanism can be used in separate threads, as long as the rules for QObject based classes are followed. The Signals and Slots mechanism is synchronous: when a signal is emitted, all slots are called immediately. The slots are executed in the thread context that emitted the signal.
    Warning: Slots that generate window system events or use window system functions must not be connected to a signal that is emitted from a thread that is not the GUI thread. See the Qt Library Mutex section above for more details.

Similar Threads

  1. Replies: 11
    Last Post: 7th July 2006, 14:09
  2. [QT4] QThread and printing a QList<QPixmap>
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 22:44
  3. Problem building Qt4.1.0 with thread support on windows XP
    By pavithra in forum Installation and Deployment
    Replies: 1
    Last Post: 1st April 2006, 12:35
  4. Are QHttp n QHttpRequestHeader thread safe?
    By Shambhavi in forum Qt Programming
    Replies: 4
    Last Post: 21st January 2006, 09:33
  5. Replies: 2
    Last Post: 6th January 2006, 22:15


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.