PDA

View Full Version : Problem in updating text in QTextEdit control



sankar
13th March 2011, 13:58
Hi Experts,

In my application, I want to update my conversion process to user. So i thought of using QTextEdit. I know how to insert, append & setText using it. But the problem here is after inserting or appending the text, my dialog is not getting updated. It prints all data at the end of function.

Could you tell me how to update text dynamically in QTextEdit or any other control can be used. Say i will append some 10 lines of text at certain areas in my code. But i want them to be displayed after every insert now and then in the control. But the function call will end after completing my conversion process and updating the text.

Thanks,
Sankar.

stampede
13th March 2011, 14:23
Just a guess - probably you need to process events:


textEdit->append("text");
qApp->processEvents();

Here is very good article: Responsive GUI (http://doc.qt.nokia.com/qq/qq27-responsive-guis.html)
Show the code so it'll be easier to help.

sankar
13th March 2011, 16:14
Thanks stampede.

It worked as expected.