[PyQt] QObject: Cannot create children for a parent that is in a different thread. How to edit another threads objects?

Soumen banerjee soumen08 at gmail.com
Mon Sep 14 18:20:04 BST 2009


Hello,
I have a program with the following structure
1st thread which reads lines from a file
2nd a gui thread which contains(among other things) a textEdit
As the line is read from the file I want to display it in the text
box. When I use the settext method of the textedit object from the 1st
thread, it comes up with an error:

QObject: Cannot create children for a parent that is in a different thread.
(Parent is QTextDocument(0x838d3e8), parent's thread is
QThread(0x82e5788), current thread is QThread(0x83d2d38)
Segmentation fault

How can i get over this?Is there no way to interact with another
threads objects inside a thread?
Pls Help,
Soumen


More information about the PyQt mailing list