Results 1 to 3 of 3

Thread: To set "ui->label->setPixmap()" from another Thread then main Thread

  1. #1
    Join Date
    Apr 2011
    Posts
    39
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default To set "ui->label->setPixmap()" from another Thread then main Thread

    Hello,

    Can anybody tell me,

    is it possible to access "ui->label" object from another thread then Main thread.?

  2. #2
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: To set "ui->label->setPixmap()" from another Thread then main Thread

    You shouldn't access GUI elements from non GUI threads.
    Instead use signals/slots mechanism to share data between threads.
    A camel can go 14 days without drink,
    I can't!!!

  3. The following user says thank you to mcosta for this useful post:

    syclopse (5th July 2011)

  4. #3
    Join Date
    Apr 2011
    Posts
    39
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: To set "ui->label->setPixmap()" from another Thread then main Thread

    ya that's true,
    you can not access the UI members from outside the main GUI thread,
    so try to use signal slot mechanism for that ....

Similar Threads

  1. "Thread has panicked" message when closing the application
    By jano_alex_es in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 14th December 2010, 13:01
  2. What is the "main thread"? Why is it special?
    By tksharpless in forum Qt Programming
    Replies: 2
    Last Post: 5th December 2010, 00:04
  3. Replies: 7
    Last Post: 22nd October 2010, 12:17
  4. Thread shall emit signals with "complex" argument
    By Boron in forum Qt Programming
    Replies: 8
    Last Post: 17th June 2010, 18:22
  5. Replies: 5
    Last Post: 17th January 2008, 21:49

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.