I have a deque type list (a queue) which I'd like to show and update in QTextEdit. There is a function uuenda_kama in class MyForm which should do this (and some other s*** too). First pass of this function when textEdit is empty, it works like a charm, all necessary fields are updated. But on second pass as there has some text added to it, it crashes throwing me a Visual Studio debugger in face. Tried commenting different parts out and came out that line "self.ui.textEdit.clear()" is causing this. What is wrong with it and why is it working on first pass? What can I do to fix it? Code I have right now:
class MyForm(QtGui.QMainWindow):
...
def uuenda_kama(self):
while True:
...
if vana_que != list(que):
self.ui.textEdit.clear()
for i in que:
self.ui.textEdit.append(i)
vana_que = list(que)
sleep(1)
if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
myapp = MyForm()
uuendamine = Thread(target=myapp.uuenda_kama)
uuendamine.start()
myapp.show()
sys.exit(app.exec_())