Results 1 to 8 of 8

Thread: QThread Data Access Method

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QThread Data Access Method

    No, QWidget is not thread-safe as well. You musn't call any of QWidget (or descendant) methods from within a worker thread. If you want to transfer data between the worker thread and the main thread, you have to use either events or signals.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Aug 2009
    Posts
    7
    Qt products
    Qt4

    Default Re: QThread Data Access Method

    So you mean what i should do is to setup the thread to emit a signal when inside run() of the QThread Class and connect it back to a slot of the parent class and from that access the data?

    schan117

  3. #3
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    116
    Thanked 42 Times in 41 Posts

    Default Re: QThread Data Access Method

    follow this example ... it suits exact requirement for u on QThread
    http://doc.trolltech.com/4.0/network...uneclient.html
    "Behind every great fortune lies a crime" - Balzac

Similar Threads

  1. Struggling with QThread...
    By TemporalBeing in forum Qt Programming
    Replies: 2
    Last Post: 23rd March 2009, 21:46
  2. Replies: 2
    Last Post: 18th December 2008, 08:43
  3. Calling Recursivly loading function in Run() method of QThread
    By santosh.kumar in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2007, 15:42
  4. Replies: 2
    Last Post: 27th March 2007, 13:09
  5. IO Control Mechanism (Hardware Data Access)
    By rud_1023 in forum General Programming
    Replies: 2
    Last Post: 23rd October 2006, 13:50

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
  •  
Qt is a trademark of The Qt Company.