Results 1 to 2 of 2

Thread: how to pass data ie (from main thread which have dialog ) to another thread

  1. #1
    Join Date
    Mar 2011
    Location
    delhi
    Posts
    45
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Exclamation how to pass data ie (from main thread which have dialog ) to another thread

    hi
    all please tell how to pass data which is main thread(a GUI thread) to another thread which process that data
    return the result to main thread. suppose i have a dialog which have to field that data is transfer to another thread which process that return result to dialog which is in main thread.

    please guide me with some lines of code.



    thanks with regards:
    gauravg

  2. #2
    Join Date
    Sep 2011
    Posts
    1,245
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to pass data ie (from main thread which have dialog ) to another thread

    Do you want to pass this data as a reference? ie do you want the dialog and the other thread to both be able to change the same data?

    If not, just make a copy and pass the copy to the thread. Then you have no headaches about mutexes etc.

    Otherwise, use pointers and mutexes.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Replies: 5
    Last Post: 22nd February 2011, 22:21
  2. Replies: 9
    Last Post: 28th November 2009, 21:31
  3. Replies: 16
    Last Post: 7th October 2009, 09:17
  4. Replies: 6
    Last Post: 29th April 2009, 19:17
  5. Replies: 1
    Last Post: 14th June 2006, 09:12

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.