Results 1 to 2 of 2

Thread: signal-slot connection requires thread must be QThread?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2008
    Posts
    4
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question signal-slot connection requires thread must be QThread?

    Based on Qt document, "Qt provides thread support in the form of platform-independent threading classes, a thread-safe way of posting events, and signal-slot connections across threads.", I am wondering to make Qt signal-slot connection across threads work, do i have to make sure all the threads are created with QThread or Qt GUI thread?

    For example, i have a Qt GUI thread, and i have a library running in another thread (Win32 thread). and in my GUI program, i override some virtual functions provided by the library which act as the callback function (based on publish/subscribe pattern). so the codes in the overridden virtual functions are actually executed in the Win32 thread. can i emit signal in the overridden function and let the slot in Qt GUI thread to connect with it to make the Async calling work?

    Thanks
    Last edited by Bing; 10th September 2008 at 20:40.

Similar Threads

  1. Replies: 8
    Last Post: 27th March 2013, 11:51
  2. QThread and QSlot
    By Xaar in forum Qt Programming
    Replies: 5
    Last Post: 6th December 2007, 21:37
  3. signal and slot across threads having event loop
    By travis in forum Qt Programming
    Replies: 6
    Last Post: 5th November 2007, 23:56
  4. Replies: 3
    Last Post: 15th April 2007, 19:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.