Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 6787

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qtextdocument.cpp -->
  <title>Qt 4.8: QTextDocument Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QTextDocument</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QTextDocument Class Reference</h1>
<!-- $$$QTextDocument-brief -->
<p>The QTextDocument class holds formatted text that can be viewed and edited using a <a href="qtextedit.html">QTextEdit</a>. <a href="#details">More...</a></p>
<!-- @@@QTextDocument -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QTextDocument&gt;</span></pre><p><b>Inherits: </b><a href="qobject.html">QObject</a>.</p>
<p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<ul>
<li><a href="qtextdocument-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#FindFlag-enum">FindFlag</a></b> { FindBackward, FindCaseSensitively, FindWholeWords }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#FindFlag-enum">FindFlags</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#MetaInformation-enum">MetaInformation</a></b> { DocumentTitle, DocumentUrl }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#ResourceType-enum">ResourceType</a></b> { HtmlResource, ImageResource, StyleSheetResource, UserResource }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#Stacks-enum">Stacks</a></b> { UndoStack, RedoStack, UndoAndRedoStacks }</td></tr>
</table>
<a name="properties"></a>
<h2>Properties</h2>
<table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qtextdocument.html#blockCount-prop">blockCount</a></b> : const int</li>
<li class="fn"><b><a href="qtextdocument.html#defaultFont-prop">defaultFont</a></b> : QFont</li>
<li class="fn"><b><a href="qtextdocument.html#defaultStyleSheet-prop">defaultStyleSheet</a></b> : QString</li>
<li class="fn"><b><a href="qtextdocument.html#defaultTextOption-prop">defaultTextOption</a></b> : QTextOption</li>
<li class="fn"><b><a href="qtextdocument.html#documentMargin-prop">documentMargin</a></b> : qreal</li>
<li class="fn"><b><a href="qtextdocument.html#indentWidth-prop">indentWidth</a></b> : qreal</li>
<li class="fn"><b><a href="qtextdocument.html#maximumBlockCount-prop">maximumBlockCount</a></b> : int</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qtextdocument.html#modified-prop">modified</a></b> : bool</li>
<li class="fn"><b><a href="qtextdocument.html#pageSize-prop">pageSize</a></b> : QSizeF</li>
<li class="fn"><b><a href="qtextdocument.html#size-prop">size</a></b> : const QSizeF</li>
<li class="fn"><b><a href="qtextdocument.html#textWidth-prop">textWidth</a></b> : qreal</li>
<li class="fn"><b><a href="qtextdocument.html#undoRedoEnabled-prop">undoRedoEnabled</a></b> : bool</li>
<li class="fn"><b><a href="qtextdocument.html#useDesignMetrics-prop">useDesignMetrics</a></b> : bool</li>
</ul>
</td></tr>
</table>
<ul>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#QTextDocument">QTextDocument</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#QTextDocument-2">QTextDocument</a></b> ( const QString &amp; <i>text</i>, QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#dtor.QTextDocument">~QTextDocument</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#addResource">addResource</a></b> ( int <i>type</i>, const QUrl &amp; <i>name</i>, const QVariant &amp; <i>resource</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#adjustSize">adjustSize</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector&lt;QTextFormat&gt; </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#allFormats">allFormats</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#availableRedoSteps">availableRedoSteps</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#availableUndoSteps">availableUndoSteps</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextBlock </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#begin">begin</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#blockCount-prop">blockCount</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QChar </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#characterAt">characterAt</a></b> ( int <i>pos</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#characterCount">characterCount</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#clearUndoRedoStacks">clearUndoRedoStacks</a></b> ( Stacks <i>stacksToClear</i> = UndoAndRedoStacks )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextDocument * </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#clone">clone</a></b> ( QObject * <i>parent</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::CursorMoveStyle </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#defaultCursorMoveStyle">defaultCursorMoveStyle</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#defaultFont-prop">defaultFont</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#defaultStyleSheet-prop">defaultStyleSheet</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextOption </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#defaultTextOption-prop">defaultTextOption</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAbstractTextDocumentLayout * </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#documentLayout">documentLayout</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#documentMargin-prop">documentMargin</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#drawContents">drawContents</a></b> ( QPainter * <i>p</i>, const QRectF &amp; <i>rect</i> = QRectF() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextBlock </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#end">end</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextCursor </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#find">find</a></b> ( const QString &amp; <i>subString</i>, const QTextCursor &amp; <i>cursor</i>, FindFlags <i>options</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextCursor </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#find-2">find</a></b> ( const QRegExp &amp; <i>expr</i>, const QTextCursor &amp; <i>cursor</i>, FindFlags <i>options</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextCursor </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#find-3">find</a></b> ( const QString &amp; <i>subString</i>, int <i>position</i> = 0, FindFlags <i>options</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextCursor </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#find-4">find</a></b> ( const QRegExp &amp; <i>expr</i>, int <i>position</i> = 0, FindFlags <i>options</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextBlock </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#findBlock">findBlock</a></b> ( int <i>pos</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextBlock </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#findBlockByLineNumber">findBlockByLineNumber</a></b> ( int <i>lineNumber</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextBlock </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#findBlockByNumber">findBlockByNumber</a></b> ( int <i>blockNumber</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextBlock </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#firstBlock">firstBlock</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#idealWidth">idealWidth</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#indentWidth-prop">indentWidth</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#isEmpty">isEmpty</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#modified-prop">isModified</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#isRedoAvailable">isRedoAvailable</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#isUndoAvailable">isUndoAvailable</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#undoRedoEnabled-prop">isUndoRedoEnabled</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextBlock </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#lastBlock">lastBlock</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#lineCount">lineCount</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#markContentsDirty">markContentsDirty</a></b> ( int <i>position</i>, int <i>length</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#maximumBlockCount-prop">maximumBlockCount</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#metaInformation">metaInformation</a></b> ( MetaInformation <i>info</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextObject * </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#object">object</a></b> ( int <i>objectIndex</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextObject * </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#objectForFormat">objectForFormat</a></b> ( const QTextFormat &amp; <i>f</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#pageCount">pageCount</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSizeF </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#pageSize-prop">pageSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#print">print</a></b> ( QPrinter * <i>printer</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#redo">redo</a></b> ( QTextCursor * <i>cursor</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#resource">resource</a></b> ( int <i>type</i>, const QUrl &amp; <i>name</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#revision">revision</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextFrame * </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#rootFrame">rootFrame</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#setDefaultCursorMoveStyle">setDefaultCursorMoveStyle</a></b> ( Qt::CursorMoveStyle <i>style</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#defaultFont-prop">setDefaultFont</a></b> ( const QFont &amp; <i>font</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#defaultStyleSheet-prop">setDefaultStyleSheet</a></b> ( const QString &amp; <i>sheet</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#defaultTextOption-prop">setDefaultTextOption</a></b> ( const QTextOption &amp; <i>option</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#setDocumentLayout">setDocumentLayout</a></b> ( QAbstractTextDocumentLayout * <i>layout</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#documentMargin-prop">setDocumentMargin</a></b> ( qreal <i>margin</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#setHtml">setHtml</a></b> ( const QString &amp; <i>html</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#indentWidth-prop">setIndentWidth</a></b> ( qreal <i>width</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#maximumBlockCount-prop">setMaximumBlockCount</a></b> ( int <i>maximum</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#setMetaInformation">setMetaInformation</a></b> ( MetaInformation <i>info</i>, const QString &amp; <i>string</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#pageSize-prop">setPageSize</a></b> ( const QSizeF &amp; <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#setPlainText">setPlainText</a></b> ( const QString &amp; <i>text</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#textWidth-prop">setTextWidth</a></b> ( qreal <i>width</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#undoRedoEnabled-prop">setUndoRedoEnabled</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#useDesignMetrics-prop">setUseDesignMetrics</a></b> ( bool <i>b</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSizeF </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#size-prop">size</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#textWidth-prop">textWidth</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#toHtml">toHtml</a></b> ( const QByteArray &amp; <i>encoding</i> = QByteArray() ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#toPlainText">toPlainText</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#undo">undo</a></b> ( QTextCursor * <i>cursor</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#useDesignMetrics-prop">useDesignMetrics</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#redo-2">redo</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#modified-prop">setModified</a></b> ( bool <i>m</i> = true )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#undo-2">undo</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#blockCountChanged">blockCountChanged</a></b> ( int <i>newBlockCount</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#contentsChange">contentsChange</a></b> ( int <i>position</i>, int <i>charsRemoved</i>, int <i>charsAdded</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#contentsChanged">contentsChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#cursorPositionChanged">cursorPositionChanged</a></b> ( const QTextCursor &amp; <i>cursor</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#documentLayoutChanged">documentLayoutChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#modificationChanged">modificationChanged</a></b> ( bool <i>changed</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#redoAvailable">redoAvailable</a></b> ( bool <i>available</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#undoAvailable">undoAvailable</a></b> ( bool <i>available</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#undoCommandAdded">undoCommandAdded</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual QTextObject * </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#createObject">createObject</a></b> ( const QTextFormat &amp; <i>format</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qtextdocument.html#loadResource">loadResource</a></b> ( int <i>type</i>, const QUrl &amp; <i>name</i> )</td></tr>
</table>
<ul>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QTextDocument-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QTextDocument class holds formatted text that can be viewed and edited using a <a href="qtextedit.html">QTextEdit</a>.</p>
<p>QTextDocument is a container for structured rich text documents, providing support for styled text and various types of document elements, such as lists, tables, frames, and images. They can be created for use in a <a href="qtextedit.html">QTextEdit</a>, or used independently.</p>
<p>Each document element is described by an associated format object. Each format object is treated as a unique object by QTextDocuments, and can be passed to <a href="qtextdocument.html#objectForFormat">objectForFormat</a>() to obtain the document element that it is applied to.</p>
<p>A QTextDocument can be edited programmatically using a <a href="qtextcursor.html">QTextCursor</a>, and its contents can be examined by traversing the document structure. The entire document structure is stored as a hierarchy of document elements beneath the root frame, found with the <a href="qtextdocument.html#rootFrame">rootFrame</a>() function. Alternatively, if you just want to iterate over the textual contents of the document you can use <a href="qtextdocument.html#begin">begin</a>(), <a href="qtextdocument.html#end">end</a>(), and <a href="qtextdocument.html#findBlock">findBlock</a>() to retrieve text blocks that you can examine and iterate over.</p>
<p>The layout of a document is determined by the <a href="qtextdocument.html#documentLayout">documentLayout</a>(); you can create your own <a href="qabstracttextdocumentlayout.html">QAbstractTextDocumentLayout</a> subclass and set it using <a href="qtextdocument.html#setDocumentLayout">setDocumentLayout</a>() if you want to use your own layout logic. The document's title and other meta-information can be obtained by calling the <a href="qtextdocument.html#metaInformation">metaInformation</a>() function. For documents that are exposed to users through the <a href="qtextedit.html">QTextEdit</a> class, the document title is also available via the <a href="qtextedit.html#documentTitle-prop">QTextEdit::documentTitle</a>() function.</p>
<p>The <a href="qtextdocument.html#toPlainText">toPlainText</a>() and <a href="qtextdocument.html#toHtml">toHtml</a>() convenience functions allow you to retrieve the contents of the document as plain text and HTML. The document's text can be searched using the <a href="qtextdocument.html#find">find</a>() functions.</p>
<p>Undo/redo of operations performed on the document can be controlled using the <a href="qtextdocument.html#undoRedoEnabled-prop">setUndoRedoEnabled</a>() function. The undo/redo system can be controlled by an editor widget through the <a href="qtextdocument.html#undo">undo</a>() and <a href="qtextdocument.html#redo">redo</a>() slots; the document also provides <a href="qtextdocument.html#contentsChanged">contentsChanged</a>(), <a href="qtextdocument.html#undoAvailable">undoAvailable</a>(), and <a href="qtextdocument.html#redoAvailable">redoAvailable</a>() signals that inform connected editor widgets about the state of the undo/redo system. The following are the undo/redo operations of a QTextDocument:</p>
<ul>
<li>Insertion or removal of characters. A sequence of insertions or removals within the same text block are regarded as a single undo/redo operation.</li>
<li>Insertion or removal of text blocks. Sequences of insertion or removals in a single operation (e.g&#x2e;, by selecting and then deleting text) are regarded as a single undo/redo operation.</li>
<li>Text character format changes.</li>
<li>Text block format changes.</li>
<li>Text block group format changes.</li>
</ul>
</div>
<p><b>See also </b><a href="qtextcursor.html">QTextCursor</a>, <a href="qtextedit.html">QTextEdit</a>, <a href="richtext.html">Rich Text Processing</a>, and <a href="richtext-textobject.html">Text Object Example</a>.</p>
<!-- @@@QTextDocument -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$FindFlag$$$FindBackward$$$FindCaseSensitively$$$FindWholeWords -->
<h3 class="flags"><a name="FindFlag-enum"></a>enum QTextDocument::<span class="name">FindFlag</span><br/>flags QTextDocument::<span class="name">FindFlags</span></h3>
<p>This enum describes the options available to <a href="qtextdocument.html">QTextDocument</a>'s find function. The options can be OR-ed together from the following list:</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QTextDocument::FindBackward</tt></td><td class="topAlign"><tt>0x00001</tt></td><td class="topAlign">Search backwards instead of forwards.</td></tr>
<tr><td class="topAlign"><tt>QTextDocument::FindCaseSensitively</tt></td><td class="topAlign"><tt>0x00002</tt></td><td class="topAlign">By default find works case insensitive. Specifying this option changes the behaviour to a case sensitive find operation.</td></tr>
<tr><td class="topAlign"><tt>QTextDocument::FindWholeWords</tt></td><td class="topAlign"><tt>0x00004</tt></td><td class="topAlign">Makes find match only complete words.</td></tr>
</table>
<p>The FindFlags type is a typedef for <a href="qflags.html">QFlags</a>&lt;FindFlag&gt;. It stores an OR combination of FindFlag values.</p>
<!-- @@@FindFlag -->
<!-- $$$MetaInformation$$$DocumentTitle$$$DocumentUrl -->
<h3 class="fn"><a name="MetaInformation-enum"></a>enum QTextDocument::<span class="name">MetaInformation</span></h3>
<p>This enum describes the different types of meta information that can be added to a document.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QTextDocument::DocumentTitle</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">The title of the document.</td></tr>
<tr><td class="topAlign"><tt>QTextDocument::DocumentUrl</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">The url of the document. The <a href="qtextdocument.html#loadResource">loadResource</a>() function uses this url as the base when loading relative resources.</td></tr>
</table>
<p><b>See also </b><a href="qtextdocument.html#metaInformation">metaInformation</a>() and <a href="qtextdocument.html#setMetaInformation">setMetaInformation</a>().</p>
<!-- @@@MetaInformation -->
<!-- $$$ResourceType$$$HtmlResource$$$ImageResource$$$StyleSheetResource$$$UserResource -->
<h3 class="fn"><a name="ResourceType-enum"></a>enum QTextDocument::<span class="name">ResourceType</span></h3>
<p>This enum describes the types of resources that can be loaded by <a href="qtextdocument.html">QTextDocument</a>'s <a href="qtextdocument.html#loadResource">loadResource</a>() function.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QTextDocument::HtmlResource</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">The resource contains HTML.</td></tr>
<tr><td class="topAlign"><tt>QTextDocument::ImageResource</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">The resource contains image data. Currently supported data types are <a href="qvariant.html#Type-enum">QVariant::Pixmap</a> and <a href="qvariant.html#Type-enum">QVariant::Image</a>. If the corresponding variant is of type <a href="qvariant.html#Type-enum">QVariant::ByteArray</a> then Qt attempts to load the image using QImage::loadFromData. <a href="qvariant.html#Type-enum">QVariant::Icon</a> is currently not supported. The icon needs to be converted to one of the supported types first, for example using QIcon::pixmap.</td></tr>
<tr><td class="topAlign"><tt>QTextDocument::StyleSheetResource</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">The resource contains CSS.</td></tr>
<tr><td class="topAlign"><tt>QTextDocument::UserResource</tt></td><td class="topAlign"><tt>100</tt></td><td class="topAlign">The first available value for user defined resource types.</td></tr>
</table>
<p><b>See also </b><a href="qtextdocument.html#loadResource">loadResource</a>().</p>
<!-- @@@ResourceType -->
<!-- $$$Stacks$$$UndoStack$$$RedoStack$$$UndoAndRedoStacks -->
<h3 class="fn"><a name="Stacks-enum"></a>enum QTextDocument::<span class="name">Stacks</span></h3>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QTextDocument::UndoStack</tt></td><td class="topAlign"><tt>0x01</tt></td><td class="topAlign">The undo stack.</td></tr>
<tr><td class="topAlign"><tt>QTextDocument::RedoStack</tt></td><td class="topAlign"><tt>0x02</tt></td><td class="topAlign">The redo stack.</td></tr>
<tr><td class="topAlign"><tt>QTextDocument::UndoAndRedoStacks</tt></td><td class="topAlign"><tt>UndoStack | RedoStack</tt></td><td class="topAlign">Both the undo and redo stacks.</td></tr>
</table>
<!-- @@@Stacks -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$blockCount-prop$$$blockCount -->
<h3 class="fn"><a name="blockCount-prop"></a><span class="name">blockCount</span> : const <span class="type">int</span></h3>
<p>Returns the number of text blocks in the document.</p>
<p>The value of this property is undefined in documents with tables or frames.</p>
<p>By default, if defined, this property contains a value of 1.</p>
<p>This property was introduced in Qt 4.2.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>blockCount</b></span> () const</td></tr>
</table>
<p><b>See also </b><a href="qtextdocument.html#lineCount">lineCount</a>() and <a href="qtextdocument.html#characterCount">characterCount</a>().</p>
<!-- @@@blockCount -->
<!-- $$$defaultFont-prop$$$defaultFont$$$setDefaultFontconstQFont& -->
<h3 class="fn"><a name="defaultFont-prop"></a><span class="name">defaultFont</span> : <span class="type"><a href="qfont.html">QFont</a></span></h3>
<p>This property holds the default font used to display the document's text.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QFont </td><td class="memItemRight bottomAlign"><span class="name"><b>defaultFont</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDefaultFont</b></span> ( const QFont &amp; <i>font</i> )</td></tr>
</table>
<!-- @@@defaultFont -->
<!-- $$$defaultStyleSheet-prop$$$defaultStyleSheet$$$setDefaultStyleSheetconstQString& -->
<h3 class="fn"><a name="defaultStyleSheet-prop"></a><span class="name">defaultStyleSheet</span> : <span class="type"><a href="qstring.html">QString</a></span></h3>
<p>The default style sheet is applied to all newly HTML formatted text that is inserted into the document, for example using <a href="qtextdocument.html#setHtml">setHtml</a>() or <a href="qtextcursor.html#insertHtml">QTextCursor::insertHtml</a>().</p>
<p>The style sheet needs to be compliant to CSS 2.1 syntax.</p>
<p><b>Note:</b> Changing the default style sheet does not have any effect to the existing content of the document.</p>
<p>This property was introduced in Qt 4.2.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>defaultStyleSheet</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDefaultStyleSheet</b></span> ( const QString &amp; <i>sheet</i> )</td></tr>
</table>
<p><b>See also </b><a href="richtext-html-subset.html">Supported HTML Subset</a>.</p>
<!-- @@@defaultStyleSheet -->
<!-- $$$defaultTextOption-prop$$$defaultTextOption$$$setDefaultTextOptionconstQTextOption& -->
<h3 class="fn"><a name="defaultTextOption-prop"></a><span class="name">defaultTextOption</span> : <span class="type"><a href="qtextoption.html">QTextOption</a></span></h3>
<p>This property holds the default text option will be set on all QTextLayouts in the document.</p>
<p>When <a href="qtextblock.html">QTextBlock</a>s are created, the defaultTextOption is set on their <a href="qtextlayout.html">QTextLayout</a>. This allows setting global properties for the document such as the default word wrap mode.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QTextOption </td><td class="memItemRight bottomAlign"><span class="name"><b>defaultTextOption</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDefaultTextOption</b></span> ( const QTextOption &amp; <i>option</i> )</td></tr>
</table>
<!-- @@@defaultTextOption -->
<!-- $$$documentMargin-prop$$$documentMargin$$$setDocumentMarginqreal -->
<h3 class="fn"><a name="documentMargin-prop"></a><span class="name">documentMargin</span> : <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span></h3>
<p>The margin around the document. The default is 4.</p>
<p>This property was introduced in Qt 4.5.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b>documentMargin</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDocumentMargin</b></span> ( qreal <i>margin</i> )</td></tr>
</table>
<!-- @@@documentMargin -->
<!-- $$$indentWidth-prop$$$indentWidth$$$setIndentWidthqreal -->
<h3 class="fn"><a name="indentWidth-prop"></a><span class="name">indentWidth</span> : <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span></h3>
<p>Returns the width used for text list and text block indenting.</p>
<p>The indent properties of <a href="qtextlistformat.html">QTextListFormat</a> and <a href="qtextblockformat.html">QTextBlockFormat</a> specify multiples of this value. The default indent width is 40.</p>
<p>This property was introduced in Qt 4.4.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b>indentWidth</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setIndentWidth</b></span> ( qreal <i>width</i> )</td></tr>
</table>
<!-- @@@indentWidth -->
<!-- $$$maximumBlockCount-prop$$$maximumBlockCount$$$setMaximumBlockCountint -->
<h3 class="fn"><a name="maximumBlockCount-prop"></a><span class="name">maximumBlockCount</span> : <span class="type">int</span></h3>
<p>This property specifies the limit for blocks in the document.</p>
<p>Specifies the maximum number of blocks the document may have. If there are more blocks in the document that specified with this property blocks are removed from the beginning of the document.</p>
<p>A negative or zero value specifies that the document may contain an unlimited amount of blocks.</p>
<p>The default value is 0.</p>
<p>Note that setting this property will apply the limit immediately to the document contents.</p>
<p>Setting this property also disables the undo redo history.</p>
<p>This property is undefined in documents with tables or frames.</p>
<p>This property was introduced in Qt 4.2.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>maximumBlockCount</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setMaximumBlockCount</b></span> ( int <i>maximum</i> )</td></tr>
</table>
<!-- @@@maximumBlockCount -->
<!-- $$$modified-prop$$$isModified$$$setModifiedbool -->
<h3 class="fn"><a name="modified-prop"></a><span class="name">modified</span> : <span class="type">bool</span></h3>
<p>This property holds whether the document has been modified by the user.</p>
<p>By default, this property is false.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isModified</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setModified</b></span> ( bool <i>m</i> = true )</td></tr>
</table>
<p><b>See also </b><a href="qtextdocument.html#modificationChanged">modificationChanged</a>().</p>
<!-- @@@modified -->
<!-- $$$pageSize-prop$$$pageSize$$$setPageSizeconstQSizeF& -->
<h3 class="fn"><a name="pageSize-prop"></a><span class="name">pageSize</span> : <span class="type"><a href="qsizef.html">QSizeF</a></span></h3>
<p>This property holds the page size that should be used for laying out the document.</p>
<p>By default, for a newly-created, empty document, this property contains an undefined size.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QSizeF </td><td class="memItemRight bottomAlign"><span class="name"><b>pageSize</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setPageSize</b></span> ( const QSizeF &amp; <i>size</i> )</td></tr>
</table>
<p><b>See also </b><a href="qtextdocument.html#modificationChanged">modificationChanged</a>().</p>
<!-- @@@pageSize -->
<!-- $$$size-prop$$$size -->
<h3 class="fn"><a name="size-prop"></a><span class="name">size</span> : const <span class="type"><a href="qsizef.html">QSizeF</a></span></h3>
<p>Returns the actual size of the document. This is equivalent to <a href="qtextdocument.html#documentLayout">documentLayout</a>()-&gt;documentSize();</p>
<p>The size of the document can be changed either by setting a text width or setting an entire page size.</p>
<p>Note that the width is always &gt;= <a href="qtextdocument.html#pageSize-prop">pageSize</a>().width().</p>
<p>By default, for a newly-created, empty document, this property contains a configuration-dependent size.</p>
<p>This property was introduced in Qt 4.2.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QSizeF </td><td class="memItemRight bottomAlign"><span class="name"><b>size</b></span> () const</td></tr>
</table>
<p><b>See also </b><a href="qtextdocument.html#textWidth-prop">setTextWidth</a>(), <a href="qtextdocument.html#pageSize-prop">setPageSize</a>(), and <a href="qtextdocument.html#idealWidth">idealWidth</a>().</p>
<!-- @@@size -->
<!-- $$$textWidth-prop$$$textWidth$$$setTextWidthqreal -->
<h3 class="fn"><a name="textWidth-prop"></a><span class="name">textWidth</span> : <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span></h3>
<p>The text width specifies the preferred width for text in the document. If the text (or content in general) is wider than the specified with it is broken into multiple lines and grows vertically. If the text cannot be broken into multiple lines to fit into the specified text width it will be larger and the <a href="qtextdocument.html#size-prop">size</a>() and the <a href="qtextdocument.html#idealWidth">idealWidth</a>() property will reflect that.</p>
<p>If the text width is set to -1 then the text will not be broken into multiple lines unless it is enforced through an explicit line break or a new paragraph.</p>
<p>The default value is -1.</p>
<p>Setting the text width will also set the page height to -1, causing the document to grow or shrink vertically in a continuous way. If you want the document layout to break the text into multiple pages then you have to set the <a href="qtextdocument.html#pageSize-prop">pageSize</a> property instead.</p>
<p>This property was introduced in Qt 4.2.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b>textWidth</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setTextWidth</b></span> ( qreal <i>width</i> )</td></tr>
</table>
<p><b>See also </b><a href="qtextdocument.html#size-prop">size</a>(), <a href="qtextdocument.html#idealWidth">idealWidth</a>(), and <a href="qtextdocument.html#pageSize-prop">pageSize</a>().</p>
<!-- @@@textWidth -->
<!-- $$$undoRedoEnabled-prop$$$isUndoRedoEnabled$$$setUndoRedoEnabledbool -->
<h3 class="fn"><a name="undoRedoEnabled-prop"></a><span class="name">undoRedoEnabled</span> : <span class="type">bool</span></h3>
<p>This property holds whether undo/redo are enabled for this document.</p>
<p>This defaults to true. If disabled, the undo stack is cleared and no items will be added to it.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isUndoRedoEnabled</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setUndoRedoEnabled</b></span> ( bool <i>enable</i> )</td></tr>
</table>
<!-- @@@undoRedoEnabled -->
<!-- $$$useDesignMetrics-prop$$$useDesignMetrics$$$setUseDesignMetricsbool -->
<h3 class="fn"><a name="useDesignMetrics-prop"></a><span class="name">useDesignMetrics</span> : <span class="type">bool</span></h3>
<p>This property holds whether the document uses design metrics of fonts to improve the accuracy of text layout.</p>
<p>If this property is set to true, the layout will use design metrics. Otherwise, the metrics of the paint device as set on <a href="qabstracttextdocumentlayout.html#setPaintDevice">QAbstractTextDocumentLayout::setPaintDevice</a>() will be used.</p>
<p>Using design metrics makes a layout have a width that is no longer dependent on hinting and pixel-rounding. This means that WYSIWYG text layout becomes possible because the width scales much more linearly based on paintdevice metrics than it would otherwise.</p>
<p>By default, this property is false.</p>
<p>This property was introduced in Qt 4.1.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>useDesignMetrics</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setUseDesignMetrics</b></span> ( bool <i>b</i> )</td></tr>
</table>
<!-- @@@useDesignMetrics -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QTextDocument[overload1]$$$QTextDocumentQObject* -->
<h3 class="fn"><a name="QTextDocument"></a>QTextDocument::<span class="name">QTextDocument</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs an empty <a href="qtextdocument.html">QTextDocument</a> with the given <i>parent</i>.</p>
<!-- @@@QTextDocument -->
<!-- $$$QTextDocument$$$QTextDocumentconstQString&QObject* -->
<h3 class="fn"><a name="QTextDocument-2"></a>QTextDocument::<span class="name">QTextDocument</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i>, <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a <a href="qtextdocument.html">QTextDocument</a> containing the plain (unformatted) <i>text</i> specified, and with the given <i>parent</i>.</p>
<!-- @@@QTextDocument -->
<!-- $$$~QTextDocument[overload1]$$$~QTextDocument -->
<h3 class="fn"><a name="dtor.QTextDocument"></a>QTextDocument::<span class="name">~QTextDocument</span> ()</h3>
<p>Destroys the document.</p>
<!-- @@@~QTextDocument -->
<!-- $$$addResource[overload1]$$$addResourceintconstQUrl&constQVariant& -->
<h3 class="fn"><a name="addResource"></a><span class="type">void</span> QTextDocument::<span class="name">addResource</span> ( <span class="type">int</span> <i>type</i>, const <span class="type"><a href="qurl.html">QUrl</a></span> &amp; <i>name</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> &amp; <i>resource</i> )</h3>
<p>Adds the resource <i>resource</i> to the resource cache, using <i>type</i> and <i>name</i> as identifiers. <i>type</i> should be a value from <a href="qtextdocument.html#ResourceType-enum">QTextDocument::ResourceType</a>.</p>
<p>For example, you can add an image as a resource in order to reference it from within the document:</p>
<pre class="cpp">     document<span class="operator">-</span><span class="operator">&gt;</span>addResource(<span class="type"><a href="qtextdocument.html">QTextDocument</a></span><span class="operator">::</span>ImageResource<span class="operator">,</span>
         <span class="type"><a href="qurl.html">QUrl</a></span>(<span class="string">&quot;mydata://image.png&quot;</span>)<span class="operator">,</span> <span class="type"><a href="qvariant.html">QVariant</a></span>(image));</pre>
<p>The image can be inserted into the document using the <a href="qtextcursor.html">QTextCursor</a> API:</p>
<pre class="cpp">     <span class="type"><a href="qtextimageformat.html">QTextImageFormat</a></span> imageFormat;
     imageFormat<span class="operator">.</span>setName(<span class="string">&quot;mydata://image.png&quot;</span>);
     cursor<span class="operator">.</span>insertImage(imageFormat);</pre>
<p>Alternatively, you can insert images using the HTML <tt>img</tt> tag:</p>
<pre class="cpp">     editor<span class="operator">-</span><span class="operator">&gt;</span>append(<span class="string">&quot;&lt;img src=\&quot;mydata://image.png\&quot; /&gt;&quot;</span>);</pre>
<!-- @@@addResource -->
<!-- $$$adjustSize[overload1]$$$adjustSize -->
<h3 class="fn"><a name="adjustSize"></a><span class="type">void</span> QTextDocument::<span class="name">adjustSize</span> ()</h3>
<p>Adjusts the document to a reasonable size.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qtextdocument.html#idealWidth">idealWidth</a>(), <a href="qtextdocument.html#textWidth-prop">textWidth</a>, and <a href="qtextdocument.html#size-prop">size</a>.</p>
<!-- @@@adjustSize -->
<!-- $$$allFormats[overload1]$$$allFormats -->
<h3 class="fn"><a name="allFormats"></a><span class="type"><a href="qvector.html">QVector</a></span>&lt;<span class="type"><a href="qtextformat.html">QTextFormat</a></span>&gt; QTextDocument::<span class="name">allFormats</span> () const</h3>
<p>Returns a vector of text formats for all the formats used in the document.</p>
<!-- @@@allFormats -->
<!-- $$$availableRedoSteps[overload1]$$$availableRedoSteps -->
<h3 class="fn"><a name="availableRedoSteps"></a><span class="type">int</span> QTextDocument::<span class="name">availableRedoSteps</span> () const</h3>
<p>Returns the number of available redo steps.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qtextdocument.html#isRedoAvailable">isRedoAvailable</a>().</p>
<!-- @@@availableRedoSteps -->
<!-- $$$availableUndoSteps[overload1]$$$availableUndoSteps -->
<h3 class="fn"><a name="availableUndoSteps"></a><span class="type">int</span> QTextDocument::<span class="name">availableUndoSteps</span> () const</h3>
<p>Returns the number of available undo steps.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qtextdocument.html#isUndoAvailable">isUndoAvailable</a>().</p>
<!-- @@@availableUndoSteps -->
<!-- $$$begin[overload1]$$$begin -->
<h3 class="fn"><a name="begin"></a><span class="type"><a href="qtextblock.html">QTextBlock</a></span> QTextDocument::<span class="name">begin</span> () const</h3>
<p>Returns the document's first text block.</p>
<p><b>See also </b><a href="qtextdocument.html#firstBlock">firstBlock</a>().</p>
<!-- @@@begin -->
<!-- $$$blockCountChanged[overload1]$$$blockCountChangedint -->
<h3 class="fn"><a name="blockCountChanged"></a><span class="type">void</span> QTextDocument::<span class="name">blockCountChanged</span> ( <span class="type">int</span> <i>newBlockCount</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the total number of text blocks in the document changes. The value passed in <i>newBlockCount</i> is the new total.</p>
<p>This function was introduced in Qt 4.3.</p>
<!-- @@@blockCountChanged -->
<!-- $$$characterAt[overload1]$$$characterAtint -->
<h3 class="fn"><a name="characterAt"></a><span class="type"><a href="qchar.html">QChar</a></span> QTextDocument::<span class="name">characterAt</span> ( <span class="type">int</span> <i>pos</i> ) const</h3>
<p>Returns the character at position <i>pos</i>, or a null character if the position is out of range.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qtextdocument.html#characterCount">characterCount</a>().</p>
<!-- @@@characterAt -->
<!-- $$$characterCount[overload1]$$$characterCount -->
<h3 class="fn"><a name="characterCount"></a><span class="type">int</span> QTextDocument::<span class="name">characterCount</span> () const</h3>
<p>Returns the number of characters of this document.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qtextdocument.html#blockCount-prop">blockCount</a>() and <a href="qtextdocument.html#characterAt">characterAt</a>().</p>
<!-- @@@characterCount -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn"><a name="clear"></a><span class="type">void</span> QTextDocument::<span class="name">clear</span> ()<tt> [virtual]</tt></h3>
<p>Clears the document.</p>
<!-- @@@clear -->
<!-- $$$clearUndoRedoStacks[overload1]$$$clearUndoRedoStacksStacks -->
<h3 class="fn"><a name="clearUndoRedoStacks"></a><span class="type">void</span> QTextDocument::<span class="name">clearUndoRedoStacks</span> ( <span class="type"><a href="qtextdocument.html#Stacks-enum">Stacks</a></span> <i>stacksToClear</i> = UndoAndRedoStacks )</h3>
<p>Clears the stacks specified by <i>stacksToClear</i>.</p>
<p>This method clears any commands on the undo stack, the redo stack, or both (the default). If commands are cleared, the appropriate signals are emitted, <a href="qtextdocument.html#undoAvailable">QTextDocument::undoAvailable</a>() or <a href="qtextdocument.html#redoAvailable">QTextDocument::redoAvailable</a>().</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also </b><a href="qtextdocument.html#undoAvailable">QTextDocument::undoAvailable</a>() and <a href="qtextdocument.html#redoAvailable">QTextDocument::redoAvailable</a>().</p>
<!-- @@@clearUndoRedoStacks -->
<!-- $$$clone[overload1]$$$cloneQObject* -->
<h3 class="fn"><a name="clone"></a><span class="type">QTextDocument</span> * QTextDocument::<span class="name">clone</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 ) const</h3>
<p>Creates a new <a href="qtextdocument.html">QTextDocument</a> that is a copy of this text document. <i>parent</i> is the parent of the returned text document.</p>
<!-- @@@clone -->
<!-- $$$contentsChange[overload1]$$$contentsChangeintintint -->
<h3 class="fn"><a name="contentsChange"></a><span class="type">void</span> QTextDocument::<span class="name">contentsChange</span> ( <span class="type">int</span> <i>position</i>, <span class="type">int</span> <i>charsRemoved</i>, <span class="type">int</span> <i>charsAdded</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted whenever the document's content changes; for example, when text is inserted or deleted, or when formatting is applied.</p>
<p>Information is provided about the <i>position</i> of the character in the document where the change occurred, the number of characters removed (<i>charsRemoved</i>), and the number of characters added (<i>charsAdded</i>).</p>
<p>The signal is emitted before the document's layout manager is notified about the change. This hook allows you to implement syntax highlighting for the document.</p>
<p><b>See also </b><a href="qabstracttextdocumentlayout.html#documentChanged">QAbstractTextDocumentLayout::documentChanged</a>() and <a href="qtextdocument.html#contentsChanged">contentsChanged</a>().</p>
<!-- @@@contentsChange -->
<!-- $$$contentsChanged[overload1]$$$contentsChanged -->
<h3 class="fn"><a name="contentsChanged"></a><span class="type">void</span> QTextDocument::<span class="name">contentsChanged</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted whenever the document's content changes; for example, when text is inserted or deleted, or when formatting is applied.</p>
<p><b>See also </b><a href="qtextdocument.html#contentsChange">contentsChange</a>().</p>
<!-- @@@contentsChanged -->
<!-- $$$createObject[overload1]$$$createObjectconstQTextFormat& -->
<h3 class="fn"><a name="createObject"></a><span class="type"><a href="qtextobject.html">QTextObject</a></span> * QTextDocument::<span class="name">createObject</span> ( const <span class="type"><a href="qtextformat.html">QTextFormat</a></span> &amp; <i>format</i> )<tt> [virtual protected]</tt></h3>
<p>Creates and returns a new document object (a <a href="qtextobject.html">QTextObject</a>), based on the given <i>format</i>.</p>
<p>QTextObjects will always get created through this method, so you must reimplement it if you use custom text objects inside your document.</p>
<!-- @@@createObject -->
<!-- $$$cursorPositionChanged[overload1]$$$cursorPositionChangedconstQTextCursor& -->
<h3 class="fn"><a name="cursorPositionChanged"></a><span class="type">void</span> QTextDocument::<span class="name">cursorPositionChanged</span> ( const <span class="type"><a href="qtextcursor.html">QTextCursor</a></span> &amp; <i>cursor</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted whenever the position of a cursor changed due to an editing operation. The cursor that changed is passed in <i>cursor</i>. If you need a signal when the cursor is moved with the arrow keys you can use the <a href="qtextedit.html#cursorPositionChanged">cursorPositionChanged()</a> signal in <a href="qtextedit.html">QTextEdit</a>.</p>
<!-- @@@cursorPositionChanged -->
<!-- $$$defaultCursorMoveStyle[overload1]$$$defaultCursorMoveStyle -->
<h3 class="fn"><a name="defaultCursorMoveStyle"></a><span class="type"><a href="qt.html#CursorMoveStyle-enum">Qt::CursorMoveStyle</a></span> QTextDocument::<span class="name">defaultCursorMoveStyle</span> () const</h3>
<p>The default cursor movement style is used by all <a href="qtextcursor.html">QTextCursor</a> objects created from the document. The default is <a href="qt.html#CursorMoveStyle-enum">Qt::LogicalMoveStyle</a>.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qtextdocument.html#setDefaultCursorMoveStyle">setDefaultCursorMoveStyle</a>().</p>
<!-- @@@defaultCursorMoveStyle -->
<!-- $$$documentLayout[overload1]$$$documentLayout -->
<h3 class="fn"><a name="documentLayout"></a><span class="type"><a href="qabstracttextdocumentlayout.html">QAbstractTextDocumentLayout</a></span> * QTextDocument::<span class="name">documentLayout</span> () const</h3>
<p>Returns the document layout for this document.</p>
<p><b>See also </b><a href="qtextdocument.html#setDocumentLayout">setDocumentLayout</a>().</p>
<!-- @@@documentLayout -->
<!-- $$$documentLayoutChanged[overload1]$$$documentLayoutChanged -->
<h3 class="fn"><a name="documentLayoutChanged"></a><span class="type">void</span> QTextDocument::<span class="name">documentLayoutChanged</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted when a new document layout is set.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qtextdocument.html#setDocumentLayout">setDocumentLayout</a>().</p>
<!-- @@@documentLayoutChanged -->
<!-- $$$drawContents[overload1]$$$drawContentsQPainter*constQRectF& -->
<h3 class="fn"><a name="drawContents"></a><span class="type">void</span> QTextDocument::<span class="name">drawContents</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>p</i>, const <span class="type"><a href="qrectf.html">QRectF</a></span> &amp; <i>rect</i> = QRectF() )</h3>
<p>Draws the content of the document with painter <i>p</i>, clipped to <i>rect</i>. If <i>rect</i> is a null rectangle (default) then the document is painted unclipped.</p>
<p>This function was introduced in Qt 4.2.</p>
<!-- @@@drawContents -->
<!-- $$$end[overload1]$$$end -->
<h3 class="fn"><a name="end"></a><span class="type"><a href="qtextblock.html">QTextBlock</a></span> QTextDocument::<span class="name">end</span> () const</h3>
<p>This function returns a block to test for the end of the document while iterating over it.</p>
<pre class="cpp">     <span class="keyword">for</span> (<span class="type"><a href="qtextblock.html">QTextBlock</a></span> it <span class="operator">=</span> doc<span class="operator">-</span><span class="operator">&gt;</span>begin(); it <span class="operator">!</span><span class="operator">=</span> doc<span class="operator">-</span><span class="operator">&gt;</span>end(); it <span class="operator">=</span> it<span class="operator">.</span>next())
         cout <span class="operator">&lt;</span><span class="operator">&lt;</span> it<span class="operator">.</span>text()<span class="operator">.</span>toStdString() <span class="operator">&lt;</span><span class="operator">&lt;</span> endl;</pre>
<p>The block returned is invalid and represents the block after the last block in the document. You can use <a href="qtextdocument.html#lastBlock">lastBlock</a>() to retrieve the last valid block of the document.</p>
<p><b>See also </b><a href="qtextdocument.html#lastBlock">lastBlock</a>().</p>
<!-- @@@end -->
<!-- $$$find[overload1]$$$findconstQString&constQTextCursor&FindFlags -->
<h3 class="fn"><a name="find"></a><span class="type"><a href="qtextcursor.html">QTextCursor</a></span> QTextDocument::<span class="name">find</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>subString</i>, const <span class="type"><a href="qtextcursor.html">QTextCursor</a></span> &amp; <i>cursor</i>, <span class="type"><a href="qtextdocument.html#FindFlag-enum">FindFlags</a></span> <i>options</i> = 0 ) const</h3>
<p>Finds the next occurrence of the string, <i>subString</i>, in the document. The search starts at the position of the given <i>cursor</i>, and proceeds forwards through the document unless specified otherwise in the search options. The <i>options</i> control the type of search performed.</p>
<p>Returns a cursor with the match selected if <i>subString</i> was found; otherwise returns a null cursor.</p>
<p>If the given <i>cursor</i> has a selection, the search begins after the selection; otherwise it begins at the cursor's position.</p>
<p>By default the search is case-sensitive, and can match text anywhere in the document.</p>
<!-- @@@find -->
<!-- $$$find$$$findconstQRegExp&constQTextCursor&FindFlags -->
<h3 class="fn"><a name="find-2"></a><span class="type"><a href="qtextcursor.html">QTextCursor</a></span> QTextDocument::<span class="name">find</span> ( const <span class="type"><a href="qregexp.html">QRegExp</a></span> &amp; <i>expr</i>, const <span class="type"><a href="qtextcursor.html">QTextCursor</a></span> &amp; <i>cursor</i>, <span class="type"><a href="qtextdocument.html#FindFlag-enum">FindFlags</a></span> <i>options</i> = 0 ) const</h3>
<p>Finds the next occurrence, matching the regular expression, <i>expr</i>, in the document. The search starts at the position of the given <i>cursor</i>, and proceeds forwards through the document unless specified otherwise in the search options. The <i>options</i> control the type of search performed. The <a href="qtextdocument.html#FindFlag-enum">FindCaseSensitively</a> option is ignored for this overload, use QRegExp::caseSensitivity instead.</p>
<p>Returns a cursor with the match selected if a match was found; otherwise returns a null cursor.</p>
<p>If the given <i>cursor</i> has a selection, the search begins after the selection; otherwise it begins at the cursor's position.</p>
<p>By default the search is case-sensitive, and can match text anywhere in the document.</p>
<!-- @@@find -->
<!-- $$$find$$$findconstQString&intFindFlags -->
<h3 class="fn"><a name="find-3"></a><span class="type"><a href="qtextcursor.html">QTextCursor</a></span> QTextDocument::<span class="name">find</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>subString</i>, <span class="type">int</span> <i>position</i> = 0, <span class="type"><a href="qtextdocument.html#FindFlag-enum">FindFlags</a></span> <i>options</i> = 0 ) const</h3>
<p>This is an overloaded function.</p>
<p>Finds the next occurrence of the string, <i>subString</i>, in the document. The search starts at the given <i>position</i>, and proceeds forwards through the document unless specified otherwise in the search options. The <i>options</i> control the type of search performed.</p>
<p>Returns a cursor with the match selected if <i>subString</i> was found; otherwise returns a null cursor.</p>
<p>If the <i>position</i> is 0 (the default) the search begins from the beginning of the document; otherwise it begins at the specified position.</p>
<!-- @@@find -->
<!-- $$$find$$$findconstQRegExp&intFindFlags -->
<h3 class="fn"><a name="find-4"></a><span class="type"><a href="qtextcursor.html">QTextCursor</a></span> QTextDocument::<span class="name">find</span> ( const <span class="type"><a href="qregexp.html">QRegExp</a></span> &amp; <i>expr</i>, <span class="type">int</span> <i>position</i> = 0, <span class="type"><a href="qtextdocument.html#FindFlag-enum">FindFlags</a></span> <i>options</i> = 0 ) const</h3>
<p>This is an overloaded function.</p>
<p>Finds the next occurrence, matching the regular expression, <i>expr</i>, in the document. The search starts at the given <i>position</i>, and proceeds forwards through the document unless specified otherwise in the search options. The <i>options</i> control the type of search performed. The <a href="qtextdocument.html#FindFlag-enum">FindCaseSensitively</a> option is ignored for this overload, use QRegExp::caseSensitivity instead.</p>
<p>Returns a cursor with the match selected if a match was found; otherwise returns a null cursor.</p>
<p>If the <i>position</i> is 0 (the default) the search begins from the beginning of the document; otherwise it begins at the specified position.</p>
<!-- @@@find -->
<!-- $$$findBlock[overload1]$$$findBlockint -->
<h3 class="fn"><a name="findBlock"></a><span class="type"><a href="qtextblock.html">QTextBlock</a></span> QTextDocument::<span class="name">findBlock</span> ( <span class="type">int</span> <i>pos</i> ) const</h3>
<p>Returns the text block that contains the <i>pos</i>-th character.</p>
<!-- @@@findBlock -->
<!-- $$$findBlockByLineNumber[overload1]$$$findBlockByLineNumberint -->
<h3 class="fn"><a name="findBlockByLineNumber"></a><span class="type"><a href="qtextblock.html">QTextBlock</a></span> QTextDocument::<span class="name">findBlockByLineNumber</span> ( <span class="type">int</span> <i>lineNumber</i> ) const</h3>
<p>Returns the text block that contains the specified <i>lineNumber</i>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qtextblock.html#firstLineNumber">QTextBlock::firstLineNumber</a>().</p>
<!-- @@@findBlockByLineNumber -->
<!-- $$$findBlockByNumber[overload1]$$$findBlockByNumberint -->
<h3 class="fn"><a name="findBlockByNumber"></a><span class="type"><a href="qtextblock.html">QTextBlock</a></span> QTextDocument::<span class="name">findBlockByNumber</span> ( <span class="type">int</span> <i>blockNumber</i> ) const</h3>
<p>Returns the text block with the specified <i>blockNumber</i>.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qtextblock.html#blockNumber">QTextBlock::blockNumber</a>().</p>
<!-- @@@findBlockByNumber -->
<!-- $$$firstBlock[overload1]$$$firstBlock -->
<h3 class="fn"><a name="firstBlock"></a><span class="type"><a href="qtextblock.html">QTextBlock</a></span> QTextDocument::<span class="name">firstBlock</span> () const</h3>
<p>Returns the document's first text block.</p>
<p>This function was introduced in Qt 4.4.</p>
<!-- @@@firstBlock -->
<!-- $$$idealWidth[overload1]$$$idealWidth -->
<h3 class="fn"><a name="idealWidth"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QTextDocument::<span class="name">idealWidth</span> () const</h3>
<p>Returns the ideal width of the text document. The ideal width is the actually used width of the document without optional alignments taken into account. It is always &lt;= <a href="qtextdocument.html#size-prop">size</a>().width().</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qtextdocument.html#adjustSize">adjustSize</a>() and <a href="qtextdocument.html#textWidth-prop">textWidth</a>.</p>
<!-- @@@idealWidth -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn"><a name="isEmpty"></a><span class="type">bool</span> QTextDocument::<span class="name">isEmpty</span> () const</h3>
<p>Returns true if the document is empty; otherwise returns false.</p>
<!-- @@@isEmpty -->
<!-- $$$isRedoAvailable[overload1]$$$isRedoAvailable -->
<h3 class="fn"><a name="isRedoAvailable"></a><span class="type">bool</span> QTextDocument::<span class="name">isRedoAvailable</span> () const</h3>
<p>Returns true if redo is available; otherwise returns false.</p>
<p><b>See also </b><a href="qtextdocument.html#isUndoAvailable">isUndoAvailable</a>() and <a href="qtextdocument.html#availableRedoSteps">availableRedoSteps</a>().</p>
<!-- @@@isRedoAvailable -->
<!-- $$$isUndoAvailable[overload1]$$$isUndoAvailable -->
<h3 class="fn"><a name="isUndoAvailable"></a><span class="type">bool</span> QTextDocument::<span class="name">isUndoAvailable</span> () const</h3>
<p>Returns true if undo is available; otherwise returns false.</p>
<p><b>See also </b><a href="qtextdocument.html#isRedoAvailable">isRedoAvailable</a>() and <a href="qtextdocument.html#availableUndoSteps">availableUndoSteps</a>().</p>
<!-- @@@isUndoAvailable -->
<!-- $$$lastBlock[overload1]$$$lastBlock -->
<h3 class="fn"><a name="lastBlock"></a><span class="type"><a href="qtextblock.html">QTextBlock</a></span> QTextDocument::<span class="name">lastBlock</span> () const</h3>
<p>Returns the document's last (valid) text block.</p>
<p>This function was introduced in Qt 4.4.</p>
<!-- @@@lastBlock -->
<!-- $$$lineCount[overload1]$$$lineCount -->
<h3 class="fn"><a name="lineCount"></a><span class="type">int</span> QTextDocument::<span class="name">lineCount</span> () const</h3>
<p>Returns the number of lines of this document (if the layout supports this). Otherwise, this is identical to the number of blocks.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qtextdocument.html#blockCount-prop">blockCount</a>() and <a href="qtextdocument.html#characterCount">characterCount</a>().</p>
<!-- @@@lineCount -->
<!-- $$$loadResource[overload1]$$$loadResourceintconstQUrl& -->
<h3 class="fn"><a name="loadResource"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QTextDocument::<span class="name">loadResource</span> ( <span class="type">int</span> <i>type</i>, const <span class="type"><a href="qurl.html">QUrl</a></span> &amp; <i>name</i> )<tt> [virtual protected]</tt></h3>
<p>Loads data of the specified <i>type</i> from the resource with the given <i>name</i>.</p>
<p>This function is called by the rich text engine to request data that isn't directly stored by <a href="qtextdocument.html">QTextDocument</a>, but still associated with it. For example, images are referenced indirectly by the name attribute of a <a href="qtextimageformat.html">QTextImageFormat</a> object.</p>
<p>When called by Qt, <i>type</i> is one of the values of <a href="qtextdocument.html#ResourceType-enum">QTextDocument::ResourceType</a>.</p>
<p>If the <a href="qtextdocument.html">QTextDocument</a> is a child object of a <a href="qtextedit.html">QTextEdit</a>, <a href="qtextbrowser.html">QTextBrowser</a>, or a <a href="qtextdocument.html">QTextDocument</a> itself then the default implementation tries to retrieve the data from the parent.</p>
<!-- @@@loadResource -->
<!-- $$$markContentsDirty[overload1]$$$markContentsDirtyintint -->
<h3 class="fn"><a name="markContentsDirty"></a><span class="type">void</span> QTextDocument::<span class="name">markContentsDirty</span> ( <span class="type">int</span> <i>position</i>, <span class="type">int</span> <i>length</i> )</h3>
<p>Marks the contents specified by the given <i>position</i> and <i>length</i> as &quot;dirty&quot;, informing the document that it needs to be laid out again.</p>
<!-- @@@markContentsDirty -->
<!-- $$$metaInformation[overload1]$$$metaInformationMetaInformation -->
<h3 class="fn"><a name="metaInformation"></a><span class="type"><a href="qstring.html">QString</a></span> QTextDocument::<span class="name">metaInformation</span> ( <span class="type"><a href="qtextdocument.html#MetaInformation-enum">MetaInformation</a></span> <i>info</i> ) const</h3>
<p>Returns meta information about the document of the type specified by <i>info</i>.</p>
<p><b>See also </b><a href="qtextdocument.html#setMetaInformation">setMetaInformation</a>().</p>
<!-- @@@metaInformation -->
<!-- $$$modificationChanged[overload1]$$$modificationChangedbool -->
<h3 class="fn"><a name="modificationChanged"></a><span class="type">void</span> QTextDocument::<span class="name">modificationChanged</span> ( <span class="type">bool</span> <i>changed</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted whenever the content of the document changes in a way that affects the modification state. If <i>changed</i> is true, the document has been modified; otherwise it is false.</p>
<p>For example, calling setModified(false) on a document and then inserting text causes the signal to get emitted. If you undo that operation, causing the document to return to its original unmodified state, the signal will get emitted again.</p>
<!-- @@@modificationChanged -->
<!-- $$$object[overload1]$$$objectint -->
<h3 class="fn"><a name="object"></a><span class="type"><a href="qtextobject.html">QTextObject</a></span> * QTextDocument::<span class="name">object</span> ( <span class="type">int</span> <i>objectIndex</i> ) const</h3>
<p>Returns the text object associated with the given <i>objectIndex</i>.</p>
<!-- @@@object -->
<!-- $$$objectForFormat[overload1]$$$objectForFormatconstQTextFormat& -->
<h3 class="fn"><a name="objectForFormat"></a><span class="type"><a href="qtextobject.html">QTextObject</a></span> * QTextDocument::<span class="name">objectForFormat</span> ( const <span class="type"><a href="qtextformat.html">QTextFormat</a></span> &amp; <i>f</i> ) const</h3>
<p>Returns the text object associated with the format <i>f</i>.</p>
<!-- @@@objectForFormat -->
<!-- $$$pageCount[overload1]$$$pageCount -->
<h3 class="fn"><a name="pageCount"></a><span class="type">int</span> QTextDocument::<span class="name">pageCount</span> () const</h3>
<p>returns the number of pages in this document.</p>
<!-- @@@pageCount -->
<!-- $$$print[overload1]$$$printQPrinter* -->
<h3 class="fn"><a name="print"></a><span class="type">void</span> QTextDocument::<span class="name">print</span> ( <span class="type"><a href="qprinter.html">QPrinter</a></span> * <i>printer</i> ) const</h3>
<p>Prints the document to the given <i>printer</i>. The <a href="qprinter.html">QPrinter</a> must be set up before being used with this function.</p>
<p>This is only a convenience method to print the whole document to the printer.</p>
<p>If the document is already paginated through a specified height in the <a href="qtextdocument.html#pageSize-prop">pageSize</a>() property it is printed as-is.</p>
<p>If the document is not paginated, like for example a document used in a <a href="qtextedit.html">QTextEdit</a>, then a temporary copy of the document is created and the copy is broken into multiple pages according to the size of the <a href="qprinter.html">QPrinter</a>'s paperRect(). By default a 2 cm margin is set around the document contents. In addition the current page number is printed at the bottom of each page.</p>
<p>Note that <a href="qprinter.html#PrintRange-enum">QPrinter::Selection</a> is not supported as print range with this function since the selection is a property of <a href="qtextcursor.html">QTextCursor</a>. If you have a <a href="qtextedit.html">QTextEdit</a> associated with your <a href="qtextdocument.html">QTextDocument</a> then you can use <a href="qtextedit.html">QTextEdit</a>'s print() function because <a href="qtextedit.html">QTextEdit</a> has access to the user's selection.</p>
<p><b>See also </b><a href="qtextedit.html#print">QTextEdit::print</a>().</p>
<!-- @@@print -->
<!-- $$$redo[overload1]$$$redoQTextCursor* -->
<h3 class="fn"><a name="redo"></a><span class="type">void</span> QTextDocument::<span class="name">redo</span> ( <span class="type"><a href="qtextcursor.html">QTextCursor</a></span> * <i>cursor</i> )</h3>
<p>Redoes the last editing operation on the document if <a href="qtextdocument.html#isRedoAvailable">redo is available</a>.</p>
<p>The provided <i>cursor</i> is positioned at the end of the location where the edition operation was redone.</p>
<p>This function was introduced in Qt 4.2.</p>
<!-- @@@redo -->
<!-- $$$redo$$$redo -->
<h3 class="fn"><a name="redo-2"></a><span class="type">void</span> QTextDocument::<span class="name">redo</span> ()<tt> [slot]</tt></h3>
<p>This is an overloaded function.</p>
<p>Redoes the last editing operation on the document if <a href="qtextdocument.html#isRedoAvailable">redo is available</a>.</p>
<!-- @@@redo -->
<!-- $$$redoAvailable[overload1]$$$redoAvailablebool -->
<h3 class="fn"><a name="redoAvailable"></a><span class="type">void</span> QTextDocument::<span class="name">redoAvailable</span> ( <span class="type">bool</span> <i>available</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted whenever redo operations become available (<i>available</i> is true) or unavailable (<i>available</i> is false).</p>
<!-- @@@redoAvailable -->
<!-- $$$resource[overload1]$$$resourceintconstQUrl& -->
<h3 class="fn"><a name="resource"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QTextDocument::<span class="name">resource</span> ( <span class="type">int</span> <i>type</i>, const <span class="type"><a href="qurl.html">QUrl</a></span> &amp; <i>name</i> ) const</h3>
<p>Returns data of the specified <i>type</i> from the resource with the given <i>name</i>.</p>
<p>This function is called by the rich text engine to request data that isn't directly stored by <a href="qtextdocument.html">QTextDocument</a>, but still associated with it. For example, images are referenced indirectly by the name attribute of a <a href="qtextimageformat.html">QTextImageFormat</a> object.</p>
<p>Resources are cached internally in the document. If a resource can not be found in the cache, loadResource is called to try to load the resource. loadResource should then use addResource to add the resource to the cache.</p>
<p><b>See also </b><a href="qtextdocument.html#ResourceType-enum">QTextDocument::ResourceType</a>.</p>
<!-- @@@resource -->
<!-- $$$revision[overload1]$$$revision -->
<h3 class="fn"><a name="revision"></a><span class="type">int</span> QTextDocument::<span class="name">revision</span> () const</h3>
<p>Returns the document's revision (if undo is enabled).</p>
<p>The revision is guaranteed to increase when a document that is not modified is edited.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qtextblock.html#revision">QTextBlock::revision</a>() and <a href="qtextdocument.html#modified-prop">isModified</a>().</p>
<!-- @@@revision -->
<!-- $$$rootFrame[overload1]$$$rootFrame -->
<h3 class="fn"><a name="rootFrame"></a><span class="type"><a href="qtextframe.html">QTextFrame</a></span> * QTextDocument::<span class="name">rootFrame</span> () const</h3>
<p>Returns the document's root frame.</p>
<!-- @@@rootFrame -->
<!-- $$$setDefaultCursorMoveStyle[overload1]$$$setDefaultCursorMoveStyleQt::CursorMoveStyle -->
<h3 class="fn"><a name="setDefaultCursorMoveStyle"></a><span class="type">void</span> QTextDocument::<span class="name">setDefaultCursorMoveStyle</span> ( <span class="type"><a href="qt.html#CursorMoveStyle-enum">Qt::CursorMoveStyle</a></span> <i>style</i> )</h3>
<p>Sets the default cursor movement style to the given <i>style</i>.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qtextdocument.html#defaultCursorMoveStyle">defaultCursorMoveStyle</a>().</p>
<!-- @@@setDefaultCursorMoveStyle -->
<!-- $$$setDocumentLayout[overload1]$$$setDocumentLayoutQAbstractTextDocumentLayout* -->
<h3 class="fn"><a name="setDocumentLayout"></a><span class="type">void</span> QTextDocument::<span class="name">setDocumentLayout</span> ( <span class="type"><a href="qabstracttextdocumentlayout.html">QAbstractTextDocumentLayout</a></span> * <i>layout</i> )</h3>
<p>Sets the document to use the given <i>layout</i>. The previous layout is deleted.</p>
<p><b>See also </b><a href="qtextdocument.html#documentLayoutChanged">documentLayoutChanged</a>().</p>
<!-- @@@setDocumentLayout -->
<!-- $$$setHtml[overload1]$$$setHtmlconstQString& -->
<h3 class="fn"><a name="setHtml"></a><span class="type">void</span> QTextDocument::<span class="name">setHtml</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>html</i> )</h3>
<p>Replaces the entire contents of the document with the given HTML-formatted text in the <i>html</i> string.</p>
<p>The HTML formatting is respected as much as possible; for example, &quot;&lt;b&gt;bold&lt;/b&gt; text&quot; will produce text where the first word has a font weight that gives it a bold appearance: &quot;<b>bold</b> text&quot;.</p>
<p><b>Note:</b> It is the responsibility of the caller to make sure that the text is correctly decoded when a <a href="qstring.html">QString</a> containing HTML is created and passed to setHtml().</p>
<p><b>See also </b><a href="qtextdocument.html#setPlainText">setPlainText</a>() and <a href="richtext-html-subset.html">Supported HTML Subset</a>.</p>
<!-- @@@setHtml -->
<!-- $$$setMetaInformation[overload1]$$$setMetaInformationMetaInformationconstQString& -->
<h3 class="fn"><a name="setMetaInformation"></a><span class="type">void</span> QTextDocument::<span class="name">setMetaInformation</span> ( <span class="type"><a href="qtextdocument.html#MetaInformation-enum">MetaInformation</a></span> <i>info</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>string</i> )</h3>
<p>Sets the document's meta information of the type specified by <i>info</i> to the given <i>string</i>.</p>
<p><b>See also </b><a href="qtextdocument.html#metaInformation">metaInformation</a>().</p>
<!-- @@@setMetaInformation -->
<!-- $$$setPlainText[overload1]$$$setPlainTextconstQString& -->
<h3 class="fn"><a name="setPlainText"></a><span class="type">void</span> QTextDocument::<span class="name">setPlainText</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )</h3>
<p>Replaces the entire contents of the document with the given plain <i>text</i>.</p>
<p><b>See also </b><a href="qtextdocument.html#setHtml">setHtml</a>().</p>
<!-- @@@setPlainText -->
<!-- $$$toHtml[overload1]$$$toHtmlconstQByteArray& -->
<h3 class="fn"><a name="toHtml"></a><span class="type"><a href="qstring.html">QString</a></span> QTextDocument::<span class="name">toHtml</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>encoding</i> = QByteArray() ) const</h3>
<p>Returns a string containing an HTML representation of the document.</p>
<p>The <i>encoding</i> parameter specifies the value for the charset attribute in the html header. For example if 'utf-8' is specified then the beginning of the generated html will look like this:</p>
<pre class="cpp"> <span class="operator">&lt;</span>html<span class="operator">&gt;</span><span class="operator">&lt;</span>head<span class="operator">&gt;</span><span class="operator">&lt;</span>meta http<span class="operator">-</span>equiv<span class="operator">=</span><span class="string">&quot;Content-Type&quot;</span> content<span class="operator">=</span><span class="string">&quot;text/html; charset=utf-8&quot;</span><span class="operator">&gt;</span><span class="operator">&lt;</span><span class="operator">/</span>head<span class="operator">&gt;</span><span class="operator">&lt;</span>body<span class="operator">&gt;</span><span class="operator">.</span><span class="operator">.</span><span class="operator">.</span></pre>
<p>If no encoding is specified then no such meta information is generated.</p>
<p>If you later on convert the returned html string into a byte array for transmission over a network or when saving to disk you should specify the encoding you're going to use for the conversion to a byte array here.</p>
<p><b>See also </b><a href="richtext-html-subset.html">Supported HTML Subset</a>.</p>
<!-- @@@toHtml -->
<!-- $$$toPlainText[overload1]$$$toPlainText -->
<h3 class="fn"><a name="toPlainText"></a><span class="type"><a href="qstring.html">QString</a></span> QTextDocument::<span class="name">toPlainText</span> () const</h3>
<p>Returns the plain text contained in the document. If you want formatting information use a <a href="qtextcursor.html">QTextCursor</a> instead.</p>
<p><b>See also </b><a href="qtextdocument.html#toHtml">toHtml</a>().</p>
<!-- @@@toPlainText -->
<!-- $$$undo[overload1]$$$undoQTextCursor* -->
<h3 class="fn"><a name="undo"></a><span class="type">void</span> QTextDocument::<span class="name">undo</span> ( <span class="type"><a href="qtextcursor.html">QTextCursor</a></span> * <i>cursor</i> )</h3>
<p>Undoes the last editing operation on the document if undo is available. The provided <i>cursor</i> is positioned at the end of the location where the edition operation was undone.</p>
<p>See the <a href="qundo.html">Qt Undo Framework</a> documentation for details.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qtextdocument.html#undoAvailable">undoAvailable</a>() and <a href="qtextdocument.html#undoRedoEnabled-prop">isUndoRedoEnabled</a>().</p>
<!-- @@@undo -->
<!-- $$$undo$$$undo -->
<h3 class="fn"><a name="undo-2"></a><span class="type">void</span> QTextDocument::<span class="name">undo</span> ()<tt> [slot]</tt></h3>
<p>This is an overloaded function.</p>
<!-- @@@undo -->
<!-- $$$undoAvailable[overload1]$$$undoAvailablebool -->
<h3 class="fn"><a name="undoAvailable"></a><span class="type">void</span> QTextDocument::<span class="name">undoAvailable</span> ( <span class="type">bool</span> <i>available</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted whenever undo operations become available (<i>available</i> is true) or unavailable (<i>available</i> is false).</p>
<p>See the <a href="qundo.html">Qt Undo Framework</a> documentation for details.</p>
<p><b>See also </b><a href="qtextdocument.html#undo">undo</a>() and <a href="qtextdocument.html#undoRedoEnabled-prop">isUndoRedoEnabled</a>().</p>
<!-- @@@undoAvailable -->
<!-- $$$undoCommandAdded[overload1]$$$undoCommandAdded -->
<h3 class="fn"><a name="undoCommandAdded"></a><span class="type">void</span> QTextDocument::<span class="name">undoCommandAdded</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted every time a new level of undo is added to the <a href="qtextdocument.html">QTextDocument</a>.</p>
<p>This function was introduced in Qt 4.4.</p>
<!-- @@@undoCommandAdded -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Qt and respective logos are trademarks of The Qt Company Ltd 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>