PDA

View Full Version : QThread plus textEdit appending



Kokos
2nd April 2010, 09:44
Hello, I'm having difficulties with appending text to an textEdit whilng in a QThread,

basically, I just call Bla.start() and in Bla::run() { ui->gui.textEdit->append("Test");


When I run the program, it crashes instant, do anyone have any idea why?


Thanks in advance.

Kokos.

wysota
2nd April 2010, 09:54
When I run the program, it crashes instant, do anyone have any idea why?

Sure. Widgets are not thread-safe, you can't access them from threads other than the main thread.

Kokos
2nd April 2010, 10:01
Sure. Widgets are not thread-safe, you can't access them from threads other than the main thread.

Aight.. Thanks for quick answer:)