Results 1 to 9 of 9

Thread: QThread and signals

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default QThread and signals

    Hey there,

    I'm using two threads : one for my GUI, one for my network library.
    Here is my network library run function:

    Qt Code:
    1. /* virtual */ void ZePurpleApi::run()
    2. {
    3. (...)
    4.  
    5. GMainLoop *loop = g_main_loop_new(NULL, FALSE);
    6. g_main_loop_run(loop);
    7.  
    8. // Qt never gets there
    9.  
    10. exec();
    11. }
    To copy to clipboard, switch view to plain text mode 

    - The library I'm using requires : g_main_loop_run(loop);
    - Between my two threads I'm communicating using signals.
    - I need to call exec() to receive signal from my GUI main thread.

    Is it possible to exec the thread and then start the g_main_loop_run(loop); ?

    Thanks.
    Last edited by bunjee; 27th March 2008 at 01:08.

Similar Threads

  1. QThread and QSlot
    By Xaar in forum Qt Programming
    Replies: 5
    Last Post: 6th December 2007, 21:37
  2. QThread and signals (linux/UNIX signals not Qt Signals)
    By Micawber in forum Qt Programming
    Replies: 1
    Last Post: 28th November 2007, 22:18
  3. Need some help about QProgressbar while using QThread
    By qzb1111 in forum Qt Programming
    Replies: 5
    Last Post: 31st July 2007, 14:52
  4. QThread exec proplem to stop...
    By patrik08 in forum Qt Programming
    Replies: 29
    Last Post: 21st May 2007, 07:51
  5. how to use QHttp inside QThread in Qt3
    By alusuel in forum Qt Programming
    Replies: 3
    Last Post: 14th July 2006, 11:19

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.