Sophie

Sophie

distrib > * > 2009.0 > i586 > by-pkgid > a6711891ce757817bba854bf3f25205a > files > 2487

qtjambi-doc-4.3.3-3mdv2008.1.i586.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /home/gvatteka/dev/qt-4.3/doc/src/richtext.qdoc -->
<head>
  <title>Advanced Rich Text Processing</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1 align="center">Advanced Rich Text Processing<br /><small></small></h1>
<a name="handling-large-files"></a>
<h2>Handling Large Files</h2>
<p>Qt does not limit the size of files that are used for text processing. In most cases, this will not present a problem. For especially large files, however, you might experience that your application will become unresponsive or that you will run out of memory. The size of the files you can load depends on your hardware and on Qt's and your own application's implementation.</p>
<p>If you are faced with this problem, we recommend that you address the following issues:</p>
<ul>
<li>You should consider breaking up large paragraphs into smaller ones as Qt handles small paragraphs better. You could also insert line breaks at regular intervals, which will look the same as one large paragraph in a <a href="gui/QTextEdit.html"><tt>QTextEdit</tt></a>.</li>
<li>You can reduce the amount of blocks in a <a href="gui/QTextDocument.html"><tt>QTextDocument</tt></a> with maximumBlockCount(). The document is only as large as the number of blocks as far as <a href="gui/QTextEdit.html"><tt>QTextEdit</tt></a> is concerned.</li>
<li>When adding text to a text edit, it is an advantage to add it in an edit block (see example below). The result is that the text edit does not need to build the entire document structure at once.</li>
</ul>
<p>We give an example of the latter technique in the list. We assume that the text edit is visible.</p>
<pre>    textEdit.show();

    textCursor.beginEditBlock();

    for (int i = 0; i &lt; 1000; ++i) {
        textCursor.insertBlock();
        textCursor.insertText(paragraphText.at(i));
    }

    textCursor.endEditBlock();</pre>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2007 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt Jambi </div></td>
</tr></table></div></address></body>
</html>