Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 4160

qtbase5-doc-5.12.6-2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qtextedit.cpp -->
  <title>QTextEdit Class | Qt Widgets 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QTextEdit</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtwidgets-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<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="#reimplemented-public-functions">Reimplemented 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="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#introduction-and-concepts">Introduction and Concepts</a></li>
<li class="level2"><a href="#using-qtextedit-as-a-display-widget">Using QTextEdit as a Display Widget</a></li>
<li class="level2"><a href="#using-qtextedit-as-an-editor">Using QTextEdit as an Editor</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QTextEdit Class</h1>
<!-- $$$QTextEdit-brief -->
<p>The <a href="qtextedit.html">QTextEdit</a> class provides a widget that is used to edit and display both plain and rich text. <a href="#details">More...</a></p>
<!-- @@@QTextEdit -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QTextEdit&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qabstractscrollarea.html">QAbstractScrollArea</a></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qtextbrowser.html">QTextBrowser</a></p>
</td></tr></table></div><ul>
<li><a href="qtextedit-members.html">List of all members, including inherited members</a></li>
<li><a href="qtextedit-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> class </td><td class="memItemRight bottomAlign"><b><a href="qtextedit-extraselection.html">ExtraSelection</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#AutoFormattingFlag-enum">AutoFormatting</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#AutoFormattingFlag-enum">AutoFormattingFlag</a></b> { AutoNone, AutoBulletList, AutoAll }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#LineWrapMode-enum">LineWrapMode</a></b> { NoWrap, WidgetWidth, FixedPixelWidth, FixedColumnWidth }</td></tr>
</table></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<div class="table"><table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qtextedit.html#acceptRichText-prop">acceptRichText</a></b> : bool</li>
<li class="fn"><b><a href="qtextedit.html#autoFormatting-prop">autoFormatting</a></b> : AutoFormatting</li>
<li class="fn"><b><a href="qtextedit.html#cursorWidth-prop">cursorWidth</a></b> : int</li>
<li class="fn"><b><a href="qtextedit.html#document-prop">document</a></b> : QTextDocument*</li>
<li class="fn"><b><a href="qtextedit.html#documentTitle-prop">documentTitle</a></b> : QString</li>
<li class="fn"><b><a href="qtextedit.html#html-prop">html</a></b> : QString</li>
<li class="fn"><b><a href="qtextedit.html#lineWrapColumnOrWidth-prop">lineWrapColumnOrWidth</a></b> : int</li>
<li class="fn"><b><a href="qtextedit.html#lineWrapMode-prop">lineWrapMode</a></b> : LineWrapMode</li>
<li class="fn"><b><a href="qtextedit.html#overwriteMode-prop">overwriteMode</a></b> : bool</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qtextedit.html#placeholderText-prop">placeholderText</a></b> : QString</li>
<li class="fn"><b><a href="qtextedit.html#plainText-prop">plainText</a></b> : QString</li>
<li class="fn"><b><a href="qtextedit.html#readOnly-prop">readOnly</a></b> : bool</li>
<li class="fn"><b><a href="qtextedit.html#tabChangesFocus-prop">tabChangesFocus</a></b> : bool</li>
<li class="fn"><b><a href="qtextedit.html#tabStopDistance-prop">tabStopDistance</a></b> : qreal</li>
<li class="fn"><b><a href="qtextedit.html#textInteractionFlags-prop">textInteractionFlags</a></b> : Qt::TextInteractionFlags</li>
<li class="fn"><b><a href="qtextedit.html#undoRedoEnabled-prop">undoRedoEnabled</a></b> : bool</li>
<li class="fn"><b><a href="qtextedit.html#wordWrapMode-prop">wordWrapMode</a></b> : QTextOption::WrapMode</li>
</ul>
</td></tr>
</table></div>
<ul>
<li class="fn">3 properties inherited from <a href="qabstractscrollarea.html#properties">QAbstractScrollArea</a></li>
<li class="fn">6 properties inherited from <a href="qframe.html#properties">QFrame</a></li>
<li class="fn">59 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#QTextEdit">QTextEdit</a></b>(QWidget *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#QTextEdit-1">QTextEdit</a></b>(const QString &amp;<i>text</i>, QWidget *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#dtor.QTextEdit">~QTextEdit</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#acceptRichText-prop">acceptRichText</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::Alignment </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#alignment">alignment</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#anchorAt">anchorAt</a></b>(const QPoint &amp;<i>pos</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextEdit::AutoFormatting </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#autoFormatting-prop">autoFormatting</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#canPaste">canPaste</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMenu *</td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#createStandardContextMenu">createStandardContextMenu</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMenu *</td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#createStandardContextMenu-1">createStandardContextMenu</a></b>(const QPoint &amp;<i>position</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextCharFormat </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#currentCharFormat">currentCharFormat</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#currentFont">currentFont</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextCursor </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#cursorForPosition">cursorForPosition</a></b>(const QPoint &amp;<i>pos</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#cursorRect">cursorRect</a></b>(const QTextCursor &amp;<i>cursor</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#cursorRect-1">cursorRect</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#cursorWidth-prop">cursorWidth</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextDocument *</td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#document-prop">document</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#documentTitle-prop">documentTitle</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#ensureCursorVisible">ensureCursorVisible</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QTextEdit::ExtraSelection&gt; </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#extraSelections">extraSelections</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#find">find</a></b>(const QString &amp;<i>exp</i>, QTextDocument::FindFlags <i>options</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#find-1">find</a></b>(const QRegExp &amp;<i>exp</i>, QTextDocument::FindFlags <i>options</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#fontFamily">fontFamily</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#fontItalic">fontItalic</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#fontPointSize">fontPointSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#fontUnderline">fontUnderline</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#fontWeight">fontWeight</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#readOnly-prop">isReadOnly</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#undoRedoEnabled-prop">isUndoRedoEnabled</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#lineWrapColumnOrWidth-prop">lineWrapColumnOrWidth</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextEdit::LineWrapMode </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#lineWrapMode-prop">lineWrapMode</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#loadResource">loadResource</a></b>(int <i>type</i>, const QUrl &amp;<i>name</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#mergeCurrentCharFormat">mergeCurrentCharFormat</a></b>(const QTextCharFormat &amp;<i>modifier</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#moveCursor">moveCursor</a></b>(QTextCursor::MoveOperation <i>operation</i>, QTextCursor::MoveMode <i>mode</i> = QTextCursor::MoveAnchor)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#overwriteMode-prop">overwriteMode</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#placeholderText-prop">placeholderText</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#print">print</a></b>(QPagedPaintDevice *<i>printer</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#acceptRichText-prop">setAcceptRichText</a></b>(bool <i>accept</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#autoFormatting-prop">setAutoFormatting</a></b>(QTextEdit::AutoFormatting <i>features</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setCurrentCharFormat">setCurrentCharFormat</a></b>(const QTextCharFormat &amp;<i>format</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#cursorWidth-prop">setCursorWidth</a></b>(int <i>width</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#document-prop">setDocument</a></b>(QTextDocument *<i>document</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#documentTitle-prop">setDocumentTitle</a></b>(const QString &amp;<i>title</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setExtraSelections">setExtraSelections</a></b>(const QList&lt;QTextEdit::ExtraSelection&gt; &amp;<i>selections</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#lineWrapColumnOrWidth-prop">setLineWrapColumnOrWidth</a></b>(int <i>w</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#lineWrapMode-prop">setLineWrapMode</a></b>(QTextEdit::LineWrapMode <i>mode</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#overwriteMode-prop">setOverwriteMode</a></b>(bool <i>overwrite</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#placeholderText-prop">setPlaceholderText</a></b>(const QString &amp;<i>placeholderText</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#readOnly-prop">setReadOnly</a></b>(bool <i>ro</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#tabChangesFocus-prop">setTabChangesFocus</a></b>(bool <i>b</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#tabStopDistance-prop">setTabStopDistance</a></b>(qreal <i>distance</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setTextCursor">setTextCursor</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="qtextedit.html#textInteractionFlags-prop">setTextInteractionFlags</a></b>(Qt::TextInteractionFlags <i>flags</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.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="qtextedit.html#wordWrapMode-prop">setWordWrapMode</a></b>(QTextOption::WrapMode <i>policy</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#tabChangesFocus-prop">tabChangesFocus</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#tabStopDistance-prop">tabStopDistance</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#textBackgroundColor">textBackgroundColor</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#textColor">textColor</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextCursor </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#textCursor">textCursor</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::TextInteractionFlags </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#textInteractionFlags-prop">textInteractionFlags</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#html-prop">toHtml</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#toPlainText">toPlainText</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextOption::WrapMode </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#wordWrapMode-prop">wordWrapMode</a></b>() const</td></tr>
</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#inputMethodQuery">inputMethodQuery</a></b>(Qt::InputMethodQuery <i>property</i>) const override</td></tr>
</table></div>
<ul>
<li class="fn">20 public functions inherited from <a href="qabstractscrollarea.html#public-functions">QAbstractScrollArea</a></li>
<li class="fn">14 public functions inherited from <a href="qframe.html#public-functions">QFrame</a></li>
<li class="fn">214 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">31 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
<li class="fn">14 public functions inherited from <a href="../qtgui/qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#append">append</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="qtextedit.html#clear">clear</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#copy">copy</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#cut">cut</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#insertHtml">insertHtml</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="qtextedit.html#insertPlainText">insertPlainText</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="qtextedit.html#paste">paste</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#redo">redo</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#scrollToAnchor">scrollToAnchor</a></b>(const QString &amp;<i>name</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#selectAll">selectAll</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setAlignment">setAlignment</a></b>(Qt::Alignment <i>a</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setCurrentFont">setCurrentFont</a></b>(const QFont &amp;<i>f</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setFontFamily">setFontFamily</a></b>(const QString &amp;<i>fontFamily</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setFontItalic">setFontItalic</a></b>(bool <i>italic</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setFontPointSize">setFontPointSize</a></b>(qreal <i>s</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setFontUnderline">setFontUnderline</a></b>(bool <i>underline</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setFontWeight">setFontWeight</a></b>(int <i>weight</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#html-prop">setHtml</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="qtextedit.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="qtextedit.html#setText">setText</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="qtextedit.html#setTextBackgroundColor">setTextBackgroundColor</a></b>(const QColor &amp;<i>c</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setTextColor">setTextColor</a></b>(const QColor &amp;<i>c</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#undo">undo</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#zoomIn">zoomIn</a></b>(int <i>range</i> = 1)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#zoomOut">zoomOut</a></b>(int <i>range</i> = 1)</td></tr>
</table></div>
<ul>
<li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#copyAvailable">copyAvailable</a></b>(bool <i>yes</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#currentCharFormatChanged">currentCharFormatChanged</a></b>(const QTextCharFormat &amp;<i>f</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#cursorPositionChanged">cursorPositionChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.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="qtextedit.html#selectionChanged">selectionChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#textChanged">textChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#undoAvailable">undoAvailable</a></b>(bool <i>available</i>)</td></tr>
</table></div>
<ul>
<li class="fn">3 signals inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
</table></div>
<ul>
<li class="fn">5 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">9 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2 id="protected-functions">Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#canInsertFromMimeData">canInsertFromMimeData</a></b>(const QMimeData *<i>source</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QMimeData *</td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#createMimeDataFromSelection">createMimeDataFromSelection</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#insertFromMimeData">insertFromMimeData</a></b>(const QMimeData *<i>source</i>)</td></tr>
</table></div>
<a name="reimplemented-protected-functions"></a>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#changeEvent">changeEvent</a></b>(QEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#contextMenuEvent">contextMenuEvent</a></b>(QContextMenuEvent *<i>event</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#dragEnterEvent">dragEnterEvent</a></b>(QDragEnterEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#dragLeaveEvent">dragLeaveEvent</a></b>(QDragLeaveEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#dragMoveEvent">dragMoveEvent</a></b>(QDragMoveEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#dropEvent">dropEvent</a></b>(QDropEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#focusInEvent">focusInEvent</a></b>(QFocusEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#focusNextPrevChild">focusNextPrevChild</a></b>(bool <i>next</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#focusOutEvent">focusOutEvent</a></b>(QFocusEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#inputMethodEvent">inputMethodEvent</a></b>(QInputMethodEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#keyPressEvent">keyPressEvent</a></b>(QKeyEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#keyReleaseEvent">keyReleaseEvent</a></b>(QKeyEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a></b>(QMouseEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#mouseMoveEvent">mouseMoveEvent</a></b>(QMouseEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#mousePressEvent">mousePressEvent</a></b>(QMouseEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#mouseReleaseEvent">mouseReleaseEvent</a></b>(QMouseEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#paintEvent">paintEvent</a></b>(QPaintEvent *<i>event</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#resizeEvent">resizeEvent</a></b>(QResizeEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#scrollContentsBy">scrollContentsBy</a></b>(int <i>dx</i>, int <i>dy</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#showEvent">showEvent</a></b>(<i>QShowEvent *</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#wheelEvent">wheelEvent</a></b>(QWheelEvent *<i>e</i>) override</td></tr>
</table></div>
<ul>
<li class="fn">20 protected functions inherited from <a href="qabstractscrollarea.html#protected-functions">QAbstractScrollArea</a></li>
<li class="fn">4 protected functions inherited from <a href="qframe.html#protected-functions">QFrame</a></li>
<li class="fn">35 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="../qtgui/qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<!-- $$$QTextEdit-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qtextedit.html">QTextEdit</a> class provides a widget that is used to edit and display both plain and rich text.</p>
<a name="introduction-and-concepts"></a>
<h3 id="introduction-and-concepts">Introduction and Concepts</h3>
<p><a href="qtextedit.html">QTextEdit</a> is an advanced WYSIWYG viewer/editor supporting rich text formatting using HTML-style tags. It is optimized to handle large documents and to respond quickly to user input.</p>
<p><a href="qtextedit.html">QTextEdit</a> works on paragraphs and characters. A paragraph is a formatted string which is word-wrapped to fit into the width of the widget. By default when reading plain text, one newline signifies a paragraph. A document consists of zero or more paragraphs. The words in the paragraph are aligned in accordance with the paragraph's alignment. Paragraphs are separated by hard line breaks. Each character within a paragraph has its own attributes, for example, font and color.</p>
<p><a href="qtextedit.html">QTextEdit</a> can display images, lists and tables. If the text is too large to view within the text edit's viewport, scroll bars will appear. The text edit can load both plain text and rich text files. Rich text is described using a subset of HTML 4 markup, refer to the <a href="../qtgui/richtext-html-subset.html">Supported HTML Subset</a> page for more information.</p>
<p>If you just need to display a small piece of rich text use <a href="qlabel.html">QLabel</a>.</p>
<p>The rich text support in Qt is designed to provide a fast, portable and efficient way to add reasonable online help facilities to applications, and to provide a basis for rich text editors. If you find the HTML support insufficient for your needs you may consider the use of Qt WebKit, which provides a full-featured web browser widget.</p>
<p>The shape of the mouse cursor on a <a href="qtextedit.html">QTextEdit</a> is <a href="../qtcore/qt.html#CursorShape-enum">Qt::IBeamCursor</a> by default. It can be changed through the <a href="qabstractscrollarea.html#viewport">viewport</a>()'s cursor property.</p>
<a name="using-qtextedit-as-a-display-widget"></a>
<h3 id="using-qtextedit-as-a-display-widget">Using QTextEdit as a Display Widget</h3>
<p><a href="qtextedit.html">QTextEdit</a> can display a large HTML subset, including tables and images.</p>
<p>The text is set or replaced using <a href="qtextedit.html#html-prop">setHtml</a>() which deletes any existing text and replaces it with the text passed in the <a href="qtextedit.html#html-prop">setHtml</a>() call. If you call <a href="qtextedit.html#html-prop">setHtml</a>() with legacy HTML, and then call <a href="qtextedit.html#html-prop">toHtml</a>(), the text that is returned may have different markup, but will render the same. The entire text can be deleted with <a href="qtextedit.html#clear">clear</a>().</p>
<p>Text itself can be inserted using the <a href="../qtgui/qtextcursor.html">QTextCursor</a> class or using the convenience functions <a href="qtextedit.html#insertHtml">insertHtml</a>(), <a href="qtextedit.html#insertPlainText">insertPlainText</a>(), <a href="qtextedit.html#append">append</a>() or <a href="qtextedit.html#paste">paste</a>(). <a href="../qtgui/qtextcursor.html">QTextCursor</a> is also able to insert complex objects like tables or lists into the document, and it deals with creating selections and applying changes to selected text.</p>
<p>By default the text edit wraps words at whitespace to fit within the text edit widget. The <a href="qtextedit.html#lineWrapMode-prop">setLineWrapMode</a>() function is used to specify the kind of line wrap you want, or <a href="qtextedit.html#LineWrapMode-enum">NoWrap</a> if you don't want any wrapping. Call <a href="qtextedit.html#lineWrapMode-prop">setLineWrapMode</a>() to set a fixed pixel width <a href="qtextedit.html#LineWrapMode-enum">FixedPixelWidth</a>, or character column (e.g&#x2e; 80 column) <a href="qtextedit.html#LineWrapMode-enum">FixedColumnWidth</a> with the pixels or columns specified with <a href="qtextedit.html#lineWrapColumnOrWidth-prop">setLineWrapColumnOrWidth</a>(). If you use word wrap to the widget's width <a href="qtextedit.html#LineWrapMode-enum">WidgetWidth</a>, you can specify whether to break on whitespace or anywhere with <a href="qtextedit.html#wordWrapMode-prop">setWordWrapMode</a>().</p>
<p>The <a href="qtextedit.html#find">find</a>() function can be used to find and select a given string within the text.</p>
<p>If you want to limit the total number of paragraphs in a <a href="qtextedit.html">QTextEdit</a>, as for example it is often useful in a log viewer, then you can use <a href="../qtgui/qtextdocument.html">QTextDocument</a>'s maximumBlockCount property for that.</p>
<a name="read-only-key-bindings"></a>
<h4 id="read-only-key-bindings">Read-only Key Bindings</h4>
<p>When <a href="qtextedit.html">QTextEdit</a> is used read-only the key bindings are limited to navigation, and text may only be selected with the mouse:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >Keypresses</th><th >Action</th></tr></thead>
<tr valign="top" class="odd"><td >Up</td><td >Moves one line up.</td></tr>
<tr valign="top" class="even"><td >Down</td><td >Moves one line down.</td></tr>
<tr valign="top" class="odd"><td >Left</td><td >Moves one character to the left.</td></tr>
<tr valign="top" class="even"><td >Right</td><td >Moves one character to the right.</td></tr>
<tr valign="top" class="odd"><td >PageUp</td><td >Moves one (viewport) page up.</td></tr>
<tr valign="top" class="even"><td >PageDown</td><td >Moves one (viewport) page down.</td></tr>
<tr valign="top" class="odd"><td >Home</td><td >Moves to the beginning of the text.</td></tr>
<tr valign="top" class="even"><td >End</td><td >Moves to the end of the text.</td></tr>
<tr valign="top" class="odd"><td >Alt+Wheel</td><td >Scrolls the page horizontally (the Wheel is the mouse wheel).</td></tr>
<tr valign="top" class="even"><td >Ctrl+Wheel</td><td >Zooms the text.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+A</td><td >Selects all text.</td></tr>
</table></div>
<p>The text edit may be able to provide some meta-information. For example, the <a href="qtextedit.html#documentTitle-prop">documentTitle</a>() function will return the text from within HTML <code>&lt;title&gt;</code> tags.</p>
<p><b>Note: </b>Zooming into HTML documents only works if the font-size is not set to a fixed size.</p><a name="using-qtextedit-as-an-editor"></a>
<h3 id="using-qtextedit-as-an-editor">Using QTextEdit as an Editor</h3>
<p>All the information about using <a href="qtextedit.html">QTextEdit</a> as a display widget also applies here.</p>
<p>The current char format's attributes are set with <a href="qtextedit.html#setFontItalic">setFontItalic</a>(), <a href="qtextedit.html#setFontWeight">setFontWeight</a>(), <a href="qtextedit.html#setFontUnderline">setFontUnderline</a>(), <a href="qtextedit.html#setFontFamily">setFontFamily</a>(), <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>(), <a href="qtextedit.html#setTextColor">setTextColor</a>() and <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(). The current paragraph's alignment is set with <a href="qtextedit.html#setAlignment">setAlignment</a>().</p>
<p>Selection of text is handled by the <a href="../qtgui/qtextcursor.html">QTextCursor</a> class, which provides functionality for creating selections, retrieving the text contents or deleting selections. You can retrieve the object that corresponds with the user-visible cursor using the <a href="qtextedit.html#textCursor">textCursor</a>() method. If you want to set a selection in <a href="qtextedit.html">QTextEdit</a> just create one on a <a href="../qtgui/qtextcursor.html">QTextCursor</a> object and then make that cursor the visible cursor using <a href="qtextedit.html#setTextCursor">setTextCursor</a>(). The selection can be copied to the clipboard with <a href="qtextedit.html#copy">copy</a>(), or cut to the clipboard with <a href="qtextedit.html#cut">cut</a>(). The entire text can be selected using <a href="qtextedit.html#selectAll">selectAll</a>().</p>
<p>When the cursor is moved and the underlying formatting attributes change, the <a href="qtextedit.html#currentCharFormatChanged">currentCharFormatChanged</a>() signal is emitted to reflect the new attributes at the new cursor position.</p>
<p>The <a href="qtextedit.html#textChanged">textChanged</a>() signal is emitted whenever the text changes (as a result of <a href="qtextedit.html#setText">setText</a>() or through the editor itself).</p>
<p><a href="qtextedit.html">QTextEdit</a> holds a <a href="../qtgui/qtextdocument.html">QTextDocument</a> object which can be retrieved using the <a href="qtextedit.html#document-prop">document</a>() method. You can also set your own document object using <a href="qtextedit.html#document-prop">setDocument</a>().</p>
<p><a href="../qtgui/qtextdocument.html">QTextDocument</a> provides an <a href="../qtgui/qtextdocument.html#modified-prop">isModified()</a> function which will return true if the text has been modified since it was either loaded or since the last call to setModified with false as argument. In addition it provides methods for undo and redo.</p>
<a name="drag-and-drop"></a>
<h4 id="drag-and-drop">Drag and Drop</h4>
<p><a href="qtextedit.html">QTextEdit</a> also supports custom drag and drop behavior. By default, <a href="qtextedit.html">QTextEdit</a> will insert plain text, HTML and rich text when the user drops data of these MIME types onto a document. Reimplement <a href="qtextedit.html#canInsertFromMimeData">canInsertFromMimeData</a>() and <a href="qtextedit.html#insertFromMimeData">insertFromMimeData</a>() to add support for additional MIME types.</p>
<p>For example, to allow the user to drag and drop an image onto a <a href="qtextedit.html">QTextEdit</a>, you could the implement these functions in the following way:</p>
<pre class="cpp">

  bool TextEdit<span class="operator">::</span>canInsertFromMimeData( <span class="keyword">const</span> <span class="type"><a href="../qtcore/qmimedata.html">QMimeData</a></span> <span class="operator">*</span>source ) <span class="keyword">const</span>
  {
      <span class="keyword">if</span> (source<span class="operator">-</span><span class="operator">&gt;</span>hasImage())
          <span class="keyword">return</span> <span class="keyword">true</span>;
      <span class="keyword">else</span>
          <span class="keyword">return</span> <span class="type"><a href="qtextedit.html#QTextEdit">QTextEdit</a></span><span class="operator">::</span>canInsertFromMimeData(source);
  }

</pre>
<p>We add support for image MIME types by returning true. For all other MIME types, we use the default implementation.</p>
<pre class="cpp">

  <span class="type">void</span> TextEdit<span class="operator">::</span>insertFromMimeData( <span class="keyword">const</span> <span class="type"><a href="../qtcore/qmimedata.html">QMimeData</a></span> <span class="operator">*</span>source )
  {
      <span class="keyword">if</span> (source<span class="operator">-</span><span class="operator">&gt;</span>hasImage())
      {
          <span class="type"><a href="../qtgui/qimage.html">QImage</a></span> image <span class="operator">=</span> qvariant_cast<span class="operator">&lt;</span><span class="type"><a href="../qtgui/qimage.html">QImage</a></span><span class="operator">&gt;</span>(source<span class="operator">-</span><span class="operator">&gt;</span>imageData());
          <span class="type"><a href="../qtgui/qtextcursor.html">QTextCursor</a></span> cursor <span class="operator">=</span> <span class="keyword">this</span><span class="operator">-</span><span class="operator">&gt;</span>textCursor();
          <span class="type"><a href="../qtgui/qtextdocument.html">QTextDocument</a></span> <span class="operator">*</span>document <span class="operator">=</span> <span class="keyword">this</span><span class="operator">-</span><span class="operator">&gt;</span>document();
          document<span class="operator">-</span><span class="operator">&gt;</span>addResource(<span class="type"><a href="../qtgui/qtextdocument.html">QTextDocument</a></span><span class="operator">::</span>ImageResource<span class="operator">,</span> <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span>(<span class="string">&quot;image&quot;</span>)<span class="operator">,</span> image);
          cursor<span class="operator">.</span>insertImage(<span class="string">&quot;image&quot;</span>);
      }
  }

</pre>
<p>We unpack the image from the <a href="../qtcore/qvariant.html">QVariant</a> held by the MIME source and insert it into the document as a resource.</p>
<a name="editing-key-bindings"></a>
<h4 id="editing-key-bindings">Editing Key Bindings</h4>
<p>The list of key bindings which are implemented for editing:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >Keypresses</th><th >Action</th></tr></thead>
<tr valign="top" class="odd"><td >Backspace</td><td >Deletes the character to the left of the cursor.</td></tr>
<tr valign="top" class="even"><td >Delete</td><td >Deletes the character to the right of the cursor.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+C</td><td >Copy the selected text to the clipboard.</td></tr>
<tr valign="top" class="even"><td >Ctrl+Insert</td><td >Copy the selected text to the clipboard.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+K</td><td >Deletes to the end of the line.</td></tr>
<tr valign="top" class="even"><td >Ctrl+V</td><td >Pastes the clipboard text into text edit.</td></tr>
<tr valign="top" class="odd"><td >Shift+Insert</td><td >Pastes the clipboard text into text edit.</td></tr>
<tr valign="top" class="even"><td >Ctrl+X</td><td >Deletes the selected text and copies it to the clipboard.</td></tr>
<tr valign="top" class="odd"><td >Shift+Delete</td><td >Deletes the selected text and copies it to the clipboard.</td></tr>
<tr valign="top" class="even"><td >Ctrl+Z</td><td >Undoes the last operation.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+Y</td><td >Redoes the last operation.</td></tr>
<tr valign="top" class="even"><td >Left</td><td >Moves the cursor one character to the left.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+Left</td><td >Moves the cursor one word to the left.</td></tr>
<tr valign="top" class="even"><td >Right</td><td >Moves the cursor one character to the right.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+Right</td><td >Moves the cursor one word to the right.</td></tr>
<tr valign="top" class="even"><td >Up</td><td >Moves the cursor one line up.</td></tr>
<tr valign="top" class="odd"><td >Down</td><td >Moves the cursor one line down.</td></tr>
<tr valign="top" class="even"><td >PageUp</td><td >Moves the cursor one page up.</td></tr>
<tr valign="top" class="odd"><td >PageDown</td><td >Moves the cursor one page down.</td></tr>
<tr valign="top" class="even"><td >Home</td><td >Moves the cursor to the beginning of the line.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+Home</td><td >Moves the cursor to the beginning of the text.</td></tr>
<tr valign="top" class="even"><td >End</td><td >Moves the cursor to the end of the line.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+End</td><td >Moves the cursor to the end of the text.</td></tr>
<tr valign="top" class="even"><td >Alt+Wheel</td><td >Scrolls the page horizontally (the Wheel is the mouse wheel).</td></tr>
</table></div>
<p>To select (mark) text hold down the Shift key whilst pressing one of the movement keystrokes, for example, <i>Shift+Right</i> will select the character to the right, and <i>Shift+Ctrl+Right</i> will select the word to the right, etc.</p>
</div>
<p><b>See also </b><a href="../qtgui/qtextdocument.html">QTextDocument</a>, <a href="../qtgui/qtextcursor.html">QTextCursor</a>, <a href="qtwidgets-mainwindows-application-example.html">Application Example</a>, <a href="qtwidgets-richtext-syntaxhighlighter-example.html">Syntax Highlighter Example</a>, and <a href="../qtgui/richtext.html">Rich Text Processing</a>.</p>
<!-- @@@QTextEdit -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$AutoFormattingFlag$$$AutoNone$$$AutoBulletList$$$AutoAll -->
<h3 class="flags" id="AutoFormattingFlag-enum"><a name="AutoFormattingFlag-enum"></a>enum QTextEdit::<span class="name">AutoFormattingFlag</span><br/>flags QTextEdit::<span class="name">AutoFormatting</span></h3>
<div class="table"><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"><code>QTextEdit::AutoNone</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Don't do any automatic formatting.</td></tr>
<tr><td class="topAlign"><code>QTextEdit::AutoBulletList</code></td><td class="topAlign tblval"><code>0x00000001</code></td><td class="topAlign">Automatically create bullet lists (e.g&#x2e; when the user enters an asterisk ('*') in the left most column, or presses Enter in an existing list item.</td></tr>
<tr><td class="topAlign"><code>QTextEdit::AutoAll</code></td><td class="topAlign tblval"><code>0xffffffff</code></td><td class="topAlign">Apply all automatic formatting. Currently only automatic bullet lists are supported.</td></tr>
</table></div>
<p>The AutoFormatting type is a typedef for <a href="../qtcore/qflags.html">QFlags</a>&lt;AutoFormattingFlag&gt;. It stores an OR combination of AutoFormattingFlag values.</p>
<!-- @@@AutoFormattingFlag -->
<!-- $$$LineWrapMode$$$NoWrap$$$WidgetWidth$$$FixedPixelWidth$$$FixedColumnWidth -->
<h3 class="fn" id="LineWrapMode-enum"><a name="LineWrapMode-enum"></a>enum QTextEdit::<span class="name">LineWrapMode</span></h3>
<div class="table"><table class="valuelist"><tr><th class="tblConst">Constant</th><th class="tblVal">Value</th></tr>
<tr><td class="topAlign"><code>QTextEdit::NoWrap</code></td><td class="topAlign tblval"><code>0</code></td></tr>
<tr><td class="topAlign"><code>QTextEdit::WidgetWidth</code></td><td class="topAlign tblval"><code>1</code></td></tr>
<tr><td class="topAlign"><code>QTextEdit::FixedPixelWidth</code></td><td class="topAlign tblval"><code>2</code></td></tr>
<tr><td class="topAlign"><code>QTextEdit::FixedColumnWidth</code></td><td class="topAlign tblval"><code>3</code></td></tr>
</table></div>
<!-- @@@LineWrapMode -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$acceptRichText-prop$$$acceptRichText$$$setAcceptRichTextbool -->
<h3 class="fn" id="acceptRichText-prop"><a name="acceptRichText-prop"></a><span class="name">acceptRichText</span> : <span class="type">bool</span></h3>
<p>This property holds whether the text edit accepts rich text insertions by the user</p>
<p>When this propery is set to false text edit will accept only plain text input from the user. For example through clipboard or drag and drop.</p>
<p>This property's default is true.</p>
<p>This property was introduced in  Qt 4.1.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>acceptRichText</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAcceptRichText</b></span>(bool <i>accept</i>)</td></tr>
</table></div>
<!-- @@@acceptRichText -->
<!-- $$$autoFormatting-prop$$$autoFormatting$$$setAutoFormattingQTextEdit::AutoFormatting -->
<h3 class="fn" id="autoFormatting-prop"><a name="autoFormatting-prop"></a><span class="name">autoFormatting</span> : <span class="type"><a href="qtextedit.html#AutoFormattingFlag-enum">AutoFormatting</a></span></h3>
<p>This property holds the enabled set of auto formatting features</p>
<p>The value can be any combination of the values in the <a href="qtextedit.html#AutoFormattingFlag-enum">AutoFormattingFlag</a> enum. The default is <a href="qtextedit.html#AutoFormattingFlag-enum">AutoNone</a>. Choose <a href="qtextedit.html#AutoFormattingFlag-enum">AutoAll</a> to enable all automatic formatting.</p>
<p>Currently, the only automatic formatting feature provided is <a href="qtextedit.html#AutoFormattingFlag-enum">AutoBulletList</a>; future versions of Qt may offer more.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QTextEdit::AutoFormatting </td><td class="memItemRight bottomAlign"><span class="name"><b>autoFormatting</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAutoFormatting</b></span>(QTextEdit::AutoFormatting <i>features</i>)</td></tr>
</table></div>
<!-- @@@autoFormatting -->
<!-- $$$cursorWidth-prop$$$cursorWidth$$$setCursorWidthint -->
<h3 class="fn" id="cursorWidth-prop"><a name="cursorWidth-prop"></a><span class="name">cursorWidth</span> : <span class="type">int</span></h3>
<p>This property specifies the width of the cursor in pixels. The default value is 1.</p>
<p>This property was introduced in  Qt 4.2.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>cursorWidth</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setCursorWidth</b></span>(int <i>width</i>)</td></tr>
</table></div>
<!-- @@@cursorWidth -->
<!-- $$$document-prop$$$document$$$setDocumentQTextDocument* -->
<h3 class="fn" id="document-prop"><a name="document-prop"></a><span class="name">document</span> : <span class="type"><a href="../qtgui/qtextdocument.html">QTextDocument</a></span>*</h3>
<p>This property holds the underlying document of the text editor.</p>
<p><b>Note: </b>The editor <i>does not take ownership of the document</i> unless it is the document's parent object. The parent object of the provided document remains the owner of the object. If the previously assigned document is a child of the editor then it will be deleted.</p><p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QTextDocument *</td><td class="memItemRight bottomAlign"><span class="name"><b>document</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDocument</b></span>(QTextDocument *<i>document</i>)</td></tr>
</table></div>
<!-- @@@document -->
<!-- $$$documentTitle-prop$$$documentTitle$$$setDocumentTitleconstQString& -->
<h3 class="fn" id="documentTitle-prop"><a name="documentTitle-prop"></a><span class="name">documentTitle</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>This property holds the title of the document parsed from the text.</p>
<p>By default, for a newly-created, empty document, this property contains an empty string.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>documentTitle</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDocumentTitle</b></span>(const QString &amp;<i>title</i>)</td></tr>
</table></div>
<!-- @@@documentTitle -->
<!-- $$$html-prop$$$toHtml$$$setHtmlconstQString&$$$textChanged -->
<h3 class="fn" id="html-prop"><a name="html-prop"></a><span class="name">html</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>This property provides an HTML interface to the text of the text edit.</p>
<p>toHtml() returns the text of the text edit as html.</p>
<p>setHtml() changes the text of the text edit. Any previous text is removed and the undo/redo history is cleared. The input text is interpreted as rich text in html format. <a href="qtextedit.html#currentCharFormat">currentCharFormat</a>() is also reset, unless <a href="qtextedit.html#textCursor">textCursor</a>() is already at the beginning of the document.</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="../qtcore/qstring.html">QString</a> containing HTML is created and passed to setHtml().</p><p>By default, for a newly-created, empty document, this property contains text to describe an HTML 4.0 document with no body text.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>toHtml</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setHtml</b></span>(const QString &amp;<i>text</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qtextedit.html#textChanged">textChanged</a></b></span>()</td></tr>
</table></div>
<p><b>See also </b><a href="../qtgui/richtext-html-subset.html">Supported HTML Subset</a> and <a href="qtextedit.html#plainText-prop">plainText</a>.</p>
<!-- @@@html -->
<!-- $$$lineWrapColumnOrWidth-prop$$$lineWrapColumnOrWidth$$$setLineWrapColumnOrWidthint -->
<h3 class="fn" id="lineWrapColumnOrWidth-prop"><a name="lineWrapColumnOrWidth-prop"></a><span class="name">lineWrapColumnOrWidth</span> : <span class="type">int</span></h3>
<p>This property holds the position (in pixels or columns depending on the wrap mode) where text will be wrapped</p>
<p>If the wrap mode is <a href="qtextedit.html#LineWrapMode-enum">FixedPixelWidth</a>, the value is the number of pixels from the left edge of the text edit at which text should be wrapped. If the wrap mode is <a href="qtextedit.html#LineWrapMode-enum">FixedColumnWidth</a>, the value is the column number (in character columns) from the left edge of the text edit at which text should be wrapped.</p>
<p>By default, this property contains a value of 0.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>lineWrapColumnOrWidth</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setLineWrapColumnOrWidth</b></span>(int <i>w</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qtextedit.html#lineWrapMode-prop">lineWrapMode</a>.</p>
<!-- @@@lineWrapColumnOrWidth -->
<!-- $$$lineWrapMode-prop$$$lineWrapMode$$$setLineWrapModeQTextEdit::LineWrapMode -->
<h3 class="fn" id="lineWrapMode-prop"><a name="lineWrapMode-prop"></a><span class="name">lineWrapMode</span> : <span class="type"><a href="qtextedit.html#LineWrapMode-enum">LineWrapMode</a></span></h3>
<p>This property holds the line wrap mode</p>
<p>The default mode is <a href="qtextedit.html#LineWrapMode-enum">WidgetWidth</a> which causes words to be wrapped at the right edge of the text edit. Wrapping occurs at whitespace, keeping whole words intact. If you want wrapping to occur within words use <a href="qtextedit.html#wordWrapMode-prop">setWordWrapMode</a>(). If you set a wrap mode of <a href="qtextedit.html#LineWrapMode-enum">FixedPixelWidth</a> or <a href="qtextedit.html#LineWrapMode-enum">FixedColumnWidth</a> you should also call <a href="qtextedit.html#lineWrapColumnOrWidth-prop">setLineWrapColumnOrWidth</a>() with the width you want.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QTextEdit::LineWrapMode </td><td class="memItemRight bottomAlign"><span class="name"><b>lineWrapMode</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setLineWrapMode</b></span>(QTextEdit::LineWrapMode <i>mode</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qtextedit.html#lineWrapColumnOrWidth-prop">lineWrapColumnOrWidth</a>.</p>
<!-- @@@lineWrapMode -->
<!-- $$$overwriteMode-prop$$$overwriteMode$$$setOverwriteModebool -->
<h3 class="fn" id="overwriteMode-prop"><a name="overwriteMode-prop"></a><span class="name">overwriteMode</span> : <span class="type">bool</span></h3>
<p>This property holds whether text entered by the user will overwrite existing text</p>
<p>As with many text editors, the text editor widget can be configured to insert or overwrite existing text with new text entered by the user.</p>
<p>If this property is <code>true</code>, existing text is overwritten, character-for-character by new text; otherwise, text is inserted at the cursor position, displacing existing text.</p>
<p>By default, this property is <code>false</code> (new text does not overwrite existing text).</p>
<p>This property was introduced in  Qt 4.1.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>overwriteMode</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setOverwriteMode</b></span>(bool <i>overwrite</i>)</td></tr>
</table></div>
<!-- @@@overwriteMode -->
<!-- $$$placeholderText-prop$$$placeholderText$$$setPlaceholderTextconstQString& -->
<h3 class="fn" id="placeholderText-prop"><a name="placeholderText-prop"></a><span class="name">placeholderText</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>This property holds the editor placeholder text</p>
<p>Setting this property makes the editor display a grayed-out placeholder text as long as the <a href="qtextedit.html#document-prop">document</a>() is empty.</p>
<p>By default, this property contains an empty string.</p>
<p>This property was introduced in  Qt 5.2.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>placeholderText</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setPlaceholderText</b></span>(const QString &amp;<i>placeholderText</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qtextedit.html#document-prop">document</a>().</p>
<!-- @@@placeholderText -->
<!-- $$$plainText-prop$$$toPlainText$$$setPlainTextconstQString& -->
<h3 class="fn" id="plainText-prop"><a name="plainText-prop"></a><span class="name">plainText</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>This property gets and sets the text editor's contents as plain text. Previous contents are removed and undo/redo history is reset when the property is set. <a href="qtextedit.html#currentCharFormat">currentCharFormat</a>() is also reset, unless <a href="qtextedit.html#textCursor">textCursor</a>() is already at the beginning of the document.</p>
<p>If the text edit has another content type, it will not be replaced by plain text if you call <a href="qtextedit.html#toPlainText">toPlainText</a>(). The only exception to this is the non-break space, <i>nbsp;</i>, that will be converted into standard space.</p>
<p>By default, for an editor with no contents, this property contains an empty string.</p>
<p>This property was introduced in  Qt 4.3.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qtextedit.html#toPlainText">toPlainText</a></b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qtextedit.html#setPlainText">setPlainText</a></b></span>(const QString &amp;<i>text</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qtextedit.html#html-prop">html</a>.</p>
<!-- @@@plainText -->
<!-- $$$readOnly-prop$$$isReadOnly$$$setReadOnlybool -->
<h3 class="fn" id="readOnly-prop"><a name="readOnly-prop"></a><span class="name">readOnly</span> : <span class="type">bool</span></h3>
<p>This property holds whether the text edit is read-only</p>
<p>In a read-only text edit the user can only navigate through the text and select text; modifying the text is not possible.</p>
<p>This property's default is false.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isReadOnly</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setReadOnly</b></span>(bool <i>ro</i>)</td></tr>
</table></div>
<!-- @@@readOnly -->
<!-- $$$tabChangesFocus-prop$$$tabChangesFocus$$$setTabChangesFocusbool -->
<h3 class="fn" id="tabChangesFocus-prop"><a name="tabChangesFocus-prop"></a><span class="name">tabChangesFocus</span> : <span class="type">bool</span></h3>
<p>This property holds whether <b>Tab</b> changes focus or is accepted as input</p>
<p>In some occasions text edits should not allow the user to input tabulators or change indentation using the <b>Tab</b> key, as this breaks the focus chain. The default is false.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>tabChangesFocus</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setTabChangesFocus</b></span>(bool <i>b</i>)</td></tr>
</table></div>
<!-- @@@tabChangesFocus -->
<!-- $$$tabStopDistance-prop$$$tabStopDistance$$$setTabStopDistanceqreal -->
<h3 class="fn" id="tabStopDistance-prop"><a name="tabStopDistance-prop"></a><span class="name">tabStopDistance</span> : <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span></h3>
<p>This property holds the tab stop distance in pixels</p>
<p>By default, this property contains a value of 80 pixels.</p>
<p>This property was introduced in  Qt 5.10.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b>tabStopDistance</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setTabStopDistance</b></span>(qreal <i>distance</i>)</td></tr>
</table></div>
<!-- @@@tabStopDistance -->
<!-- $$$textInteractionFlags-prop$$$textInteractionFlags$$$setTextInteractionFlagsQt::TextInteractionFlags -->
<h3 class="fn" id="textInteractionFlags-prop"><a name="textInteractionFlags-prop"></a><span class="name">textInteractionFlags</span> : <span class="type"><a href="../qtcore/qt.html#TextInteractionFlag-enum">Qt::TextInteractionFlags</a></span></h3>
<p>Specifies how the widget should interact with user input.</p>
<p>The default value depends on whether the <a href="qtextedit.html">QTextEdit</a> is read-only or editable, and whether it is a <a href="qtextbrowser.html">QTextBrowser</a> or not.</p>
<p>This property was introduced in  Qt 4.2.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::TextInteractionFlags </td><td class="memItemRight bottomAlign"><span class="name"><b>textInteractionFlags</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setTextInteractionFlags</b></span>(Qt::TextInteractionFlags <i>flags</i>)</td></tr>
</table></div>
<!-- @@@textInteractionFlags -->
<!-- $$$undoRedoEnabled-prop$$$isUndoRedoEnabled$$$setUndoRedoEnabledbool -->
<h3 class="fn" id="undoRedoEnabled-prop"><a name="undoRedoEnabled-prop"></a><span class="name">undoRedoEnabled</span> : <span class="type">bool</span></h3>
<p>This property holds whether undo and redo are enabled</p>
<p>Users are only able to undo or redo actions if this property is true, and if there is an action that can be undone (or redone).</p>
<p><b>Access functions:</b></p>
<div class="table"><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></div>
<!-- @@@undoRedoEnabled -->
<!-- $$$wordWrapMode-prop$$$wordWrapMode$$$setWordWrapModeQTextOption::WrapMode -->
<h3 class="fn" id="wordWrapMode-prop"><a name="wordWrapMode-prop"></a><span class="name">wordWrapMode</span> : <span class="type"><a href="../qtgui/qtextoption.html#WrapMode-enum">QTextOption::WrapMode</a></span></h3>
<p>This property holds the mode <a href="qtextedit.html">QTextEdit</a> will use when wrapping text by words</p>
<p>By default, this property is set to <a href="../qtgui/qtextoption.html#WrapMode-enum">QTextOption::WrapAtWordBoundaryOrAnywhere</a>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QTextOption::WrapMode </td><td class="memItemRight bottomAlign"><span class="name"><b>wordWrapMode</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setWordWrapMode</b></span>(QTextOption::WrapMode <i>policy</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="../qtgui/qtextoption.html#WrapMode-enum">QTextOption::WrapMode</a>.</p>
<!-- @@@wordWrapMode -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QTextEdit[overload1]$$$QTextEditQWidget* -->
<h3 class="fn" id="QTextEdit"><a name="QTextEdit"></a>QTextEdit::<span class="name">QTextEdit</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = nullptr)</h3>
<p>Constructs an empty <a href="qtextedit.html">QTextEdit</a> with parent <i>parent</i>.</p>
<!-- @@@QTextEdit -->
<!-- $$$QTextEdit$$$QTextEditconstQString&QWidget* -->
<h3 class="fn" id="QTextEdit-1"><a name="QTextEdit-1"></a>QTextEdit::<span class="name">QTextEdit</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>, <span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = nullptr)</h3>
<p>Constructs a <a href="qtextedit.html">QTextEdit</a> with parent <i>parent</i>. The text edit will display the text <i>text</i>. The text is interpreted as html.</p>
<!-- @@@QTextEdit -->
<!-- $$$~QTextEdit[overload1]$$$~QTextEdit -->
<h3 class="fn" id="dtor.QTextEdit"><a name="dtor.QTextEdit"></a><code>[virtual] </code>QTextEdit::<span class="name">~QTextEdit</span>()</h3>
<p>Destructor.</p>
<!-- @@@~QTextEdit -->
<!-- $$$alignment[overload1]$$$alignment -->
<h3 class="fn" id="alignment"><a name="alignment"></a><span class="type"><a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::Alignment</a></span> QTextEdit::<span class="name">alignment</span>() const</h3>
<p>Returns the alignment of the current paragraph.</p>
<p><b>See also </b><a href="qtextedit.html#setAlignment">setAlignment</a>().</p>
<!-- @@@alignment -->
<!-- $$$anchorAt[overload1]$$$anchorAtconstQPoint& -->
<h3 class="fn" id="anchorAt"><a name="anchorAt"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QTextEdit::<span class="name">anchorAt</span>(const <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> &amp;<i>pos</i>) const</h3>
<p>Returns the reference of the anchor at position <i>pos</i>, or an empty string if no anchor exists at that point.</p>
<!-- @@@anchorAt -->
<!-- $$$append[overload1]$$$appendconstQString& -->
<h3 class="fn" id="append"><a name="append"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">append</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>)</h3>
<p>Appends a new paragraph with <i>text</i> to the end of the text edit.</p>
<p><b>Note: </b>The new paragraph appended will have the same character format and block format as the current paragraph, determined by the position of the cursor.</p><p><b>See also </b><a href="qtextedit.html#currentCharFormat">currentCharFormat</a>() and <a href="../qtgui/qtextcursor.html#blockFormat">QTextCursor::blockFormat</a>().</p>
<!-- @@@append -->
<!-- $$$canInsertFromMimeData[overload1]$$$canInsertFromMimeDataconstQMimeData* -->
<h3 class="fn" id="canInsertFromMimeData"><a name="canInsertFromMimeData"></a><code>[virtual protected] </code><span class="type">bool</span> QTextEdit::<span class="name">canInsertFromMimeData</span>(const <span class="type"><a href="../qtcore/qmimedata.html">QMimeData</a></span> *<i>source</i>) const</h3>
<p>This function returns <code>true</code> if the contents of the MIME data object, specified by <i>source</i>, can be decoded and inserted into the document. It is called for example when during a drag operation the mouse enters this widget and it is necessary to determine whether it is possible to accept the drag and drop operation.</p>
<p>Reimplement this function to enable drag and drop support for additional MIME types.</p>
<!-- @@@canInsertFromMimeData -->
<!-- $$$canPaste[overload1]$$$canPaste -->
<h3 class="fn" id="canPaste"><a name="canPaste"></a><span class="type">bool</span> QTextEdit::<span class="name">canPaste</span>() const</h3>
<p>Returns whether text can be pasted from the clipboard into the textedit.</p>
<p>This function was introduced in  Qt 4.2.</p>
<!-- @@@canPaste -->
<!-- $$$changeEvent[overload1]$$$changeEventQEvent* -->
<h3 class="fn" id="changeEvent"><a name="changeEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">changeEvent</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qframe.html#changeEvent">QFrame::changeEvent</a>().</p>
<!-- @@@changeEvent -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn" id="clear"><a name="clear"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">clear</span>()</h3>
<p>Deletes all the text in the text edit.</p>
<p>Notes:</p>
<ul>
<li>The undo/redo history is also cleared.</li>
<li><a href="qtextedit.html#currentCharFormat">currentCharFormat</a>() is reset, unless <a href="qtextedit.html#textCursor">textCursor</a>() is already at the beginning of the document.</li>
</ul>
<p><b>See also </b><a href="qtextedit.html#cut">cut</a>(), <a href="qtextedit.html#setPlainText">setPlainText</a>(), and <a href="qtextedit.html#html-prop">setHtml</a>().</p>
<!-- @@@clear -->
<!-- $$$contextMenuEvent[overload1]$$$contextMenuEventQContextMenuEvent* -->
<h3 class="fn" id="contextMenuEvent"><a name="contextMenuEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">contextMenuEvent</span>(<span class="type"><a href="../qtgui/qcontextmenuevent.html">QContextMenuEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#contextMenuEvent">QAbstractScrollArea::contextMenuEvent</a>().</p>
<p>Shows the standard context menu created with <a href="qtextedit.html#createStandardContextMenu">createStandardContextMenu</a>().</p>
<p>If you do not want the text edit to have a context menu, you can set its <a href="qwidget.html#contextMenuPolicy-prop">contextMenuPolicy</a> to <a href="../qtcore/qt.html#ContextMenuPolicy-enum">Qt::NoContextMenu</a>. If you want to customize the context menu, reimplement this function. If you want to extend the standard context menu, reimplement this function, call <a href="qtextedit.html#createStandardContextMenu">createStandardContextMenu</a>() and extend the menu returned.</p>
<p>Information about the event is passed in the <i>event</i> object.</p>
<pre class="cpp">

  <span class="type">void</span> MyTextEdit<span class="operator">::</span>contextMenuEvent(<span class="type"><a href="../qtgui/qcontextmenuevent.html">QContextMenuEvent</a></span> <span class="operator">*</span>event)
  {
      <span class="type"><a href="qmenu.html">QMenu</a></span> <span class="operator">*</span>menu <span class="operator">=</span> createStandardContextMenu();
      menu<span class="operator">-</span><span class="operator">&gt;</span>addAction(tr(<span class="string">&quot;My Menu Item&quot;</span>));
      <span class="comment">//...</span>
      menu<span class="operator">-</span><span class="operator">&gt;</span>exec(event<span class="operator">-</span><span class="operator">&gt;</span>globalPos());
      <span class="keyword">delete</span> menu;
  }

</pre>
<!-- @@@contextMenuEvent -->
<!-- $$$copy[overload1]$$$copy -->
<h3 class="fn" id="copy"><a name="copy"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">copy</span>()</h3>
<p>Copies any selected text to the clipboard.</p>
<p><b>See also </b><a href="qtextedit.html#copyAvailable">copyAvailable</a>().</p>
<!-- @@@copy -->
<!-- $$$copyAvailable[overload1]$$$copyAvailablebool -->
<h3 class="fn" id="copyAvailable"><a name="copyAvailable"></a><code>[signal] </code><span class="type">void</span> QTextEdit::<span class="name">copyAvailable</span>(<span class="type">bool</span> <i>yes</i>)</h3>
<p>This signal is emitted when text is selected or de-selected in the text edit.</p>
<p>When text is selected this signal will be emitted with <i>yes</i> set to true. If no text has been selected or if the selected text is de-selected this signal is emitted with <i>yes</i> set to false.</p>
<p>If <i>yes</i> is true then <a href="qtextedit.html#copy">copy</a>() can be used to copy the selection to the clipboard. If <i>yes</i> is false then <a href="qtextedit.html#copy">copy</a>() does nothing.</p>
<p><b>See also </b><a href="qtextedit.html#selectionChanged">selectionChanged</a>().</p>
<!-- @@@copyAvailable -->
<!-- $$$createMimeDataFromSelection[overload1]$$$createMimeDataFromSelection -->
<h3 class="fn" id="createMimeDataFromSelection"><a name="createMimeDataFromSelection"></a><code>[virtual protected] </code><span class="type"><a href="../qtcore/qmimedata.html">QMimeData</a></span> *QTextEdit::<span class="name">createMimeDataFromSelection</span>() const</h3>
<p>This function returns a new MIME data object to represent the contents of the text edit's current selection. It is called when the selection needs to be encapsulated into a new <a href="../qtcore/qmimedata.html">QMimeData</a> object; for example, when a drag and drop operation is started, or when data is copied to the clipboard.</p>
<p>If you reimplement this function, note that the ownership of the returned <a href="../qtcore/qmimedata.html">QMimeData</a> object is passed to the caller. The selection can be retrieved by using the <a href="qtextedit.html#textCursor">textCursor</a>() function.</p>
<!-- @@@createMimeDataFromSelection -->
<!-- $$$createStandardContextMenu[overload1]$$$createStandardContextMenu -->
<h3 class="fn" id="createStandardContextMenu"><a name="createStandardContextMenu"></a><span class="type"><a href="qmenu.html">QMenu</a></span> *QTextEdit::<span class="name">createStandardContextMenu</span>()</h3>
<p>This function creates the standard context menu which is shown when the user clicks on the text edit with the right mouse button. It is called from the default <a href="qtextedit.html#contextMenuEvent">contextMenuEvent</a>() handler. The popup menu's ownership is transferred to the caller.</p>
<p>We recommend that you use the createStandardContextMenu(<a href="../qtcore/qpoint.html">QPoint</a>) version instead which will enable the actions that are sensitive to where the user clicked.</p>
<!-- @@@createStandardContextMenu -->
<!-- $$$createStandardContextMenu$$$createStandardContextMenuconstQPoint& -->
<h3 class="fn" id="createStandardContextMenu-1"><a name="createStandardContextMenu-1"></a><span class="type"><a href="qmenu.html">QMenu</a></span> *QTextEdit::<span class="name">createStandardContextMenu</span>(const <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> &amp;<i>position</i>)</h3>
<p>This function creates the standard context menu which is shown when the user clicks on the text edit with the right mouse button. It is called from the default <a href="qtextedit.html#contextMenuEvent">contextMenuEvent</a>() handler and it takes the <i>position</i> in document coordinates where the mouse click was. This can enable actions that are sensitive to the position where the user clicked. The popup menu's ownership is transferred to the caller.</p>
<p>This function was introduced in  Qt 4.4.</p>
<!-- @@@createStandardContextMenu -->
<!-- $$$currentCharFormat[overload1]$$$currentCharFormat -->
<h3 class="fn" id="currentCharFormat"><a name="currentCharFormat"></a><span class="type"><a href="../qtgui/qtextcharformat.html">QTextCharFormat</a></span> QTextEdit::<span class="name">currentCharFormat</span>() const</h3>
<p>Returns the char format that is used when inserting new text.</p>
<p><b>See also </b><a href="qtextedit.html#setCurrentCharFormat">setCurrentCharFormat</a>().</p>
<!-- @@@currentCharFormat -->
<!-- $$$currentCharFormatChanged[overload1]$$$currentCharFormatChangedconstQTextCharFormat& -->
<h3 class="fn" id="currentCharFormatChanged"><a name="currentCharFormatChanged"></a><code>[signal] </code><span class="type">void</span> QTextEdit::<span class="name">currentCharFormatChanged</span>(const <span class="type"><a href="../qtgui/qtextcharformat.html">QTextCharFormat</a></span> &amp;<i>f</i>)</h3>
<p>This signal is emitted if the current character format has changed, for example caused by a change of the cursor position.</p>
<p>The new format is <i>f</i>.</p>
<p><b>See also </b><a href="qtextedit.html#setCurrentCharFormat">setCurrentCharFormat</a>().</p>
<!-- @@@currentCharFormatChanged -->
<!-- $$$currentFont[overload1]$$$currentFont -->
<h3 class="fn" id="currentFont"><a name="currentFont"></a><span class="type"><a href="../qtgui/qfont.html">QFont</a></span> QTextEdit::<span class="name">currentFont</span>() const</h3>
<p>Returns the font of the current format.</p>
<p><b>See also </b><a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), <a href="qtextedit.html#setFontFamily">setFontFamily</a>(), and <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>().</p>
<!-- @@@currentFont -->
<!-- $$$cursorForPosition[overload1]$$$cursorForPositionconstQPoint& -->
<h3 class="fn" id="cursorForPosition"><a name="cursorForPosition"></a><span class="type"><a href="../qtgui/qtextcursor.html">QTextCursor</a></span> QTextEdit::<span class="name">cursorForPosition</span>(const <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> &amp;<i>pos</i>) const</h3>
<p>returns a <a href="../qtgui/qtextcursor.html">QTextCursor</a> at position <i>pos</i> (in viewport coordinates).</p>
<!-- @@@cursorForPosition -->
<!-- $$$cursorPositionChanged[overload1]$$$cursorPositionChanged -->
<h3 class="fn" id="cursorPositionChanged"><a name="cursorPositionChanged"></a><code>[signal] </code><span class="type">void</span> QTextEdit::<span class="name">cursorPositionChanged</span>()</h3>
<p>This signal is emitted whenever the position of the cursor changed.</p>
<!-- @@@cursorPositionChanged -->
<!-- $$$cursorRect[overload1]$$$cursorRectconstQTextCursor& -->
<h3 class="fn" id="cursorRect"><a name="cursorRect"></a><span class="type"><a href="../qtcore/qrect.html">QRect</a></span> QTextEdit::<span class="name">cursorRect</span>(const <span class="type"><a href="../qtgui/qtextcursor.html">QTextCursor</a></span> &amp;<i>cursor</i>) const</h3>
<p>returns a rectangle (in viewport coordinates) that includes the <i>cursor</i>.</p>
<!-- @@@cursorRect -->
<!-- $$$cursorRect$$$cursorRect -->
<h3 class="fn" id="cursorRect-1"><a name="cursorRect-1"></a><span class="type"><a href="../qtcore/qrect.html">QRect</a></span> QTextEdit::<span class="name">cursorRect</span>() const</h3>
<p>returns a rectangle (in viewport coordinates) that includes the cursor of the text edit.</p>
<!-- @@@cursorRect -->
<!-- $$$cut[overload1]$$$cut -->
<h3 class="fn" id="cut"><a name="cut"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">cut</span>()</h3>
<p>Copies the selected text to the clipboard and deletes it from the text edit.</p>
<p>If there is no selected text nothing happens.</p>
<p><b>See also </b><a href="qtextedit.html#copy">copy</a>() and <a href="qtextedit.html#paste">paste</a>().</p>
<!-- @@@cut -->
<!-- $$$dragEnterEvent[overload1]$$$dragEnterEventQDragEnterEvent* -->
<h3 class="fn" id="dragEnterEvent"><a name="dragEnterEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">dragEnterEvent</span>(<span class="type"><a href="../qtgui/qdragenterevent.html">QDragEnterEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#dragEnterEvent">QAbstractScrollArea::dragEnterEvent</a>().</p>
<!-- @@@dragEnterEvent -->
<!-- $$$dragLeaveEvent[overload1]$$$dragLeaveEventQDragLeaveEvent* -->
<h3 class="fn" id="dragLeaveEvent"><a name="dragLeaveEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">dragLeaveEvent</span>(<span class="type"><a href="../qtgui/qdragleaveevent.html">QDragLeaveEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#dragLeaveEvent">QAbstractScrollArea::dragLeaveEvent</a>().</p>
<!-- @@@dragLeaveEvent -->
<!-- $$$dragMoveEvent[overload1]$$$dragMoveEventQDragMoveEvent* -->
<h3 class="fn" id="dragMoveEvent"><a name="dragMoveEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">dragMoveEvent</span>(<span class="type"><a href="../qtgui/qdragmoveevent.html">QDragMoveEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#dragMoveEvent">QAbstractScrollArea::dragMoveEvent</a>().</p>
<!-- @@@dragMoveEvent -->
<!-- $$$dropEvent[overload1]$$$dropEventQDropEvent* -->
<h3 class="fn" id="dropEvent"><a name="dropEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">dropEvent</span>(<span class="type"><a href="../qtgui/qdropevent.html">QDropEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#dropEvent">QAbstractScrollArea::dropEvent</a>().</p>
<!-- @@@dropEvent -->
<!-- $$$ensureCursorVisible[overload1]$$$ensureCursorVisible -->
<h3 class="fn" id="ensureCursorVisible"><a name="ensureCursorVisible"></a><span class="type">void</span> QTextEdit::<span class="name">ensureCursorVisible</span>()</h3>
<p>Ensures that the cursor is visible by scrolling the text edit if necessary.</p>
<!-- @@@ensureCursorVisible -->
<!-- $$$extraSelections[overload1]$$$extraSelections -->
<h3 class="fn" id="extraSelections"><a name="extraSelections"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qtextedit-extraselection.html">QTextEdit::ExtraSelection</a></span>&gt; QTextEdit::<span class="name">extraSelections</span>() const</h3>
<p>Returns previously set extra selections.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qtextedit.html#setExtraSelections">setExtraSelections</a>().</p>
<!-- @@@extraSelections -->
<!-- $$$find[overload1]$$$findconstQString&QTextDocument::FindFlags -->
<h3 class="fn" id="find"><a name="find"></a><span class="type">bool</span> QTextEdit::<span class="name">find</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>exp</i>, <span class="type"><a href="../qtgui/qtextdocument.html#FindFlag-enum">QTextDocument::FindFlags</a></span> <i>options</i> = ...)</h3>
<p>Finds the next occurrence of the string, <i>exp</i>, using the given <i>options</i>. Returns <code>true</code> if <i>exp</i> was found and changes the cursor to select the match; otherwise returns <code>false</code>.</p>
<!-- @@@find -->
<!-- $$$find$$$findconstQRegExp&QTextDocument::FindFlags -->
<h3 class="fn" id="find-1"><a name="find-1"></a><span class="type">bool</span> QTextEdit::<span class="name">find</span>(const <span class="type"><a href="../qtcore/qregexp.html">QRegExp</a></span> &amp;<i>exp</i>, <span class="type"><a href="../qtgui/qtextdocument.html#FindFlag-enum">QTextDocument::FindFlags</a></span> <i>options</i> = ...)</h3>
<p>This is an overloaded function.</p>
<p>Finds the next occurrence, matching the regular expression, <i>exp</i>, using the given <i>options</i>. The <a href="../qtgui/qtextdocument.html#FindFlag-enum">QTextDocument::FindCaseSensitively</a> option is ignored for this overload, use <a href="../qtcore/qregexp.html#caseSensitivity">QRegExp::caseSensitivity</a> instead.</p>
<p>Returns <code>true</code> if a match was found and changes the cursor to select the match; otherwise returns <code>false</code>.</p>
<p>This function was introduced in  Qt 5.3.</p>
<!-- @@@find -->
<!-- $$$focusInEvent[overload1]$$$focusInEventQFocusEvent* -->
<h3 class="fn" id="focusInEvent"><a name="focusInEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">focusInEvent</span>(<span class="type"><a href="../qtgui/qfocusevent.html">QFocusEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#focusInEvent">QWidget::focusInEvent</a>().</p>
<!-- @@@focusInEvent -->
<!-- $$$focusNextPrevChild[overload1]$$$focusNextPrevChildbool -->
<h3 class="fn" id="focusNextPrevChild"><a name="focusNextPrevChild"></a><code>[override virtual protected] </code><span class="type">bool</span> QTextEdit::<span class="name">focusNextPrevChild</span>(<span class="type">bool</span> <i>next</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#focusNextPrevChild">QWidget::focusNextPrevChild</a>().</p>
<!-- @@@focusNextPrevChild -->
<!-- $$$focusOutEvent[overload1]$$$focusOutEventQFocusEvent* -->
<h3 class="fn" id="focusOutEvent"><a name="focusOutEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">focusOutEvent</span>(<span class="type"><a href="../qtgui/qfocusevent.html">QFocusEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#focusOutEvent">QWidget::focusOutEvent</a>().</p>
<!-- @@@focusOutEvent -->
<!-- $$$fontFamily[overload1]$$$fontFamily -->
<h3 class="fn" id="fontFamily"><a name="fontFamily"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QTextEdit::<span class="name">fontFamily</span>() const</h3>
<p>Returns the font family of the current format.</p>
<p><b>See also </b><a href="qtextedit.html#setFontFamily">setFontFamily</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>().</p>
<!-- @@@fontFamily -->
<!-- $$$fontItalic[overload1]$$$fontItalic -->
<h3 class="fn" id="fontItalic"><a name="fontItalic"></a><span class="type">bool</span> QTextEdit::<span class="name">fontItalic</span>() const</h3>
<p>Returns <code>true</code> if the font of the current format is italic; otherwise returns false.</p>
<p><b>See also </b><a href="qtextedit.html#setFontItalic">setFontItalic</a>().</p>
<!-- @@@fontItalic -->
<!-- $$$fontPointSize[overload1]$$$fontPointSize -->
<h3 class="fn" id="fontPointSize"><a name="fontPointSize"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QTextEdit::<span class="name">fontPointSize</span>() const</h3>
<p>Returns the point size of the font of the current format.</p>
<p><b>See also </b><a href="qtextedit.html#setFontFamily">setFontFamily</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>().</p>
<!-- @@@fontPointSize -->
<!-- $$$fontUnderline[overload1]$$$fontUnderline -->
<h3 class="fn" id="fontUnderline"><a name="fontUnderline"></a><span class="type">bool</span> QTextEdit::<span class="name">fontUnderline</span>() const</h3>
<p>Returns <code>true</code> if the font of the current format is underlined; otherwise returns false.</p>
<p><b>See also </b><a href="qtextedit.html#setFontUnderline">setFontUnderline</a>().</p>
<!-- @@@fontUnderline -->
<!-- $$$fontWeight[overload1]$$$fontWeight -->
<h3 class="fn" id="fontWeight"><a name="fontWeight"></a><span class="type">int</span> QTextEdit::<span class="name">fontWeight</span>() const</h3>
<p>Returns the font weight of the current format.</p>
<p><b>See also </b><a href="qtextedit.html#setFontWeight">setFontWeight</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>(), and <a href="../qtgui/qfont.html#Weight-enum">QFont::Weight</a>.</p>
<!-- @@@fontWeight -->
<!-- $$$inputMethodEvent[overload1]$$$inputMethodEventQInputMethodEvent* -->
<h3 class="fn" id="inputMethodEvent"><a name="inputMethodEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">inputMethodEvent</span>(<span class="type"><a href="../qtgui/qinputmethodevent.html">QInputMethodEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#inputMethodEvent">QWidget::inputMethodEvent</a>().</p>
<!-- @@@inputMethodEvent -->
<!-- $$$inputMethodQuery[overload1]$$$inputMethodQueryQt::InputMethodQuery -->
<h3 class="fn" id="inputMethodQuery"><a name="inputMethodQuery"></a><code>[override virtual] </code><span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> QTextEdit::<span class="name">inputMethodQuery</span>(<span class="type"><a href="../qtcore/qt.html#InputMethodQuery-enum">Qt::InputMethodQuery</a></span> <i>property</i>) const</h3>
<p>Reimplemented from <a href="qwidget.html#inputMethodQuery">QWidget::inputMethodQuery</a>().</p>
<!-- @@@inputMethodQuery -->
<!-- $$$insertFromMimeData[overload1]$$$insertFromMimeDataconstQMimeData* -->
<h3 class="fn" id="insertFromMimeData"><a name="insertFromMimeData"></a><code>[virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">insertFromMimeData</span>(const <span class="type"><a href="../qtcore/qmimedata.html">QMimeData</a></span> *<i>source</i>)</h3>
<p>This function inserts the contents of the MIME data object, specified by <i>source</i>, into the text edit at the current cursor position. It is called whenever text is inserted as the result of a clipboard paste operation, or when the text edit accepts data from a drag and drop operation.</p>
<p>Reimplement this function to enable drag and drop support for additional MIME types.</p>
<!-- @@@insertFromMimeData -->
<!-- $$$insertHtml[overload1]$$$insertHtmlconstQString& -->
<h3 class="fn" id="insertHtml"><a name="insertHtml"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">insertHtml</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>)</h3>
<p>Convenience slot that inserts <i>text</i> which is assumed to be of html formatting at the current cursor position.</p>
<p>It is equivalent to:</p>
<pre class="cpp">

  edit<span class="operator">-</span><span class="operator">&gt;</span>textCursor()<span class="operator">.</span>insertHtml(fragment);

</pre>
<p><b>Note: </b>When using this function with a style sheet, the style sheet will only apply to the current block in the document. In order to apply a style sheet throughout a document, use <a href="../qtgui/qtextdocument.html#defaultStyleSheet-prop">QTextDocument::setDefaultStyleSheet</a>() instead.</p><!-- @@@insertHtml -->
<!-- $$$insertPlainText[overload1]$$$insertPlainTextconstQString& -->
<h3 class="fn" id="insertPlainText"><a name="insertPlainText"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">insertPlainText</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>)</h3>
<p>Convenience slot that inserts <i>text</i> at the current cursor position.</p>
<p>It is equivalent to</p>
<pre class="cpp">

  edit<span class="operator">-</span><span class="operator">&gt;</span>textCursor()<span class="operator">.</span>insertText(text);

</pre>
<!-- @@@insertPlainText -->
<!-- $$$keyPressEvent[overload1]$$$keyPressEventQKeyEvent* -->
<h3 class="fn" id="keyPressEvent"><a name="keyPressEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">keyPressEvent</span>(<span class="type"><a href="../qtgui/qkeyevent.html">QKeyEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#keyPressEvent">QAbstractScrollArea::keyPressEvent</a>().</p>
<!-- @@@keyPressEvent -->
<!-- $$$keyReleaseEvent[overload1]$$$keyReleaseEventQKeyEvent* -->
<h3 class="fn" id="keyReleaseEvent"><a name="keyReleaseEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">keyReleaseEvent</span>(<span class="type"><a href="../qtgui/qkeyevent.html">QKeyEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#keyReleaseEvent">QWidget::keyReleaseEvent</a>().</p>
<!-- @@@keyReleaseEvent -->
<!-- $$$loadResource[overload1]$$$loadResourceintconstQUrl& -->
<h3 class="fn" id="loadResource"><a name="loadResource"></a><code>[virtual] </code><span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> QTextEdit::<span class="name">loadResource</span>(<span class="type">int</span> <i>type</i>, const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &amp;<i>name</i>)</h3>
<p>Loads the resource specified by the given <i>type</i> and <i>name</i>.</p>
<p>This function is an extension of <a href="../qtgui/qtextdocument.html#loadResource">QTextDocument::loadResource</a>().</p>
<p><b>Note: </b>This function can be invoked via the meta-object system and from QML. See <a href="../qtcore/qobject.html#Q_INVOKABLE">Q_INVOKABLE</a>.</p>
<p><b>See also </b><a href="../qtgui/qtextdocument.html#loadResource">QTextDocument::loadResource</a>().</p>
<!-- @@@loadResource -->
<!-- $$$mergeCurrentCharFormat[overload1]$$$mergeCurrentCharFormatconstQTextCharFormat& -->
<h3 class="fn" id="mergeCurrentCharFormat"><a name="mergeCurrentCharFormat"></a><span class="type">void</span> QTextEdit::<span class="name">mergeCurrentCharFormat</span>(const <span class="type"><a href="../qtgui/qtextcharformat.html">QTextCharFormat</a></span> &amp;<i>modifier</i>)</h3>
<p>Merges the properties specified in <i>modifier</i> into the current character format by calling <a href="../qtgui/qtextcursor.html#mergeCharFormat">QTextCursor::mergeCharFormat</a> on the editor's cursor. If the editor has a selection then the properties of <i>modifier</i> are directly applied to the selection.</p>
<p><b>See also </b><a href="../qtgui/qtextcursor.html#mergeCharFormat">QTextCursor::mergeCharFormat</a>().</p>
<!-- @@@mergeCurrentCharFormat -->
<!-- $$$mouseDoubleClickEvent[overload1]$$$mouseDoubleClickEventQMouseEvent* -->
<h3 class="fn" id="mouseDoubleClickEvent"><a name="mouseDoubleClickEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">mouseDoubleClickEvent</span>(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#mouseDoubleClickEvent">QAbstractScrollArea::mouseDoubleClickEvent</a>().</p>
<!-- @@@mouseDoubleClickEvent -->
<!-- $$$mouseMoveEvent[overload1]$$$mouseMoveEventQMouseEvent* -->
<h3 class="fn" id="mouseMoveEvent"><a name="mouseMoveEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">mouseMoveEvent</span>(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#mouseMoveEvent">QAbstractScrollArea::mouseMoveEvent</a>().</p>
<!-- @@@mouseMoveEvent -->
<!-- $$$mousePressEvent[overload1]$$$mousePressEventQMouseEvent* -->
<h3 class="fn" id="mousePressEvent"><a name="mousePressEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">mousePressEvent</span>(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#mousePressEvent">QAbstractScrollArea::mousePressEvent</a>().</p>
<!-- @@@mousePressEvent -->
<!-- $$$mouseReleaseEvent[overload1]$$$mouseReleaseEventQMouseEvent* -->
<h3 class="fn" id="mouseReleaseEvent"><a name="mouseReleaseEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">mouseReleaseEvent</span>(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#mouseReleaseEvent">QAbstractScrollArea::mouseReleaseEvent</a>().</p>
<!-- @@@mouseReleaseEvent -->
<!-- $$$moveCursor[overload1]$$$moveCursorQTextCursor::MoveOperationQTextCursor::MoveMode -->
<h3 class="fn" id="moveCursor"><a name="moveCursor"></a><span class="type">void</span> QTextEdit::<span class="name">moveCursor</span>(<span class="type"><a href="../qtgui/qtextcursor.html#MoveOperation-enum">QTextCursor::MoveOperation</a></span> <i>operation</i>, <span class="type"><a href="../qtgui/qtextcursor.html#MoveMode-enum">QTextCursor::MoveMode</a></span> <i>mode</i> = QTextCursor::MoveAnchor)</h3>
<p>Moves the cursor by performing the given <i>operation</i>.</p>
<p>If <i>mode</i> is <a href="../qtgui/qtextcursor.html#MoveMode-enum">QTextCursor::KeepAnchor</a>, the cursor selects the text it moves over. This is the same effect that the user achieves when they hold down the Shift key and move the cursor with the cursor keys.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="../qtgui/qtextcursor.html#movePosition">QTextCursor::movePosition</a>().</p>
<!-- @@@moveCursor -->
<!-- $$$paintEvent[overload1]$$$paintEventQPaintEvent* -->
<h3 class="fn" id="paintEvent"><a name="paintEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">paintEvent</span>(<span class="type"><a href="../qtgui/qpaintevent.html">QPaintEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#paintEvent">QAbstractScrollArea::paintEvent</a>().</p>
<p>This event handler can be reimplemented in a subclass to receive paint events passed in <i>event</i>. It is usually unnecessary to reimplement this function in a subclass of <a href="qtextedit.html">QTextEdit</a>.</p>
<p><b>Warning:</b> The underlying text document must not be modified from within a reimplementation of this function.</p>
<!-- @@@paintEvent -->
<!-- $$$paste[overload1]$$$paste -->
<h3 class="fn" id="paste"><a name="paste"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">paste</span>()</h3>
<p>Pastes the text from the clipboard into the text edit at the current cursor position.</p>
<p>If there is no text in the clipboard nothing happens.</p>
<p>To change the behavior of this function, i.e&#x2e; to modify what <a href="qtextedit.html">QTextEdit</a> can paste and how it is being pasted, reimplement the virtual <a href="qtextedit.html#canInsertFromMimeData">canInsertFromMimeData</a>() and <a href="qtextedit.html#insertFromMimeData">insertFromMimeData</a>() functions.</p>
<p><b>See also </b><a href="qtextedit.html#cut">cut</a>() and <a href="qtextedit.html#copy">copy</a>().</p>
<!-- @@@paste -->
<!-- $$$print[overload1]$$$printQPagedPaintDevice* -->
<h3 class="fn" id="print"><a name="print"></a><span class="type">void</span> QTextEdit::<span class="name">print</span>(<span class="type"><a href="../qtgui/qpagedpaintdevice.html">QPagedPaintDevice</a></span> *<i>printer</i>) const</h3>
<p>Convenience function to print the text edit's document to the given <i>printer</i>. This is equivalent to calling the print method on the document directly except that this function also supports QPrinter::Selection as print range.</p>
<p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="../qtgui/qtextdocument.html#print">QTextDocument::print</a>().</p>
<!-- @@@print -->
<!-- $$$redo[overload1]$$$redo -->
<h3 class="fn" id="redo"><a name="redo"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">redo</span>()</h3>
<p>Redoes the last operation.</p>
<p>If there is no operation to redo, i.e&#x2e; there is no redo step in the undo/redo history, nothing happens.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qtextedit.html#undo">undo</a>().</p>
<!-- @@@redo -->
<!-- $$$redoAvailable[overload1]$$$redoAvailablebool -->
<h3 class="fn" id="redoAvailable"><a name="redoAvailable"></a><code>[signal] </code><span class="type">void</span> QTextEdit::<span class="name">redoAvailable</span>(<span class="type">bool</span> <i>available</i>)</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 -->
<!-- $$$resizeEvent[overload1]$$$resizeEventQResizeEvent* -->
<h3 class="fn" id="resizeEvent"><a name="resizeEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">resizeEvent</span>(<span class="type"><a href="../qtgui/qresizeevent.html">QResizeEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#resizeEvent">QAbstractScrollArea::resizeEvent</a>().</p>
<!-- @@@resizeEvent -->
<!-- $$$scrollContentsBy[overload1]$$$scrollContentsByintint -->
<h3 class="fn" id="scrollContentsBy"><a name="scrollContentsBy"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">scrollContentsBy</span>(<span class="type">int</span> <i>dx</i>, <span class="type">int</span> <i>dy</i>)</h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#scrollContentsBy">QAbstractScrollArea::scrollContentsBy</a>().</p>
<!-- @@@scrollContentsBy -->
<!-- $$$scrollToAnchor[overload1]$$$scrollToAnchorconstQString& -->
<h3 class="fn" id="scrollToAnchor"><a name="scrollToAnchor"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">scrollToAnchor</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>name</i>)</h3>
<p>Scrolls the text edit so that the anchor with the given <i>name</i> is visible; does nothing if the <i>name</i> is empty, or is already visible, or isn't found.</p>
<!-- @@@scrollToAnchor -->
<!-- $$$selectAll[overload1]$$$selectAll -->
<h3 class="fn" id="selectAll"><a name="selectAll"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">selectAll</span>()</h3>
<p>Selects all text.</p>
<p><b>See also </b><a href="qtextedit.html#copy">copy</a>(), <a href="qtextedit.html#cut">cut</a>(), and <a href="qtextedit.html#textCursor">textCursor</a>().</p>
<!-- @@@selectAll -->
<!-- $$$selectionChanged[overload1]$$$selectionChanged -->
<h3 class="fn" id="selectionChanged"><a name="selectionChanged"></a><code>[signal] </code><span class="type">void</span> QTextEdit::<span class="name">selectionChanged</span>()</h3>
<p>This signal is emitted whenever the selection changes.</p>
<p><b>See also </b><a href="qtextedit.html#copyAvailable">copyAvailable</a>().</p>
<!-- @@@selectionChanged -->
<!-- $$$setAlignment[overload1]$$$setAlignmentQt::Alignment -->
<h3 class="fn" id="setAlignment"><a name="setAlignment"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">setAlignment</span>(<span class="type"><a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::Alignment</a></span> <i>a</i>)</h3>
<p>Sets the alignment of the current paragraph to <i>a</i>. Valid alignments are <a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::AlignLeft</a>, <a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::AlignRight</a>, <a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::AlignJustify</a> and <a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::AlignCenter</a> (which centers horizontally).</p>
<p><b>See also </b><a href="qtextedit.html#alignment">alignment</a>().</p>
<!-- @@@setAlignment -->
<!-- $$$setCurrentCharFormat[overload1]$$$setCurrentCharFormatconstQTextCharFormat& -->
<h3 class="fn" id="setCurrentCharFormat"><a name="setCurrentCharFormat"></a><span class="type">void</span> QTextEdit::<span class="name">setCurrentCharFormat</span>(const <span class="type"><a href="../qtgui/qtextcharformat.html">QTextCharFormat</a></span> &amp;<i>format</i>)</h3>
<p>Sets the char format that is be used when inserting new text to <i>format</i> by calling <a href="../qtgui/qtextcursor.html#setCharFormat">QTextCursor::setCharFormat</a>() on the editor's cursor. If the editor has a selection then the char format is directly applied to the selection.</p>
<p><b>See also </b><a href="qtextedit.html#currentCharFormat">currentCharFormat</a>().</p>
<!-- @@@setCurrentCharFormat -->
<!-- $$$setCurrentFont[overload1]$$$setCurrentFontconstQFont& -->
<h3 class="fn" id="setCurrentFont"><a name="setCurrentFont"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">setCurrentFont</span>(const <span class="type"><a href="../qtgui/qfont.html">QFont</a></span> &amp;<i>f</i>)</h3>
<p>Sets the font of the current format to <i>f</i>.</p>
<p><b>See also </b><a href="qtextedit.html#currentFont">currentFont</a>(), <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>(), and <a href="qtextedit.html#setFontFamily">setFontFamily</a>().</p>
<!-- @@@setCurrentFont -->
<!-- $$$setExtraSelections[overload1]$$$setExtraSelectionsconstQList<QTextEdit::ExtraSelection>& -->
<h3 class="fn" id="setExtraSelections"><a name="setExtraSelections"></a><span class="type">void</span> QTextEdit::<span class="name">setExtraSelections</span>(const <span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qtextedit-extraselection.html">QTextEdit::ExtraSelection</a></span>&gt; &amp;<i>selections</i>)</h3>
<p>This function allows temporarily marking certain regions in the document with a given color, specified as <i>selections</i>. This can be useful for example in a programming editor to mark a whole line of text with a given background color to indicate the existence of a breakpoint.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qtextedit-extraselection.html">QTextEdit::ExtraSelection</a> and <a href="qtextedit.html#extraSelections">extraSelections</a>().</p>
<!-- @@@setExtraSelections -->
<!-- $$$setFontFamily[overload1]$$$setFontFamilyconstQString& -->
<h3 class="fn" id="setFontFamily"><a name="setFontFamily"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">setFontFamily</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>fontFamily</i>)</h3>
<p>Sets the font family of the current format to <i>fontFamily</i>.</p>
<p><b>See also </b><a href="qtextedit.html#fontFamily">fontFamily</a>() and <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>().</p>
<!-- @@@setFontFamily -->
<!-- $$$setFontItalic[overload1]$$$setFontItalicbool -->
<h3 class="fn" id="setFontItalic"><a name="setFontItalic"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">setFontItalic</span>(<span class="type">bool</span> <i>italic</i>)</h3>
<p>If <i>italic</i> is true, sets the current format to italic; otherwise sets the current format to non-italic.</p>
<p><b>See also </b><a href="qtextedit.html#fontItalic">fontItalic</a>().</p>
<!-- @@@setFontItalic -->
<!-- $$$setFontPointSize[overload1]$$$setFontPointSizeqreal -->
<h3 class="fn" id="setFontPointSize"><a name="setFontPointSize"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">setFontPointSize</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>s</i>)</h3>
<p>Sets the point size of the current format to <i>s</i>.</p>
<p>Note that if <i>s</i> is zero or negative, the behavior of this function is not defined.</p>
<p><b>See also </b><a href="qtextedit.html#fontPointSize">fontPointSize</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="qtextedit.html#setFontFamily">setFontFamily</a>().</p>
<!-- @@@setFontPointSize -->
<!-- $$$setFontUnderline[overload1]$$$setFontUnderlinebool -->
<h3 class="fn" id="setFontUnderline"><a name="setFontUnderline"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">setFontUnderline</span>(<span class="type">bool</span> <i>underline</i>)</h3>
<p>If <i>underline</i> is true, sets the current format to underline; otherwise sets the current format to non-underline.</p>
<p><b>See also </b><a href="qtextedit.html#fontUnderline">fontUnderline</a>().</p>
<!-- @@@setFontUnderline -->
<!-- $$$setFontWeight[overload1]$$$setFontWeightint -->
<h3 class="fn" id="setFontWeight"><a name="setFontWeight"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">setFontWeight</span>(<span class="type">int</span> <i>weight</i>)</h3>
<p>Sets the font weight of the current format to the given <i>weight</i>, where the value used is in the range defined by the <a href="../qtgui/qfont.html#Weight-enum">QFont::Weight</a> enum.</p>
<p><b>See also </b><a href="qtextedit.html#fontWeight">fontWeight</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="qtextedit.html#setFontFamily">setFontFamily</a>().</p>
<!-- @@@setFontWeight -->
<!-- $$$setPlainText -->
<h3 class="fn" id="setPlainText"><a name="setPlainText"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">setPlainText</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>)</h3>
<p>Changes the text of the text edit to the string <i>text</i>. Any previous text is removed.</p>
<p>Notes:</p>
<ul>
<li><i>text</i> is interpreted as plain text.</li>
<li>The undo/redo history is also cleared.</li>
<li><a href="qtextedit.html#currentCharFormat">currentCharFormat</a>() is reset, unless <a href="qtextedit.html#textCursor">textCursor</a>() is already at the beginning of the document.</li>
</ul>
<p><b>Note:</b> Setter function for property <a href="qtextedit.html#plainText-prop">plainText</a>. </p><p><b>See also </b><a href="qtextedit.html#toPlainText">toPlainText</a>().</p>
<!-- @@@setPlainText -->
<!-- $$$setText[overload1]$$$setTextconstQString& -->
<h3 class="fn" id="setText"><a name="setText"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">setText</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>)</h3>
<p>Sets the text edit's <i>text</i>. The text can be plain text or HTML and the text edit will try to guess the right format.</p>
<p>Use <a href="qtextedit.html#html-prop">setHtml</a>() or <a href="qtextedit.html#setPlainText">setPlainText</a>() directly to avoid text edit's guessing.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qtextedit.html#toPlainText">toPlainText</a>() and <a href="qtextedit.html#html-prop">toHtml</a>().</p>
<!-- @@@setText -->
<!-- $$$setTextBackgroundColor[overload1]$$$setTextBackgroundColorconstQColor& -->
<h3 class="fn" id="setTextBackgroundColor"><a name="setTextBackgroundColor"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">setTextBackgroundColor</span>(const <span class="type"><a href="../qtgui/qcolor.html">QColor</a></span> &amp;<i>c</i>)</h3>
<p>Sets the text background color of the current format to <i>c</i>.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qtextedit.html#textBackgroundColor">textBackgroundColor</a>().</p>
<!-- @@@setTextBackgroundColor -->
<!-- $$$setTextColor[overload1]$$$setTextColorconstQColor& -->
<h3 class="fn" id="setTextColor"><a name="setTextColor"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">setTextColor</span>(const <span class="type"><a href="../qtgui/qcolor.html">QColor</a></span> &amp;<i>c</i>)</h3>
<p>Sets the text color of the current format to <i>c</i>.</p>
<p><b>See also </b><a href="qtextedit.html#textColor">textColor</a>().</p>
<!-- @@@setTextColor -->
<!-- $$$setTextCursor[overload1]$$$setTextCursorconstQTextCursor& -->
<h3 class="fn" id="setTextCursor"><a name="setTextCursor"></a><span class="type">void</span> QTextEdit::<span class="name">setTextCursor</span>(const <span class="type"><a href="../qtgui/qtextcursor.html">QTextCursor</a></span> &amp;<i>cursor</i>)</h3>
<p>Sets the visible <i>cursor</i>.</p>
<p><b>See also </b><a href="qtextedit.html#textCursor">textCursor</a>().</p>
<!-- @@@setTextCursor -->
<!-- $$$showEvent[overload1]$$$showEventQShowEvent* -->
<h3 class="fn" id="showEvent"><a name="showEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">showEvent</span>(<i>QShowEvent *</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#showEvent">QWidget::showEvent</a>().</p>
<!-- @@@showEvent -->
<!-- $$$textBackgroundColor[overload1]$$$textBackgroundColor -->
<h3 class="fn" id="textBackgroundColor"><a name="textBackgroundColor"></a><span class="type"><a href="../qtgui/qcolor.html">QColor</a></span> QTextEdit::<span class="name">textBackgroundColor</span>() const</h3>
<p>Returns the text background color of the current format.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qtextedit.html#setTextBackgroundColor">setTextBackgroundColor</a>().</p>
<!-- @@@textBackgroundColor -->
<!-- $$$textChanged -->
<h3 class="fn" id="textChanged"><a name="textChanged"></a><code>[signal] </code><span class="type">void</span> QTextEdit::<span class="name">textChanged</span>()</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>Note:</b> Notifier signal for property <a href="qtextedit.html#html-prop">html</a>. </p><!-- @@@textChanged -->
<!-- $$$textColor[overload1]$$$textColor -->
<h3 class="fn" id="textColor"><a name="textColor"></a><span class="type"><a href="../qtgui/qcolor.html">QColor</a></span> QTextEdit::<span class="name">textColor</span>() const</h3>
<p>Returns the text color of the current format.</p>
<p><b>See also </b><a href="qtextedit.html#setTextColor">setTextColor</a>().</p>
<!-- @@@textColor -->
<!-- $$$textCursor[overload1]$$$textCursor -->
<h3 class="fn" id="textCursor"><a name="textCursor"></a><span class="type"><a href="../qtgui/qtextcursor.html">QTextCursor</a></span> QTextEdit::<span class="name">textCursor</span>() const</h3>
<p>Returns a copy of the <a href="../qtgui/qtextcursor.html">QTextCursor</a> that represents the currently visible cursor. Note that changes on the returned cursor do not affect <a href="qtextedit.html">QTextEdit</a>'s cursor; use <a href="qtextedit.html#setTextCursor">setTextCursor</a>() to update the visible cursor.</p>
<p><b>See also </b><a href="qtextedit.html#setTextCursor">setTextCursor</a>().</p>
<!-- @@@textCursor -->
<!-- $$$toPlainText -->
<h3 class="fn" id="toPlainText"><a name="toPlainText"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QTextEdit::<span class="name">toPlainText</span>() const</h3>
<p><a href="../qtcore/qstring.html">QString</a> QTextEdit::toPlainText() const</p>
<p>Returns the text of the text edit as plain text.</p>
<p><b>Note:</b> Getter function for property <a href="qtextedit.html#plainText-prop">plainText</a>. </p><p><b>See also </b><a href="qtextedit.html#setPlainText">QTextEdit::setPlainText</a>().</p>
<!-- @@@toPlainText -->
<!-- $$$undo[overload1]$$$undo -->
<h3 class="fn" id="undo"><a name="undo"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">undo</span>()</h3>
<p>Undoes the last operation.</p>
<p>If there is no operation to undo, i.e&#x2e; there is no undo step in the undo/redo history, nothing happens.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qtextedit.html#redo">redo</a>().</p>
<!-- @@@undo -->
<!-- $$$undoAvailable[overload1]$$$undoAvailablebool -->
<h3 class="fn" id="undoAvailable"><a name="undoAvailable"></a><code>[signal] </code><span class="type">void</span> QTextEdit::<span class="name">undoAvailable</span>(<span class="type">bool</span> <i>available</i>)</h3>
<p>This signal is emitted whenever undo operations become available (<i>available</i> is true) or unavailable (<i>available</i> is false).</p>
<!-- @@@undoAvailable -->
<!-- $$$wheelEvent[overload1]$$$wheelEventQWheelEvent* -->
<h3 class="fn" id="wheelEvent"><a name="wheelEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextEdit::<span class="name">wheelEvent</span>(<span class="type"><a href="../qtgui/qwheelevent.html">QWheelEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#wheelEvent">QAbstractScrollArea::wheelEvent</a>().</p>
<!-- @@@wheelEvent -->
<!-- $$$zoomIn[overload1]$$$zoomInint -->
<h3 class="fn" id="zoomIn"><a name="zoomIn"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">zoomIn</span>(<span class="type">int</span> <i>range</i> = 1)</h3>
<p>Zooms in on the text by making the base font size <i>range</i> points larger and recalculating all font sizes to be the new size. This does not change the size of any images.</p>
<p><b>See also </b><a href="qtextedit.html#zoomOut">zoomOut</a>().</p>
<!-- @@@zoomIn -->
<!-- $$$zoomOut[overload1]$$$zoomOutint -->
<h3 class="fn" id="zoomOut"><a name="zoomOut"></a><code>[slot] </code><span class="type">void</span> QTextEdit::<span class="name">zoomOut</span>(<span class="type">int</span> <i>range</i> = 1)</h3>
<p>Zooms out on the text by making the base font size <i>range</i> points smaller and recalculating all font sizes to be the new size. This does not change the size of any images.</p>
<p><b>See also </b><a href="qtextedit.html#zoomIn">zoomIn</a>().</p>
<!-- @@@zoomOut -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    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.<br/>    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. </p>
</div>
</body>
</html>