Results 1 to 3 of 3

Thread: updating label from worker thread

  1. #1
    Join Date
    Oct 2013
    Location
    Bangalore,India
    Posts
    64
    Thanks
    21
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default updating label from worker thread

    I am having a multithreaded application.In one of the thread,I am doing some processing and after the processing I want to display a image.
    I want to update the image after the processing.
    I want to do something like this

    Qt Code:
    1. ui->label->setPixmap(QPixmap("abc.bmp"));
    To copy to clipboard, switch view to plain text mode 

    But I am unable to access ui->label from the worker thread.
    Pl tell how to do this??

  2. #2
    Join Date
    Oct 2013
    Location
    Bangalore,India
    Posts
    64
    Thanks
    21
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: updating label from worker thread

    I have done the work using signal and slot mechanism,Its the only possible way to do it.

  3. #3
    Join Date
    Dec 2012
    Posts
    197
    Thanks
    25
    Thanked 41 Times in 33 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: updating label from worker thread

    True, Signals and Slots is a good approach in your case.

    Good Luck.

Similar Threads

  1. Replies: 4
    Last Post: 17th October 2013, 11:12
  2. Replies: 3
    Last Post: 20th September 2011, 20:13
  3. Worker thread
    By doggrant in forum Newbie
    Replies: 4
    Last Post: 3rd November 2009, 15:49
  4. Worker thread problem
    By hkvm in forum Qt Programming
    Replies: 4
    Last Post: 6th September 2009, 20:12
  5. Main thread - worker thread communication.
    By kikapu in forum Newbie
    Replies: 25
    Last Post: 23rd May 2007, 22:09

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.