PDA

View Full Version : repaint problem in QTextEdit



kennyxing
10th November 2006, 07:43
Hi all,

Basically I'm displaying thousands of lines on a QTextEdit sequentially.

However, no matter I use edit.append() or cursor.insertText(), lines are only displayed when all the lines are written and the editor is blocked until then.

I try to use edit.repaint(), edit.update() and even thread.wait() after writing every line. But none of these work. What am I supposed to solve this problem?

jpn
10th November 2006, 07:54
Try calling QCoreApplication::processEvents() in between appending text:


edit.append(...);
qApp->processEvents();
edit.append(...);
..

kennyxing
10th November 2006, 09:49
It's working now.Great, thanks ~