Results 1 to 9 of 9

Thread: Starting QT GUI in a seperate Thread

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    Oct 2008
    Posts
    17
    Thanked 1 Time in 1 Post

    Default Re: Starting QT GUI in a seperate Thread

    Got it!

    The CP 1 will never be reached because when calling pthread_create for the 1st time, you're not passing initUI to the function that will create the thread, you're CALLING it!!!

    The right code would be like this:
    Qt Code:
    1. pthread_create(&guithread, NULL, initUI, argv);
    To copy to clipboard, switch view to plain text mode 

    Passing initUI(argv) to pthread_create does not pass the pointer to the function initUI, but its resultant void* by effectively calling initUI(argv).

    Best regards

  2. The following user says thank you to tinsuke for this useful post:

    bbui210 (17th October 2008)

Similar Threads

  1. GUI and non-GUI thread problem
    By dimaz in forum Qt Programming
    Replies: 3
    Last Post: 18th September 2008, 22:25
  2. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 07:13
  3. Replies: 10
    Last Post: 20th March 2007, 23:19
  4. Problem closing a QMainWindow in Qt4.2
    By ian in forum Qt Programming
    Replies: 11
    Last Post: 17th October 2006, 01:49
  5. [QT4] QThread and printing a QList<QPixmap>
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 22:44

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.