Results 1 to 2 of 2

Thread: How to use GUI in a user-interface thread by adding a message queue in the thread?

  1. #1
    Join Date
    Nov 2011
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to use GUI in a user-interface thread by adding a message queue in the thread?

    I know that Qt maintains its gui messages in the main-thread called gui-thread. However if I post too many messages to the main gui thread, the main thread won't respond to the messages quickly and react to the user input. In windows, OS provides a solution that to create a user-interface thread with a standalone message queue itself. So I can post my message to this thread while the main thread will not die.
    So my question is how to create a gui thread but not the main thread in Qt?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to use GUI in a user-interface thread by adding a message queue in the thread

    What exactly do you think is going to happen if you post 1000 messages to thread A instead of thread B? How is it going to be different from what you already have? If you want to post some custom events that are unrelated to the user interface then post them to a worker thread instead of the UI thread.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Thread Safe Queue container....
    By jcox23 in forum Newbie
    Replies: 25
    Last Post: 5th June 2012, 19:36
  2. Replies: 1
    Last Post: 28th March 2012, 18:58
  3. Replies: 5
    Last Post: 22nd February 2011, 21:21
  4. Replies: 9
    Last Post: 28th November 2009, 20:31
  5. Adding new Widgets in a seperate thread
    By Cruz in forum Qt Programming
    Replies: 7
    Last Post: 16th January 2009, 18:20

Tags for this Thread

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.