Results 1 to 2 of 2

Thread: Regarding communication b/w other thread and guithread to update the GUI

  1. #1
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    46
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Regarding communication b/w other thread and guithread to update the GUI

    Hi All

    I have problem to update the gui. I have made signal slot connection from one thread and my GUI thread. But its behaviour is not stable.
    Some times gui hangs.

    Can any one having any idea about how to fix the problem.

    Currently I am working with qt 3.3.

    Thanks
    Ashish
    Ashish Kumar Saryar

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Regarding communication b/w other thread and guithread to update the GUI

    Wow, Qt 3.3!

    In Qt3 all signal/slot connections are direct method invocations, so a slot in a GUI object must not be connected to signal in a worker thread (otherwise the worker thread will access GUI resources and that is not allowed).

    What you do instead is create a custom QEvent subclass and use QApplication:ostEvent to send that event to the GUI object. The event is delivered in the context of the main thread and can therefore access GUI resources.

    Cheers,
    _

Similar Threads

  1. Communication between QRunnable and main thread
    By Windsoarer in forum Qt Programming
    Replies: 4
    Last Post: 28th December 2010, 08:52
  2. Signal not found / thread communication
    By ruehlchr in forum Qt Programming
    Replies: 4
    Last Post: 2nd November 2010, 05:23
  3. Replies: 4
    Last Post: 7th March 2010, 16:58
  4. Thread Communication not doing so well
    By BatteryCell in forum Qt Programming
    Replies: 7
    Last Post: 19th June 2007, 01:08
  5. Main thread - worker thread communication.
    By kikapu in forum Newbie
    Replies: 25
    Last Post: 23rd May 2007, 22:09

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.