What's a good way to display a lot of text in QT
<p>I'm building an app that will read in a gcode file. Files range from  a few KB to a few hundred MB (but that's rare). After a user selects a file, the program goes through it and reads it line by line. This doesn't take long at all.</p>

<p>I want to display the text of the file I just read in in a QTextEdit widget. Unfortuantely, doing this takes a really long time (a few seconds for even small files).</p>

<p>I've thought about just adding a "loading, please wait" message for the user, but I was wondering if there was a way to speed up the text loading process.</p>

<p>right now my code looks like this:</p>

<pre><code> QTextStream in(gcodeFile); //The file path was given by the user
 ui-&gt;textEdit-&gt;setText(in.readAll());
 in.seek(0);
 processGcode();
</code></pre>

<p><strong>Is there a better way to load a lot of text into a QTextEdit that won't make the app hang?</strong> </p>

<p>Note: The issue is not that I'm reading through the file twice. I changed my code so that it did the processing at the same time as adding the text to the QTextEdit, but the whole thing still took too long.</p>