PDA

View Full Version : QThread communication with GUI



ldiamond
13th March 2008, 13:42
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?

wysota
14th March 2008, 00:00
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.