Results 1 to 2 of 2

Thread: QThread communication with GUI

  1. #1
    Join Date
    Mar 2008
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default QThread communication with GUI

    I need to obtain the value of a text edit from another thread than the gui. Is there another way than passing a pointer to the thread object? Something with signals/slots maybe?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QThread communication with GUI

    You can connect the QTextEdit::textChanged() signal to a custom slot somewhere in the GUI thread and in that slot emit a custom signal with a parameter that caries the text of the text box. Then you'll be able to connect to such signal from the worker thread.

Similar Threads

  1. Spawn a QThread in another QThread
    By david.corinex in forum Qt Programming
    Replies: 2
    Last Post: 19th December 2007, 13:54
  2. QThread and QSlot
    By Xaar in forum Qt Programming
    Replies: 5
    Last Post: 6th December 2007, 22:37
  3. QThread exec proplem to stop...
    By patrik08 in forum Qt Programming
    Replies: 29
    Last Post: 21st May 2007, 08:51
  4. Communication between QThread and Yes/No QMessageBox?
    By pmaktieh.sirhc in forum Qt Programming
    Replies: 11
    Last Post: 25th January 2007, 04:45
  5. Is it possible to create a QThread without inheriting ?
    By probine in forum Qt Programming
    Replies: 6
    Last Post: 23rd March 2006, 23:51

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.