Possible Duplicate:
How to call GUI elements in different Qt threads?
I have an application in which a thread (not main thread) needs to access to GUI's elements (send a click action, show a message box, etc).Am working in python and Qt and i also know that it is not possible in not main thread. Is there a way to do it, i mean to send the action that i want to do in the thread to the main thread? i have tried : de
f myfunc(q):
self.emit(QtCore.SIGNAL('trie'))
try: line = q.get_nowait()
# or q.get(timeout=.1)
except Empty:
pass #No hacer nada si la linea de texto es null
else: # got line
# ... do something with line
self.emit(QtCore.SIGNAL('trie'))
thread = threading.Thread(target=myfunc, args=(q,))
thread.start()
And to connect:
self.connect(self.thread, QtCore.SIGNAL('tri'), self.prueba)
But it is not working, i think that the sender is not recognized like :self.thread
Here is my error:
Exception AttributeError: "'NoneType' object has no attribute 'GApp'" in <bound method VBoxManager.__del__ of <GNS3.VBoxManager.VBoxManager object at 0xa13e14c>