Results 1 to 11 of 11

Thread: Widgets must be created in the GUI thread.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2010
    Posts
    102
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Widgets must be created in the GUI thread.

    it still error


    when i play QmessageBOx in Qthread then it still also error

    help me resolve
    Contact: Skype: sonnh89
    Yahoo: nhs_0702@yahoo.com

    Liên hệ SKype: sonnh89

  2. #2
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    131
    Thanks
    11
    Thanked 16 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Widgets must be created in the GUI thread.

    Yes of course. Please read http://doc.qt.nokia.com/4.7-snapshot/thread-basics.html

    As mentioned, each program has one thread when it is started. This thread is called the "main thread" (also known as the "GUI thread" in Qt applications). The Qt GUI must run in this thread. All widgets and several related classes, for example QPixmap, work in secondary threads.
    To be clear: Its (by the design of Qt) not possible to work with widgets in threads. The work only in the main thread! Inform the main thread from your worker thread to show the message box.

Similar Threads

  1. delete runtime-created widgets causes crash
    By jonasbalmer in forum Qt Programming
    Replies: 5
    Last Post: 10th February 2010, 21:36
  2. How to access Widgets created in Tab View
    By kapoorsudhish in forum Newbie
    Replies: 5
    Last Post: 23rd October 2009, 13:12
  3. Reading widgets from thread
    By sirlore in forum Qt Programming
    Replies: 3
    Last Post: 24th June 2009, 21:58
  4. Accesing widgets from separate thread
    By msmihai in forum Qt Programming
    Replies: 2
    Last Post: 8th December 2008, 11:48
  5. Replies: 6
    Last Post: 3rd September 2008, 14:27

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.