Results 1 to 2 of 2

Thread: event loop isStarted() signal?

  1. #1
    Join Date
    Jun 2007
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default event loop isStarted() signal?

    Hello all,

    I've got the following situation:
    I have created a thread which will take care off all the database interaction. When i initialize the main class, i want to use this thread to get some date from the DB. The problem is that i can't communicate with the thread since the main thread event loop isn't running yet.

    Is there a way to communicat without the signal-slot?

    I also had another sollution:
    If there is a way to continue the initialisation after app.exec() is called, i can use the signal-slot mechanism. But, is there a way to detect that? QThread has got the isStarted() signal, but i can't find anything similar for the qapp.

    Kind regards

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: event loop isStarted() signal?

    Quote Originally Posted by Xerion View Post
    If there is a way to continue the initialisation after app.exec() is called,
    You can use QTimer::singleShot( 0, object, SLOT( someSlot() ) ). someSlot will be invoked as soon as the main event loop starts.

  3. The following user says thank you to jacek for this useful post:

    Xerion (18th February 2008)

Similar Threads

  1. signal and slot across threads having event loop
    By travis in forum Qt Programming
    Replies: 6
    Last Post: 6th November 2007, 00:56
  2. Main Thread Event loop
    By ^NyAw^ in forum Qt Programming
    Replies: 1
    Last Post: 20th March 2007, 13:10
  3. Glib event loop
    By Brandybuck in forum Qt Programming
    Replies: 2
    Last Post: 28th September 2006, 18:19
  4. Workload in a QThread blocks main application's event loop ?
    By 0xBulbizarre in forum Qt Programming
    Replies: 14
    Last Post: 9th April 2006, 22:55
  5. Replies: 4
    Last Post: 23rd January 2006, 17:51

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.