[PyQt] setText from threading

Reinaldo de Carvalho reinaldoc at gmail.com
Wed Feb 20 17:26:37 GMT 2008


PyQt3 3.16 (Debian etch), my program use Qt3, i cant update to PyQt4 now.

[...]

def thread_start( self ):
    self.gbox.setEnabled(False)
    self.thread1 = threading.Thread(target=self.simulate)
    self.thread1.setDaemon(1)
    self.thread1.start()

def simulate( self ):
i = 0
while i < 10:
    print str(i)
    self.textLabel1.setText(str(i))
    time.sleep(1)
    i = i  + 1

[...]

I am testing a startup threading method and get error from
"self.textLabel1.setText(str(i))":

0
Xlib: unexpected async reply (sequence 0x5e5)!

How access attibutes from theads?


-- 
Reinaldo Carvalho


More information about the PyQt mailing list