Results 1 to 20 of 52

Thread: Qt multithreading and let the second thread update the main (UI) thread

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    Join Date
    May 2014
    Posts
    136
    Thanks
    72
    Qt products
    Qt3 Qt4 PyQt3 PyQt4
    Platforms
    MacOS X Windows

    Default Re: Qt multithreading and let the second thread update the main (UI) thread

    Okay, I got that part. Here two thread communicate via signals and slots. But in this case, the slot must receive an object of type QueryResult. Qt greatly limits how signals and slots can use parameters, and the one way I can see, is to use a Signal Mapper. But even with Signal Mapper, I don't know how to properly use it to say, emit a signal from one object with a QString as param, and capture and use the sent QString in a slot in another object. I browsed net heavily, I could not find a complete working example of it. Secondly, even Signal Mapper allows only certain basic types of params to be exchanged, like QString. Here the object which is required to update the view is of a custom class, QueryResult. How will the Action class and the View class communicate?

    Quote Originally Posted by jefftee View Post
    The example I referred you to had example code, no?

    Again, this was a pretty basic example. Which class here should inherit from QThread? I couldn't see any threading in your example at all..
    Last edited by Cupidvogel; 18th April 2015 at 11:41.

Similar Threads

  1. Replies: 1
    Last Post: 28th March 2012, 18:58
  2. Replies: 5
    Last Post: 22nd February 2011, 21:21
  3. Replies: 9
    Last Post: 28th November 2009, 20:31
  4. Replies: 16
    Last Post: 7th October 2009, 08:17
  5. Replies: 6
    Last Post: 29th April 2009, 18:17

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.