source: trunk/doc/html/qtextedit.html@ 190

Last change on this file since 190 was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 108.3 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qtextedit.cpp:205 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QTextEdit Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QTextEdit Class Reference</h1>
33
34<p>The QTextEdit widget provides a powerful single-page rich text editor.
35<a href="#details">More...</a>
36<p><tt>#include &lt;<a href="qtextedit-h.html">qtextedit.h</a>&gt;</tt>
37<p>Inherits <a href="qscrollview.html">QScrollView</a>.
38<p>Inherited by <a href="qmultilineedit.html">QMultiLineEdit</a>, <a href="qtextbrowser.html">QTextBrowser</a>, and <a href="qtextview.html">QTextView</a>.
39<p><a href="qtextedit-members.html">List of all member functions.</a>
40<h2>Public Members</h2>
41<ul>
42<li class=fn>enum <a href="#WordWrap-enum"><b>WordWrap</b></a> { NoWrap, WidgetWidth, FixedPixelWidth, FixedColumnWidth }</li>
43<li class=fn>enum <a href="#WrapPolicy-enum"><b>WrapPolicy</b></a> { AtWordBoundary, AtWhiteSpace = AtWordBoundary, Anywhere, AtWordOrDocumentBoundary }</li>
44<li class=fn>enum <a href="#AutoFormatting-enum"><b>AutoFormatting</b></a> { AutoNone = 0, AutoBulletList = 0x00000001, AutoAll = 0xffffffff }</li>
45<li class=fn>enum <a href="#KeyboardAction-enum"><b>KeyboardAction</b></a> { ActionBackspace, ActionDelete, ActionReturn, ActionKill, ActionWordBackspace, ActionWordDelete }</li>
46<li class=fn>enum <a href="#CursorAction-enum"><b>CursorAction</b></a> { MoveBackward, MoveForward, MoveWordBackward, MoveWordForward, MoveUp, MoveDown, MoveLineStart, MoveLineEnd, MoveHome, MoveEnd, MovePgUp, MovePgDown }</li>
47<li class=fn>enum <a href="#VerticalAlignment-enum"><b>VerticalAlignment</b></a> { AlignNormal, AlignSuperScript, AlignSubScript }</li>
48<li class=fn><a href="#QTextEdit"><b>QTextEdit</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;text, const&nbsp;QString&nbsp;&amp;&nbsp;context = QString::null, QWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
49<li class=fn><a href="#QTextEdit-2"><b>QTextEdit</b></a> ( QWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
50<li class=fn>QString <a href="#text"><b>text</b></a> () const</li>
51<li class=fn>QString <a href="#text-2"><b>text</b></a> ( int&nbsp;para ) const</li>
52<li class=fn>TextFormat <a href="#textFormat"><b>textFormat</b></a> () const</li>
53<li class=fn>QString <a href="#context"><b>context</b></a> () const</li>
54<li class=fn>QString <a href="#documentTitle"><b>documentTitle</b></a> () const</li>
55<li class=fn>void <a href="#getSelection"><b>getSelection</b></a> ( int&nbsp;*&nbsp;paraFrom, int&nbsp;*&nbsp;indexFrom, int&nbsp;*&nbsp;paraTo, int&nbsp;*&nbsp;indexTo, int&nbsp;selNum = 0 ) const</li>
56<li class=fn>virtual bool <a href="#find"><b>find</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;expr, bool&nbsp;cs, bool&nbsp;wo, bool&nbsp;forward = TRUE, int&nbsp;*&nbsp;para = 0, int&nbsp;*&nbsp;index = 0 )</li>
57<li class=fn>int <a href="#paragraphs"><b>paragraphs</b></a> () const</li>
58<li class=fn>int <a href="#lines"><b>lines</b></a> () const</li>
59<li class=fn>int <a href="#linesOfParagraph"><b>linesOfParagraph</b></a> ( int&nbsp;para ) const</li>
60<li class=fn>int <a href="#lineOfChar"><b>lineOfChar</b></a> ( int&nbsp;para, int&nbsp;index )</li>
61<li class=fn>int <a href="#length"><b>length</b></a> () const</li>
62<li class=fn>QRect <a href="#paragraphRect"><b>paragraphRect</b></a> ( int&nbsp;para ) const</li>
63<li class=fn>int <a href="#paragraphAt"><b>paragraphAt</b></a> ( const&nbsp;QPoint&nbsp;&amp;&nbsp;pos ) const</li>
64<li class=fn>int <a href="#charAt"><b>charAt</b></a> ( const&nbsp;QPoint&nbsp;&amp;&nbsp;pos, int&nbsp;*&nbsp;para ) const</li>
65<li class=fn>int <a href="#paragraphLength"><b>paragraphLength</b></a> ( int&nbsp;para ) const</li>
66<li class=fn>QStyleSheet * <a href="#styleSheet"><b>styleSheet</b></a> () const</li>
67<li class=fn>QMimeSourceFactory * <a href="#mimeSourceFactory"><b>mimeSourceFactory</b></a> () const</li>
68<li class=fn>QBrush <a href="#paper"><b>paper</b></a> () const</li>
69<li class=fn>bool <a href="#linkUnderline"><b>linkUnderline</b></a> () const</li>
70<li class=fn>virtual int <a href="#heightForWidth"><b>heightForWidth</b></a> ( int&nbsp;w ) const</li>
71<li class=fn>bool <a href="#hasSelectedText"><b>hasSelectedText</b></a> () const</li>
72<li class=fn>QString <a href="#selectedText"><b>selectedText</b></a> () const</li>
73<li class=fn>bool <a href="#isUndoAvailable"><b>isUndoAvailable</b></a> () const</li>
74<li class=fn>bool <a href="#isRedoAvailable"><b>isRedoAvailable</b></a> () const</li>
75<li class=fn>WordWrap <a href="#wordWrap"><b>wordWrap</b></a> () const</li>
76<li class=fn>int <a href="#wrapColumnOrWidth"><b>wrapColumnOrWidth</b></a> () const</li>
77<li class=fn>WrapPolicy <a href="#wrapPolicy"><b>wrapPolicy</b></a> () const</li>
78<li class=fn>int <a href="#tabStopWidth"><b>tabStopWidth</b></a> () const</li>
79<li class=fn>QString <a href="#anchorAt-2"><b>anchorAt</b></a> ( const&nbsp;QPoint&nbsp;&amp;&nbsp;pos )</li>
80<li class=fn>QString <a href="#anchorAt"><b>anchorAt</b></a> ( const&nbsp;QPoint&nbsp;&amp;&nbsp;pos, AnchorAttribute&nbsp;attr )</li>
81<li class=fn>bool <a href="#isReadOnly"><b>isReadOnly</b></a> () const</li>
82<li class=fn>void <a href="#getCursorPosition"><b>getCursorPosition</b></a> ( int&nbsp;*&nbsp;para, int&nbsp;*&nbsp;index ) const</li>
83<li class=fn>bool <a href="#isModified"><b>isModified</b></a> () const</li>
84<li class=fn>bool <a href="#italic"><b>italic</b></a> () const</li>
85<li class=fn>bool <a href="#bold"><b>bold</b></a> () const</li>
86<li class=fn>bool <a href="#underline"><b>underline</b></a> () const</li>
87<li class=fn>QString <a href="#family"><b>family</b></a> () const</li>
88<li class=fn>int <a href="#pointSize"><b>pointSize</b></a> () const</li>
89<li class=fn>QColor <a href="#color"><b>color</b></a> () const</li>
90<li class=fn>QFont font () const &nbsp;<em>(obsolete)</em></li>
91<li class=fn>QFont <a href="#currentFont"><b>currentFont</b></a> () const</li>
92<li class=fn>int <a href="#alignment"><b>alignment</b></a> () const</li>
93<li class=fn>int <a href="#undoDepth"><b>undoDepth</b></a> () const</li>
94<li class=fn>bool <a href="#isOverwriteMode"><b>isOverwriteMode</b></a> () const</li>
95<li class=fn>QColor <a href="#paragraphBackgroundColor"><b>paragraphBackgroundColor</b></a> ( int&nbsp;para ) const</li>
96<li class=fn>bool <a href="#isUndoRedoEnabled"><b>isUndoRedoEnabled</b></a> () const</li>
97<li class=fn>bool <a href="#tabChangesFocus"><b>tabChangesFocus</b></a> () const</li>
98<li class=fn>void <a href="#setAutoFormatting"><b>setAutoFormatting</b></a> ( uint&nbsp;features )</li>
99<li class=fn>uint <a href="#autoFormatting"><b>autoFormatting</b></a> () const</li>
100<li class=fn>QSyntaxHighlighter * <a href="#syntaxHighlighter"><b>syntaxHighlighter</b></a> () const</li>
101</ul>
102<h2>Public Slots</h2>
103<ul>
104<li class=fn>virtual void <a href="#setMimeSourceFactory"><b>setMimeSourceFactory</b></a> ( QMimeSourceFactory&nbsp;*&nbsp;factory )</li>
105<li class=fn>virtual void <a href="#setStyleSheet"><b>setStyleSheet</b></a> ( QStyleSheet&nbsp;*&nbsp;styleSheet )</li>
106<li class=fn>virtual void <a href="#scrollToAnchor"><b>scrollToAnchor</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name )</li>
107<li class=fn>virtual void <a href="#setPaper"><b>setPaper</b></a> ( const&nbsp;QBrush&nbsp;&amp;&nbsp;pap )</li>
108<li class=fn>virtual void <a href="#setLinkUnderline"><b>setLinkUnderline</b></a> ( bool )</li>
109<li class=fn>virtual void <a href="#setWordWrap"><b>setWordWrap</b></a> ( WordWrap&nbsp;mode )</li>
110<li class=fn>virtual void <a href="#setWrapColumnOrWidth"><b>setWrapColumnOrWidth</b></a> ( int )</li>
111<li class=fn>virtual void <a href="#setWrapPolicy"><b>setWrapPolicy</b></a> ( WrapPolicy&nbsp;policy )</li>
112<li class=fn>virtual void <a href="#copy"><b>copy</b></a> ()</li>
113<li class=fn>virtual void <a href="#append"><b>append</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;text )</li>
114<li class=fn>void <a href="#setText"><b>setText</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;txt )</li>
115<li class=fn>virtual void <a href="#setText-2"><b>setText</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;text, const&nbsp;QString&nbsp;&amp;&nbsp;context )</li>
116<li class=fn>virtual void <a href="#setTextFormat"><b>setTextFormat</b></a> ( TextFormat&nbsp;f )</li>
117<li class=fn>virtual void <a href="#selectAll"><b>selectAll</b></a> ( bool&nbsp;select = TRUE )</li>
118<li class=fn>virtual void <a href="#setTabStopWidth"><b>setTabStopWidth</b></a> ( int&nbsp;ts )</li>
119<li class=fn>virtual void <a href="#zoomIn"><b>zoomIn</b></a> ( int&nbsp;range )</li>
120<li class=fn>virtual void <a href="#zoomIn-2"><b>zoomIn</b></a> ()</li>
121<li class=fn>virtual void <a href="#zoomOut"><b>zoomOut</b></a> ( int&nbsp;range )</li>
122<li class=fn>virtual void <a href="#zoomOut-2"><b>zoomOut</b></a> ()</li>
123<li class=fn>virtual void <a href="#zoomTo"><b>zoomTo</b></a> ( int&nbsp;size )</li>
124<li class=fn>virtual void <a href="#sync"><b>sync</b></a> ()</li>
125<li class=fn>virtual void <a href="#setReadOnly"><b>setReadOnly</b></a> ( bool&nbsp;b )</li>
126<li class=fn>virtual void <a href="#undo"><b>undo</b></a> ()</li>
127<li class=fn>virtual void <a href="#redo"><b>redo</b></a> ()</li>
128<li class=fn>virtual void <a href="#cut"><b>cut</b></a> ()</li>
129<li class=fn>virtual void <a href="#paste"><b>paste</b></a> ()</li>
130<li class=fn>virtual void <a href="#pasteSubType"><b>pasteSubType</b></a> ( const&nbsp;QCString&nbsp;&amp;&nbsp;subtype )</li>
131<li class=fn>virtual void <a href="#clear"><b>clear</b></a> ()</li>
132<li class=fn>virtual void <a href="#del"><b>del</b></a> ()</li>
133<li class=fn>virtual void <a href="#setItalic"><b>setItalic</b></a> ( bool&nbsp;b )</li>
134<li class=fn>virtual void <a href="#setBold"><b>setBold</b></a> ( bool&nbsp;b )</li>
135<li class=fn>virtual void <a href="#setUnderline"><b>setUnderline</b></a> ( bool&nbsp;b )</li>
136<li class=fn>virtual void <a href="#setFamily"><b>setFamily</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;fontFamily )</li>
137<li class=fn>virtual void <a href="#setPointSize"><b>setPointSize</b></a> ( int&nbsp;s )</li>
138<li class=fn>virtual void <a href="#setColor"><b>setColor</b></a> ( const&nbsp;QColor&nbsp;&amp;&nbsp;c )</li>
139<li class=fn>virtual void <a href="#setVerticalAlignment"><b>setVerticalAlignment</b></a> ( VerticalAlignment&nbsp;a )</li>
140<li class=fn>virtual void <a href="#setAlignment"><b>setAlignment</b></a> ( int&nbsp;a )</li>
141<li class=fn>virtual void <a href="#setCursorPosition"><b>setCursorPosition</b></a> ( int&nbsp;para, int&nbsp;index )</li>
142<li class=fn>virtual void <a href="#setSelection"><b>setSelection</b></a> ( int&nbsp;paraFrom, int&nbsp;indexFrom, int&nbsp;paraTo, int&nbsp;indexTo, int&nbsp;selNum = 0 )</li>
143<li class=fn>virtual void <a href="#setSelectionAttributes"><b>setSelectionAttributes</b></a> ( int&nbsp;selNum, const&nbsp;QColor&nbsp;&amp;&nbsp;back, bool&nbsp;invertText )</li>
144<li class=fn>virtual void <a href="#setModified"><b>setModified</b></a> ( bool&nbsp;m )</li>
145<li class=fn>virtual void <a href="#setUndoDepth"><b>setUndoDepth</b></a> ( int&nbsp;d )</li>
146<li class=fn>virtual void <a href="#ensureCursorVisible"><b>ensureCursorVisible</b></a> ()</li>
147<li class=fn>virtual void <a href="#placeCursor"><b>placeCursor</b></a> ( const&nbsp;QPoint&nbsp;&amp;&nbsp;pos, QTextCursor&nbsp;*&nbsp;c = 0 )</li>
148<li class=fn>virtual void <a href="#moveCursor"><b>moveCursor</b></a> ( CursorAction&nbsp;action, bool&nbsp;select )</li>
149<li class=fn>virtual void <a href="#doKeyboardAction"><b>doKeyboardAction</b></a> ( KeyboardAction&nbsp;action )</li>
150<li class=fn>virtual void <a href="#removeSelectedText"><b>removeSelectedText</b></a> ( int&nbsp;selNum = 0 )</li>
151<li class=fn>virtual void <a href="#removeSelection"><b>removeSelection</b></a> ( int&nbsp;selNum = 0 )</li>
152<li class=fn>virtual void <a href="#setCurrentFont"><b>setCurrentFont</b></a> ( const&nbsp;QFont&nbsp;&amp;&nbsp;f )</li>
153<li class=fn>virtual void <a href="#setOverwriteMode"><b>setOverwriteMode</b></a> ( bool&nbsp;b )</li>
154<li class=fn>virtual void <a href="#scrollToBottom"><b>scrollToBottom</b></a> ()</li>
155<li class=fn>void <a href="#insert"><b>insert</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;text, uint&nbsp;insertionFlags = CheckNewLines | RemoveSelected )</li>
156<li class=fn>virtual void insert ( const&nbsp;QString&nbsp;&amp;&nbsp;text, bool&nbsp;indent, bool&nbsp;checkNewLine = TRUE, bool&nbsp;removeSelected = TRUE ) &nbsp;<em>(obsolete)</em></li>
157<li class=fn>virtual void <a href="#insertAt"><b>insertAt</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;text, int&nbsp;para, int&nbsp;index )</li>
158<li class=fn>virtual void <a href="#removeParagraph"><b>removeParagraph</b></a> ( int&nbsp;para )</li>
159<li class=fn>virtual void <a href="#insertParagraph"><b>insertParagraph</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;text, int&nbsp;para )</li>
160<li class=fn>virtual void <a href="#setParagraphBackgroundColor"><b>setParagraphBackgroundColor</b></a> ( int&nbsp;para, const&nbsp;QColor&nbsp;&amp;&nbsp;bg )</li>
161<li class=fn>virtual void <a href="#clearParagraphBackground"><b>clearParagraphBackground</b></a> ( int&nbsp;para )</li>
162<li class=fn>virtual void <a href="#setUndoRedoEnabled"><b>setUndoRedoEnabled</b></a> ( bool&nbsp;b )</li>
163<li class=fn>void <a href="#setTabChangesFocus"><b>setTabChangesFocus</b></a> ( bool&nbsp;b )</li>
164<li class=fn>void <a href="#setMaxLogLines"><b>setMaxLogLines</b></a> ( int&nbsp;limit )</li>
165<li class=fn>int <a href="#maxLogLines"><b>maxLogLines</b></a> ()</li>
166</ul>
167<h2>Signals</h2>
168<ul>
169<li class=fn>void <a href="#textChanged"><b>textChanged</b></a> ()</li>
170<li class=fn>void <a href="#selectionChanged"><b>selectionChanged</b></a> ()</li>
171<li class=fn>void <a href="#copyAvailable"><b>copyAvailable</b></a> ( bool&nbsp;yes )</li>
172<li class=fn>void <a href="#undoAvailable"><b>undoAvailable</b></a> ( bool&nbsp;yes )</li>
173<li class=fn>void <a href="#redoAvailable"><b>redoAvailable</b></a> ( bool&nbsp;yes )</li>
174<li class=fn>void <a href="#currentFontChanged"><b>currentFontChanged</b></a> ( const&nbsp;QFont&nbsp;&amp;&nbsp;f )</li>
175<li class=fn>void <a href="#currentColorChanged"><b>currentColorChanged</b></a> ( const&nbsp;QColor&nbsp;&amp;&nbsp;c )</li>
176<li class=fn>void <a href="#currentAlignmentChanged"><b>currentAlignmentChanged</b></a> ( int&nbsp;a )</li>
177<li class=fn>void <a href="#currentVerticalAlignmentChanged"><b>currentVerticalAlignmentChanged</b></a> ( VerticalAlignment&nbsp;a )</li>
178<li class=fn>void <a href="#cursorPositionChanged"><b>cursorPositionChanged</b></a> ( int&nbsp;para, int&nbsp;pos )</li>
179<li class=fn>void <a href="#returnPressed"><b>returnPressed</b></a> ()</li>
180<li class=fn>void <a href="#modificationChanged"><b>modificationChanged</b></a> ( bool&nbsp;m )</li>
181<li class=fn>void <a href="#clicked"><b>clicked</b></a> ( int&nbsp;para, int&nbsp;pos )</li>
182<li class=fn>void <a href="#doubleClicked"><b>doubleClicked</b></a> ( int&nbsp;para, int&nbsp;pos )</li>
183</ul>
184<h2>Properties</h2>
185<ul>
186<li class=fn>AutoFormatting <a href="#autoFormatting-prop"><b>autoFormatting</b></a>&nbsp;- the enabled set of auto formatting features</li>
187<li class=fn>QString <a href="#documentTitle-prop"><b>documentTitle</b></a>&nbsp;- the title of the document parsed from the text &nbsp;<em>(read only)</em></li>
188<li class=fn>bool <a href="#hasSelectedText-prop"><b>hasSelectedText</b></a>&nbsp;- whether some text is selected in selection 0 &nbsp;<em>(read only)</em></li>
189<li class=fn>int <a href="#length-prop"><b>length</b></a>&nbsp;- the number of characters in the text &nbsp;<em>(read only)</em></li>
190<li class=fn>bool <a href="#linkUnderline-prop"><b>linkUnderline</b></a>&nbsp;- whether hypertext links will be underlined</li>
191<li class=fn>bool <a href="#modified-prop"><b>modified</b></a>&nbsp;- whether the document has been modified by the user</li>
192<li class=fn>bool <a href="#overwriteMode-prop"><b>overwriteMode</b></a>&nbsp;- the text edit's overwrite mode</li>
193<li class=fn>QBrush <a href="#paper-prop"><b>paper</b></a>&nbsp;- the background (paper) brush</li>
194<li class=fn>bool <a href="#readOnly-prop"><b>readOnly</b></a>&nbsp;- whether the text edit is read-only</li>
195<li class=fn>QString <a href="#selectedText-prop"><b>selectedText</b></a>&nbsp;- the selected text (from selection 0) or an empty string if there is no currently selected text (in selection 0) &nbsp;<em>(read only)</em></li>
196<li class=fn>bool <a href="#tabChangesFocus-prop"><b>tabChangesFocus</b></a>&nbsp;- whether TAB changes focus or is accepted as input</li>
197<li class=fn>int <a href="#tabStopWidth-prop"><b>tabStopWidth</b></a>&nbsp;- the tab stop width in pixels</li>
198<li class=fn>QString <a href="#text-prop"><b>text</b></a>&nbsp;- the text edit's text</li>
199<li class=fn>TextFormat <a href="#textFormat-prop"><b>textFormat</b></a>&nbsp;- the text format: rich text, plain text, log text or auto text</li>
200<li class=fn>int <a href="#undoDepth-prop"><b>undoDepth</b></a>&nbsp;- the depth of the undo history</li>
201<li class=fn>bool <a href="#undoRedoEnabled-prop"><b>undoRedoEnabled</b></a>&nbsp;- whether undo/redo is enabled</li>
202<li class=fn>WordWrap <a href="#wordWrap-prop"><b>wordWrap</b></a>&nbsp;- the word wrap mode</li>
203<li class=fn>int <a href="#wrapColumnOrWidth-prop"><b>wrapColumnOrWidth</b></a>&nbsp;- the position (in pixels or columns depending on the wrap mode) where text will be wrapped</li>
204<li class=fn>WrapPolicy <a href="#wrapPolicy-prop"><b>wrapPolicy</b></a>&nbsp;- the word wrap policy, at whitespace or anywhere</li>
205</ul>
206<h2>Protected Members</h2>
207<ul>
208<li class=fn>void <a href="#repaintChanged"><b>repaintChanged</b></a> ()</li>
209<li class=fn>virtual void <a href="#keyPressEvent"><b>keyPressEvent</b></a> ( QKeyEvent&nbsp;*&nbsp;e )</li>
210<li class=fn>virtual bool <a href="#focusNextPrevChild"><b>focusNextPrevChild</b></a> ( bool&nbsp;n )</li>
211<li class=fn>QTextCursor * <a href="#textCursor"><b>textCursor</b></a> () const</li>
212<li class=fn>virtual QPopupMenu * <a href="#createPopupMenu"><b>createPopupMenu</b></a> ( const&nbsp;QPoint&nbsp;&amp;&nbsp;pos )</li>
213<li class=fn>virtual QPopupMenu * createPopupMenu () &nbsp;<em>(obsolete)</em></li>
214</ul>
215<hr><a name="details"></a><h2>Detailed Description</h2>
216
217
218The QTextEdit widget provides a powerful single-page rich text editor.
219<p>
220
221
222<p> <!-- toc -->
223<ul>
224<li><a href="#1"> Introduction and Concepts
225</a>
226<li><a href="#1-1"> Using QTextEdit as a Display Widget
227</a>
228<ul>
229<li><a href="#1-1-1"> Read-only key bindings
230</a>
231<li><a href="#1-1-2"> Using QTextEdit in LogText Mode
232</a>
233</ul>
234<li><a href="#1-2"> Using QTextEdit as an Editor
235</a>
236<ul>
237<li><a href="#1-2-1"> Editing key bindings
238</a>
239</ul>
240</ul>
241<!-- endtoc -->
242
243<p> <h3> Introduction and Concepts
244</h3>
245<a name="1"></a><p> QTextEdit is an advanced WYSIWYG viewer/editor supporting rich
246text formatting using HTML-style tags. It is optimized to handle
247large documents and to respond quickly to user input.
248<p> QTextEdit has four modes of operation:
249<center><table cellpadding="4" cellspacing="2" border="0">
250<tr bgcolor="#a2c511"> <th valign="top">Mode <th valign="top">Command <th valign="top">Notes
251<tr bgcolor="#f0f0f0"> <td valign="top">Plain Text Editor <td valign="top">setTextFormat(PlainText)
252<td valign="top">Set text with <a href="#setText">setText</a>(); <a href="#text">text</a>() returns plain text. Text
253attributes (e.g. colors) can be set, but plain text is always
254returned.
255<tr bgcolor="#d0d0d0"> <td valign="top">Rich Text Editor <td valign="top">setTextFormat(RichText)
256<td valign="top">Set text with setText(); text() returns rich text. Rich
257text editing is fairly limited. You can't set margins or
258insert images for example (although you can read and
259correctly display files that have margins set and that
260include images). This mode is mostly useful for editing small
261amounts of rich text. <sup>1.</sup>
262<tr bgcolor="#f0f0f0"> <td valign="top">Text Viewer <td valign="top">setReadOnly(TRUE)
263<td valign="top">Set text with setText() or <a href="#append">append</a>() (which has no undo
264history so is faster and uses less memory); text() returns
265plain or rich text depending on the <a href="#textFormat">textFormat</a>(). This mode
266can correctly display a large subset of HTML tags.
267<tr bgcolor="#d0d0d0"> <td valign="top">Log Viewer <td valign="top">setTextFormat(LogText)
268<td valign="top">Append text using append(). The widget is set to be read
269only and rich text support is disabled although a few HTML
270tags (for color, bold, italic and underline) may be used.
271(See <a href="#logtextmode">LogText mode</a> for details.)
272</table></center>
273<p> <sup>1.</sup><small>A more complete API that supports setting
274margins, images, etc., is planned for a later Qt release.</small>
275<p> QTextEdit can be used as a syntax highlighting editor when used in
276conjunction with <a href="qsyntaxhighlighter.html">QSyntaxHighlighter</a>.
277<p> We recommend that you always call <a href="#setTextFormat">setTextFormat</a>() to set the mode
278you want to use. If you use <a href="qt.html#TextFormat-enum">AutoText</a> then <a href="#setText">setText</a>() and
279<a href="#append">append</a>() will try to determine whether the text they are given is
280plain text or rich text. If you use <a href="qt.html#TextFormat-enum">RichText</a> then setText() and
281append() will assume that the text they are given is rich text.
282<a href="#insert">insert</a>() simply inserts the text it is given.
283<p> QTextEdit works on paragraphs and characters. A paragraph is a
284formatted string which is word-wrapped to fit into the width of
285the widget. By default when reading plain text, one newline
286signify a paragraph. A document consists of zero or more
287paragraphs, indexed from 0. Characters are indexed on a
288per-paragraph basis, also indexed from 0. The words in the
289paragraph are aligned in accordance with the paragraph's
290<a href="#alignment">alignment</a>(). Paragraphs are separated by hard line breaks. Each
291character within a paragraph has its own attributes, for example,
292font and color.
293<p> The text edit documentation uses the following concepts:
294<ul>
295<li> <em>current format</em> --
296this is the format at the current cursor position, <em>and</em> it
297is the format of the selected text if any.
298<li> <em>current paragraph</em> -- the paragraph which contains the
299cursor.
300</ul>
301<p> QTextEdit can display images (using <a href="qmimesourcefactory.html">QMimeSourceFactory</a>), lists and
302tables. If the text is too large to view within the text edit's
303viewport, scrollbars will appear. The text edit can load both
304plain text and HTML files (a subset of HTML 3.2 and 4). The
305rendering style and the set of valid tags are defined by a
306<a href="#styleSheet">styleSheet</a>(). Custom tags can be created and placed in a custom
307style sheet. Change the style sheet with <a href="#setStyleSheet">setStyleSheet</a>(); see
308<a href="qstylesheet.html">QStyleSheet</a> for details. The images identified by image tags are
309displayed if they can be interpreted using the text edit's
310<a href="qmimesourcefactory.html">QMimeSourceFactory</a>; see <a href="#setMimeSourceFactory">setMimeSourceFactory</a>().
311<p> If you want a text browser with more navigation use <a href="qtextbrowser.html">QTextBrowser</a>.
312If you just need to display a small piece of rich text use <a href="qlabel.html">QLabel</a>
313or <a href="qsimplerichtext.html">QSimpleRichText</a>.
314<p> If you create a new QTextEdit, and want to allow the user to edit
315rich text, call <a href="#setTextFormat">setTextFormat</a>(Qt::RichText) to ensure that the
316text is treated as rich text. (Rich text uses HTML tags to set
317text formatting attributes. See QStyleSheet for information on the
318HTML tags that are supported.). If you don't call setTextFormat()
319explicitly the text edit will guess from the text itself whether
320it is rich text or plain text. This means that if the text looks
321like HTML or XML it will probably be interpreted as rich text, so
322you should call setTextFormat(Qt::PlainText) to preserve such
323text.
324<p> Note that we do not intend to add a full-featured web browser
325widget to Qt (because that would easily double Qt's size and only
326a few applications would benefit from it). The rich
327text support in Qt is designed to provide a fast, portable and
328efficient way to add reasonable online help facilities to
329applications, and to provide a basis for rich text editors.
330<p> <h3> Using QTextEdit as a Display Widget
331</h3>
332<a name="1-1"></a><p> QTextEdit can display a large HTML subset, including tables and
333images.
334<p> The text is set or replaced using <a href="#setText">setText</a>() which deletes any
335existing text and replaces it with the text passed in the
336setText() call. If you call setText() with legacy HTML (with
337<a href="#setTextFormat">setTextFormat</a>(RichText) in force), and then call <a href="#text">text</a>(), the text
338that is returned may have different markup, but will render the
339same. Text can be inserted with <a href="#insert">insert</a>(), <a href="#paste">paste</a>(), <a href="#pasteSubType">pasteSubType</a>()
340and <a href="#append">append</a>(). Text that is appended does not go into the undo
341history; this makes append() faster and consumes less memory. Text
342can also be <a href="#cut">cut</a>(). The entire text is deleted with <a href="#clear">clear</a>() and the
343selected text is deleted with <a href="#removeSelectedText">removeSelectedText</a>(). Selected
344(marked) text can also be deleted with <a href="#del">del</a>() (which will delete
345the character to the right of the cursor if no text is selected).
346<p> Loading and saving text is achieved using <a href="#setText">setText</a>() and text(),
347for example:
348<pre>
349 <a href="qfile.html">QFile</a> file( fileName ); // Read the text from a file
350 if ( file.<a href="qfile.html#open">open</a>( <a href="qfile.html#open">IO_ReadOnly</a> ) ) {
351 <a href="qtextstream.html">QTextStream</a> stream( &amp;file );
352 textEdit-&gt;setText( stream.<a href="qtextstream.html#read">read</a>() );
353 }
354
355 <a href="qfile.html">QFile</a> file( fileName ); // Write the text to a file
356 if ( file.<a href="qfile.html#open">open</a>( <a href="qfile.html#open">IO_WriteOnly</a> ) ) {
357 <a href="qtextstream.html">QTextStream</a> stream( &amp;file );
358 stream &lt;&lt; textEdit-&gt;text();
359 textEdit-&gt;setModified( FALSE );
360 }
361 </pre>
362
363<p> By default the text edit wraps words at whitespace to fit within
364the text edit widget. The <a href="#setWordWrap">setWordWrap</a>() function is used to
365specify the kind of word wrap you want, or <a href="#WordWrap-enum">NoWrap</a> if you don't
366want any wrapping. Call setWordWrap() to set a fixed pixel width
367<a href="#WordWrap-enum">FixedPixelWidth</a>, or character column (e.g. 80 column) <a href="#WordWrap-enum">FixedColumnWidth</a> with the pixels or columns specified with
368<a href="#setWrapColumnOrWidth">setWrapColumnOrWidth</a>(). If you use word wrap to the widget's width
369<a href="#WordWrap-enum">WidgetWidth</a>, you can specify whether to break on whitespace or
370anywhere with <a href="#setWrapPolicy">setWrapPolicy</a>().
371<p> The background color is set differently than other widgets, using
372<a href="#setPaper">setPaper</a>(). You specify a brush style which could be a plain color
373or a complex pixmap.
374<p> Hypertext links are automatically underlined; this can be changed
375with <a href="#setLinkUnderline">setLinkUnderline</a>(). The tab stop width is set with
376<a href="#setTabStopWidth">setTabStopWidth</a>().
377<p> The <a href="#zoomIn">zoomIn</a>() and <a href="#zoomOut">zoomOut</a>() functions can be used to resize the
378text by increasing (decreasing for zoomOut()) the point size used.
379Images are not affected by the zoom functions.
380<p> The <a href="#lines">lines</a>() function returns the number of lines in the text and
381<a href="#paragraphs">paragraphs</a>() returns the number of paragraphs. The number of lines
382within a particular paragraph is returned by <a href="#linesOfParagraph">linesOfParagraph</a>().
383The length of the entire text in characters is returned by
384<a href="#length">length</a>().
385<p> You can scroll to an anchor in the text, e.g.
386<tt>&lt;a name="anchor"&gt;</tt> with <a href="#scrollToAnchor">scrollToAnchor</a>(). The <a href="#find">find</a>() function
387can be used to find and select a given string within the text.
388<p> A read-only QTextEdit provides the same functionality as the
389(obsolete) QTextView. (QTextView is still supplied for
390compatibility with old code.)
391<p> <h4> Read-only key bindings
392</h4>
393<a name="1-1-1"></a><p> When QTextEdit is used read-only the key-bindings are limited to
394navigation, and text may only be selected with the mouse:
395<center><table cellpadding="4" cellspacing="2" border="0">
396<tr bgcolor="#a2c511"> <th valign="top">Keypresses <th valign="top">Action
397<tr bgcolor="#f0f0f0"> <td valign="top">UpArrow <td valign="top">Move one line up
398<tr bgcolor="#d0d0d0"> <td valign="top">DownArrow <td valign="top">Move one line down
399<tr bgcolor="#f0f0f0"> <td valign="top">LeftArrow <td valign="top">Move one character left
400<tr bgcolor="#d0d0d0"> <td valign="top">RightArrow <td valign="top">Move one character right
401<tr bgcolor="#f0f0f0"> <td valign="top">PageUp <td valign="top">Move one (viewport) page up
402<tr bgcolor="#d0d0d0"> <td valign="top">PageDown <td valign="top">Move one (viewport) page down
403<tr bgcolor="#f0f0f0"> <td valign="top">Home <td valign="top">Move to the beginning of the text
404<tr bgcolor="#d0d0d0"> <td valign="top">End <td valign="top">Move to the end of the text
405<tr bgcolor="#f0f0f0"> <td valign="top">Shift+Wheel
406<td valign="top">Scroll the page horizontally (the Wheel is the mouse wheel)
407<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+Wheel <td valign="top">Zoom the text
408</table></center>
409<p> The text edit may be able to provide some meta-information. For
410example, the <a href="#documentTitle">documentTitle</a>() function will return the text from
411within HTML <tt>&lt;title&gt;</tt> tags.
412<p> The text displayed in a text edit has a <em>context</em>. The context is
413a path which the text edit's <a href="qmimesourcefactory.html">QMimeSourceFactory</a> uses to resolve
414the locations of files and images. It is passed to the
415<a href="#mimeSourceFactory">mimeSourceFactory</a>() when quering data. (See QTextEdit() and
416<a href="#context">context</a>().)
417<p> <a name="logtextmode"></a>
418<h4> Using QTextEdit in LogText Mode
419</h4>
420<a name="1-1-2"></a><p> Setting the text format to <a href="qt.html#TextFormat-enum">LogText</a> puts the widget in a special
421mode which is optimized for very large texts. Editing, word wrap,
422and rich text support are disabled in this mode (the widget is
423explicitly made read-only). This allows the text to be stored in a
424different, more memory efficient manner. However, a certain degree
425of text formatting is supported through the use of formatting tags.
426A tag is delimited by <tt>&lt;</tt> and <tt>&gt;</tt>. The characters <tt>&lt;</tt>, <tt>&gt;</tt>
427and <tt>&amp;</tt> are escaped by using <tt>&amp;lt;</tt>, <tt>&amp;gt;</tt> and <tt>&amp;amp;</tt>.
428A tag pair consists of a left and a right tag (or open/close tags).
429Left-tags mark the starting point for formatting, while right-tags
430mark the ending point. A right-tag always start with a <tt>/</tt> before
431the tag keyword. For example <tt>&lt;b&gt;</tt> and <tt>&lt;/b&gt;</tt> are a tag pair.
432Tags can be nested, but they have to be closed in the same order as
433they are opened. For example, <tt>&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;</tt> is valid, while <tt>&lt;b&gt;&lt;u&gt;&lt;/b&gt;&lt;/u&gt;</tt> will output an error message.
434<p> By using tags it is possible to change the color, bold, italic and
435underline settings for a piece of text. A color can be specified
436by using the HTML font tag <tt>&lt;font color=colorname&gt;</tt>. The color
437name can be one of the color names from the X11 color database, or
438a RGB hex value (e.g <tt>#00ff00</tt>). Example of valid color tags:
439<tt>&lt;font color=red&gt;</tt>, <tt>&lt;font color="light blue"&gt;</tt>, <tt>&lt;font color="#223344"&gt;</tt>. Bold, italic and underline settings can be
440specified by the tags <tt>&lt;b&gt;</tt>, <tt>&lt;i&gt;</tt> and <tt>&lt;u&gt;</tt>. Note that a
441tag does not necessarily have to be closed. A valid example:
442<pre>
443 This is &lt;font color=red&gt;red&lt;/font&gt; while &lt;b&gt;this&lt;/b&gt; is &lt;font color=blue&gt;blue&lt;/font&gt;.
444 &lt;font color=green&gt;&lt;font color=yellow&gt;Yellow,&lt;/font&gt; and &lt;u&gt;green&lt;/u&gt;.
445 </pre>
446
447<p> Stylesheets can also be used in LogText mode. To create and use a
448custom tag, you could do the following:
449<pre>
450 QTextEdit * log = new QTextEdit( this );
451 log-&gt;<a href="#setTextFormat">setTextFormat</a>( Qt::<a href="qt.html#TextFormat-enum">LogText</a> );
452 <a href="qstylesheetitem.html">QStyleSheetItem</a> * item = new <a href="qstylesheetitem.html">QStyleSheetItem</a>( log-&gt;<a href="#styleSheet">styleSheet</a>(), "mytag" );
453 item-&gt;<a href="qstylesheetitem.html#setColor">setColor</a>( "red" );
454 item-&gt;<a href="qstylesheetitem.html#setFontWeight">setFontWeight</a>( QFont::Bold );
455 item-&gt;<a href="qstylesheetitem.html#setFontUnderline">setFontUnderline</a>( TRUE );
456 log-&gt;<a href="#append">append</a>( "This is a &lt;mytag&gt;custom tag&lt;/mytag&gt;!" );
457 </pre>
458
459Note that only the color, bold, underline and italic attributes of
460a <a href="qstylesheetitem.html">QStyleSheetItem</a> is used in LogText mode.
461<p> Note that you can use <a href="#setMaxLogLines">setMaxLogLines</a>() to limit the number of
462lines the widget can hold in LogText mode.
463<p> There are a few things that you need to be aware of when the
464widget is in this mode:
465<ul>
466<li> Functions that deal with rich text formatting and cursor
467movement will not work or return anything valid.
468<li> Lines are equivalent to paragraphs.
469</ul>
470<p> <h3> Using QTextEdit as an Editor
471</h3>
472<a name="1-2"></a><p> All the information about using QTextEdit as a display widget also
473applies here.
474<p> The current format's attributes are set with <a href="#setItalic">setItalic</a>(),
475<a href="#setBold">setBold</a>(), <a href="#setUnderline">setUnderline</a>(), <a href="#setFamily">setFamily</a>() (font family),
476<a href="#setPointSize">setPointSize</a>(), <a href="#setColor">setColor</a>() and <a href="#setCurrentFont">setCurrentFont</a>(). The current
477paragraph's alignment is set with <a href="#setAlignment">setAlignment</a>().
478<p> Use <a href="#setSelection">setSelection</a>() to select text. The <a href="#setSelectionAttributes">setSelectionAttributes</a>()
479function is used to indicate how selected text should be
480displayed. Use <a href="#hasSelectedText">hasSelectedText</a>() to find out if any text is
481selected. The currently selected text's position is available
482using <a href="#getSelection">getSelection</a>() and the selected text itself is returned by
483<a href="#selectedText">selectedText</a>(). The selection can be copied to the clipboard with
484<a href="#copy">copy</a>(), or cut to the clipboard with <a href="#cut">cut</a>(). It can be deleted with
485<a href="#removeSelectedText">removeSelectedText</a>(). The entire text can be selected (or
486unselected) using <a href="#selectAll">selectAll</a>(). QTextEdit supports multiple
487selections. Most of the selection functions operate on the default
488selection, selection 0. If the user presses a non-selecting key,
489e.g. a cursor key without also holding down Shift, all selections
490are cleared.
491<p> Set and get the position of the cursor with <a href="#setCursorPosition">setCursorPosition</a>()
492and <a href="#getCursorPosition">getCursorPosition</a>() respectively. When the cursor is moved,
493the signals <a href="#currentFontChanged">currentFontChanged</a>(), <a href="#currentColorChanged">currentColorChanged</a>() and
494<a href="#currentAlignmentChanged">currentAlignmentChanged</a>() are emitted to reflect the font, color
495and alignment at the new cursor position.
496<p> If the text changes, the <a href="#textChanged">textChanged</a>() signal is emitted, and if
497the user inserts a new line by pressing Return or Enter,
498<a href="#returnPressed">returnPressed</a>() is emitted. The <a href="#isModified">isModified</a>() function will return
499TRUE if the text has been modified.
500<p> QTextEdit provides command-based undo and redo. To set the depth
501of the command history use <a href="#setUndoDepth">setUndoDepth</a>() which defaults to 100
502steps. To undo or redo the last operation call <a href="#undo">undo</a>() or <a href="#redo">redo</a>().
503The signals <a href="#undoAvailable">undoAvailable</a>() and <a href="#redoAvailable">redoAvailable</a>() indicate whether
504the undo and redo operations can be executed.
505<p> The indent() function is used to reindent a paragraph. It is
506useful for code editors, for example in <a href="designer-manual.html">Qt Designer</a>'s code editor <em>Ctrl+I</em> invokes the indent()
507function.
508<p> <h4> Editing key bindings
509</h4>
510<a name="1-2-1"></a><p> The list of key-bindings which are implemented for editing:
511<center><table cellpadding="4" cellspacing="2" border="0">
512<tr bgcolor="#a2c511"> <th valign="top">Keypresses <th valign="top">Action
513<tr bgcolor="#f0f0f0"> <td valign="top">Backspace <td valign="top">Delete the character to the left of the cursor
514<tr bgcolor="#d0d0d0"> <td valign="top">Delete <td valign="top">Delete the character to the right of the cursor
515<tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+A <td valign="top">Move the cursor to the beginning of the line
516<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+B <td valign="top">Move the cursor one character left
517<tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+C <td valign="top">Copy the marked text to the clipboard (also
518Ctrl+Insert under Windows)
519<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+D <td valign="top">Delete the character to the right of the cursor
520<tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+E <td valign="top">Move the cursor to the end of the line
521<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+F <td valign="top">Move the cursor one character right
522<tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+H <td valign="top">Delete the character to the left of the cursor
523<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+K <td valign="top">Delete to end of line
524<tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+N <td valign="top">Move the cursor one line down
525<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+P <td valign="top">Move the cursor one line up
526<tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+V <td valign="top">Paste the clipboard text into line edit
527(also Shift+Insert under Windows)
528<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+X <td valign="top">Cut the marked text, copy to clipboard
529(also Shift+Delete under Windows)
530<tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+Z <td valign="top">Undo the last operation
531<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+Y <td valign="top">Redo the last operation
532<tr bgcolor="#f0f0f0"> <td valign="top">LeftArrow <td valign="top">Move the cursor one character left
533<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+LeftArrow <td valign="top">Move the cursor one word left
534<tr bgcolor="#f0f0f0"> <td valign="top">RightArrow <td valign="top">Move the cursor one character right
535<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+RightArrow <td valign="top">Move the cursor one word right
536<tr bgcolor="#f0f0f0"> <td valign="top">UpArrow <td valign="top">Move the cursor one line up
537<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+UpArrow <td valign="top">Move the cursor one word up
538<tr bgcolor="#f0f0f0"> <td valign="top">DownArrow <td valign="top">Move the cursor one line down
539<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+Down Arrow <td valign="top">Move the cursor one word down
540<tr bgcolor="#f0f0f0"> <td valign="top">PageUp <td valign="top">Move the cursor one page up
541<tr bgcolor="#d0d0d0"> <td valign="top">PageDown <td valign="top">Move the cursor one page down
542<tr bgcolor="#f0f0f0"> <td valign="top">Home <td valign="top">Move the cursor to the beginning of the line
543<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+Home <td valign="top">Move the cursor to the beginning of the text
544<tr bgcolor="#f0f0f0"> <td valign="top">End <td valign="top">Move the cursor to the end of the line
545<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+End <td valign="top">Move the cursor to the end of the text
546<tr bgcolor="#f0f0f0"> <td valign="top">Shift+Wheel <td valign="top">Scroll the page horizontally
547(the Wheel is the mouse wheel)
548<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+Wheel <td valign="top">Zoom the text
549</table></center>
550<p> To select (mark) text hold down the Shift key whilst pressing one
551of the movement keystrokes, for example, <em>Shift+Right Arrow</em>
552will select the character to the right, and <em>Shift+Ctrl+Right Arrow</em> will select the word to the right, etc.
553<p> By default the text edit widget operates in insert mode so all
554text that the user enters is inserted into the text edit and any
555text to the right of the cursor is moved out of the way. The mode
556can be changed to overwrite, where new text overwrites any text to
557the right of the cursor, using <a href="#setOverwriteMode">setOverwriteMode</a>().
558<p>See also <a href="basic.html">Basic Widgets</a> and <a href="text.html">Text Related Classes</a>.
559
560<hr><h2>Member Type Documentation</h2>
561<h3 class=fn><a name="AutoFormatting-enum"></a>QTextEdit::AutoFormatting</h3>
562
563<ul>
564<li><tt>QTextEdit::AutoNone</tt> - Do not perform any automatic formatting
565<li><tt>QTextEdit::AutoBulletList</tt> - Only automatically format bulletted lists
566<li><tt>QTextEdit::AutoAll</tt> - Apply all available autoformatting
567</ul>
568<h3 class=fn><a name="CursorAction-enum"></a>QTextEdit::CursorAction</h3>
569
570<p> This enum is used by <a href="#moveCursor">moveCursor</a>() to specify in which direction
571the cursor should be moved:
572<ul>
573<li><tt>QTextEdit::MoveBackward</tt> - Moves the cursor one character backward
574<li><tt>QTextEdit::MoveWordBackward</tt> - Moves the cursor one word backward
575<li><tt>QTextEdit::MoveForward</tt> - Moves the cursor one character forward
576<li><tt>QTextEdit::MoveWordForward</tt> - Moves the cursor one word forward
577<li><tt>QTextEdit::MoveUp</tt> - Moves the cursor up one line
578<li><tt>QTextEdit::MoveDown</tt> - Moves the cursor down one line
579<li><tt>QTextEdit::MoveLineStart</tt> - Moves the cursor to the beginning of the line
580<li><tt>QTextEdit::MoveLineEnd</tt> - Moves the cursor to the end of the line
581<li><tt>QTextEdit::MoveHome</tt> - Moves the cursor to the beginning of the document
582<li><tt>QTextEdit::MoveEnd</tt> - Moves the cursor to the end of the document
583<li><tt>QTextEdit::MovePgUp</tt> - Moves the cursor one viewport page up
584<li><tt>QTextEdit::MovePgDown</tt> - Moves the cursor one viewport page down
585</ul>
586<h3 class=fn><a name="KeyboardAction-enum"></a>QTextEdit::KeyboardAction</h3>
587
588<p> This enum is used by <a href="#doKeyboardAction">doKeyboardAction</a>() to specify which action
589should be executed:
590<ul>
591<li><tt>QTextEdit::ActionBackspace</tt> - Delete the character to the left of the
592cursor.
593<li><tt>QTextEdit::ActionDelete</tt> - Delete the character to the right of the
594cursor.
595<li><tt>QTextEdit::ActionReturn</tt> - Split the paragraph at the cursor position.
596<li><tt>QTextEdit::ActionKill</tt> - If the cursor is not at the end of the
597paragraph, delete the text from the cursor position until the end
598of the paragraph. If the cursor is at the end of the paragraph,
599delete the hard line break at the end of the paragraph: this will
600cause this paragraph to be joined with the following paragraph.
601<li><tt>QTextEdit::ActionWordBackspace</tt> - Delete the word to the left of the
602cursor position.
603<li><tt>QTextEdit::ActionWordDelete</tt> - Delete the word to the right of the
604cursor position
605</ul><p>
606<h3 class=fn><a name="VerticalAlignment-enum"></a>QTextEdit::VerticalAlignment</h3>
607
608<p> This enum is used to set the vertical alignment of the text.
609<ul>
610<li><tt>QTextEdit::AlignNormal</tt> - Normal alignment
611<li><tt>QTextEdit::AlignSuperScript</tt> - Superscript
612<li><tt>QTextEdit::AlignSubScript</tt> - Subscript
613</ul>
614<h3 class=fn><a name="WordWrap-enum"></a>QTextEdit::WordWrap</h3>
615
616<p> This enum defines the QTextEdit's word wrap modes.
617<ul>
618<li><tt>QTextEdit::NoWrap</tt> - Do not wrap the text.
619<li><tt>QTextEdit::WidgetWidth</tt> - Wrap the text at the current width of the
620widget (this is the default). Wrapping is at whitespace by
621default; this can be changed with <a href="#setWrapPolicy">setWrapPolicy</a>().
622<li><tt>QTextEdit::FixedPixelWidth</tt> - Wrap the text at a fixed number of pixels
623from the widget's left side. The number of pixels is set with
624<a href="#wrapColumnOrWidth">wrapColumnOrWidth</a>().
625<li><tt>QTextEdit::FixedColumnWidth</tt> - Wrap the text at a fixed number of
626character columns from the widget's left side. The number of
627characters is set with wrapColumnOrWidth(). This is useful if you
628need formatted text that can also be displayed gracefully on
629devices with monospaced fonts, for example a standard VT100
630terminal, where you might set wrapColumnOrWidth() to 80.
631</ul><p> <p>See also <a href="#wordWrap-prop">wordWrap</a> and <a href="#wordWrap-prop">wordWrap</a>.
632
633<h3 class=fn><a name="WrapPolicy-enum"></a>QTextEdit::WrapPolicy</h3>
634
635<p> This enum defines where text can be wrapped in word wrap mode.
636<ul>
637<li><tt>QTextEdit::AtWhiteSpace</tt> - Don't use this deprecated value (it is a
638synonym for <a href="#WrapPolicy-enum">AtWordBoundary</a> which you should use instead).
639<li><tt>QTextEdit::Anywhere</tt> - Break anywhere, including within words.
640<li><tt>QTextEdit::AtWordBoundary</tt> - Break lines at word boundaries, e.g. spaces or
641newlines
642<li><tt>QTextEdit::AtWordOrDocumentBoundary</tt> - Break lines at whitespace, e.g.
643spaces or newlines if possible. Break it anywhere otherwise.
644</ul><p> <p>See also <a href="#wrapPolicy-prop">wrapPolicy</a>.
645
646<hr><h2>Member Function Documentation</h2>
647<h3 class=fn><a name="QTextEdit"></a>QTextEdit::QTextEdit ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;context = QString::null, <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )
648</h3>
649Constructs a QTextEdit called <em>name</em>, with parent <em>parent</em>. The
650text edit will display the text <em>text</em> using context <em>context</em>.
651<p> The <em>context</em> is a path which the text edit's <a href="qmimesourcefactory.html">QMimeSourceFactory</a>
652uses to resolve the locations of files and images. It is passed to
653the <a href="#mimeSourceFactory">mimeSourceFactory</a>() when quering data.
654<p> For example if the text contains an image tag,
655<tt>&lt;img src="image.png"&gt;</tt>, and the context is "path/to/look/in", the
656QMimeSourceFactory will try to load the image from
657"path/to/look/in/image.png". If the tag was
658<tt>&lt;img src="/image.png"&gt;</tt>, the context will not be used (because
659QMimeSourceFactory recognizes that we have used an absolute path)
660and will try to load "/image.png". The context is applied in exactly
661the same way to <em>hrefs</em>, for example,
662<tt>&lt;a href="target.html"&gt;Target&lt;/a&gt;</tt>, would resolve to
663"path/to/look/in/target.html".
664
665<h3 class=fn><a name="QTextEdit-2"></a>QTextEdit::QTextEdit ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )
666</h3>
667Constructs an empty QTextEdit called <em>name</em>, with parent <em>parent</em>.
668
669<h3 class=fn>int <a name="alignment"></a>QTextEdit::alignment () const
670</h3>
671Returns the alignment of the current paragraph.
672<p> <p>See also <a href="#setAlignment">setAlignment</a>().
673
674<h3 class=fn><a href="qstring.html">QString</a> <a name="anchorAt"></a>QTextEdit::anchorAt ( const&nbsp;<a href="qpoint.html">QPoint</a>&nbsp;&amp;&nbsp;pos, <a href="qt.html#AnchorAttribute-enum">AnchorAttribute</a>&nbsp;attr )
675</h3>
676If there is an anchor at position <em>pos</em> (in contents
677coordinates), the text for attribute <em>attr</em> is returned,
678otherwise <a href="qstring.html#QString-null">QString::null</a> is returned.
679
680<h3 class=fn><a href="qstring.html">QString</a> <a name="anchorAt-2"></a>QTextEdit::anchorAt ( const&nbsp;<a href="qpoint.html">QPoint</a>&nbsp;&amp;&nbsp;pos )
681</h3>
682This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
683<p> If there is an anchor at position <em>pos</em> (in contents
684coordinates), its <tt>href</tt> is returned, otherwise <a href="qstring.html#QString-null">QString::null</a> is
685returned.
686
687<h3 class=fn>void <a name="append"></a>QTextEdit::append ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text )<tt> [virtual slot]</tt>
688</h3>
689Appends a new paragraph with <em>text</em> to the end of the text edit. Note that
690the undo/redo history is cleared by this function, and no undo
691history is kept for appends which makes them faster than
692<a href="#insert">insert</a>()s. If you want to append text which is added to the
693undo/redo history as well, use <a href="#insertParagraph">insertParagraph</a>().
694
695<p>Examples: <a href="clientserver-example.html#x805">network/clientserver/client/client.cpp</a>, <a href="clientserver-example.html#x786">network/clientserver/server/server.cpp</a>, <a href="httpd-example.html#x734">network/httpd/httpd.cpp</a>, and <a href="process-example.html#x103">process/process.cpp</a>.
696<h3 class=fn>uint <a name="autoFormatting"></a>QTextEdit::autoFormatting () const
697</h3><p>Returns the enabled set of auto formatting features.
698See the <a href="qtextedit.html#autoFormatting-prop">"autoFormatting"</a> property for details.
699<h3 class=fn>bool <a name="bold"></a>QTextEdit::bold () const
700</h3>
701Returns TRUE if the current format is bold; otherwise returns FALSE.
702<p> <p>See also <a href="#setBold">setBold</a>().
703
704<h3 class=fn>int <a name="charAt"></a>QTextEdit::charAt ( const&nbsp;<a href="qpoint.html">QPoint</a>&nbsp;&amp;&nbsp;pos, int&nbsp;*&nbsp;para ) const
705</h3>
706Returns the index of the character (relative to its paragraph) at
707position <em>pos</em> (in contents coordinates). If <em>para</em> is not 0,
708<em>*para</em> is set to the character's paragraph.
709
710<h3 class=fn>void <a name="clear"></a>QTextEdit::clear ()<tt> [virtual slot]</tt>
711</h3>
712Deletes all the text in the text edit.
713<p> <p>See also <a href="#cut">cut</a>(), <a href="#removeSelectedText">removeSelectedText</a>(), and <a href="#text-prop">text</a>.
714
715<h3 class=fn>void <a name="clearParagraphBackground"></a>QTextEdit::clearParagraphBackground ( int&nbsp;para )<tt> [virtual slot]</tt>
716</h3>
717Clears the background color of the paragraph <em>para</em>, so that the
718default color is used again.
719
720<h3 class=fn>void <a name="clicked"></a>QTextEdit::clicked ( int&nbsp;para, int&nbsp;pos )<tt> [signal]</tt>
721</h3>
722
723<p> This signal is emitted when the mouse is clicked on the paragraph
724<em>para</em> at character position <em>pos</em>.
725<p> <p>See also <a href="#doubleClicked">doubleClicked</a>().
726
727<h3 class=fn><a href="qcolor.html">QColor</a> <a name="color"></a>QTextEdit::color () const
728</h3>
729Returns the color of the current format.
730<p> <p>See also <a href="#setColor">setColor</a>() and <a href="#paper-prop">paper</a>.
731
732<h3 class=fn><a href="qstring.html">QString</a> <a name="context"></a>QTextEdit::context () const
733</h3>
734Returns the context of the text edit. The context is a path which
735the text edit's <a href="qmimesourcefactory.html">QMimeSourceFactory</a> uses to resolve the locations
736of files and images.
737<p> <p>See also <a href="#text-prop">text</a>.
738
739<p>Examples: <a href="qaction-application-example.html#x1164">action/application.cpp</a>, <a href="simple-application-example.html#x1582">application/application.cpp</a>, <a href="helpviewer-example.html#x1028">helpviewer/helpwindow.cpp</a>, <a href="mdi-example.html#x2068">mdi/application.cpp</a>, and <a href="qdir-example.html#x1843">qdir/qdir.cpp</a>.
740<h3 class=fn>void <a name="copy"></a>QTextEdit::copy ()<tt> [virtual slot]</tt>
741</h3>
742Copies any selected text (from selection 0) to the clipboard.
743<p> <p>See also <a href="#hasSelectedText-prop">hasSelectedText</a> and <a href="#copyAvailable">copyAvailable</a>().
744
745<h3 class=fn>void <a name="copyAvailable"></a>QTextEdit::copyAvailable ( bool&nbsp;yes )<tt> [signal]</tt>
746</h3>
747
748<p> This signal is emitted when text is selected or de-selected in the
749text edit.
750<p> When text is selected this signal will be emitted with <em>yes</em> set
751to TRUE. If no text has been selected or if the selected text is
752de-selected this signal is emitted with <em>yes</em> set to FALSE.
753<p> If <em>yes</em> is TRUE then <a href="#copy">copy</a>() can be used to copy the selection to
754the clipboard. If <em>yes</em> is FALSE then copy() does nothing.
755<p> <p>See also <a href="#selectionChanged">selectionChanged</a>().
756
757<h3 class=fn><a href="qpopupmenu.html">QPopupMenu</a>&nbsp;* <a name="createPopupMenu"></a>QTextEdit::createPopupMenu ( const&nbsp;<a href="qpoint.html">QPoint</a>&nbsp;&amp;&nbsp;pos )<tt> [virtual protected]</tt>
758</h3>
759This function is called to create a right mouse button popup menu
760at the document position <em>pos</em>. If you want to create a custom
761popup menu, reimplement this function and return the created popup
762menu. Ownership of the popup menu is transferred to the caller.
763<p> <b>Warning:</b> The <a href="qpopupmenu.html">QPopupMenu</a> ID values 0-7 are reserved, and they map to the
764standard operations. When inserting items into your custom popup menu, be
765sure to specify ID values larger than 7.
766
767<h3 class=fn><a href="qpopupmenu.html">QPopupMenu</a>&nbsp;* <a name="createPopupMenu-2"></a>QTextEdit::createPopupMenu ()<tt> [virtual protected]</tt>
768</h3> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
769<p> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
770<p> This function is called to create a right mouse button popup menu.
771If you want to create a custom popup menu, reimplement this function
772and return the created popup menu. Ownership of the popup menu is
773transferred to the caller.
774<p> This function is only called if <a href="#createPopupMenu">createPopupMenu</a>( const <a href="qpoint.html">QPoint</a> & )
775returns 0.
776
777<h3 class=fn>void <a name="currentAlignmentChanged"></a>QTextEdit::currentAlignmentChanged ( int&nbsp;a )<tt> [signal]</tt>
778</h3>
779
780<p> This signal is emitted if the alignment of the current paragraph
781has changed.
782<p> The new alignment is <em>a</em>.
783<p> <p>See also <a href="#setAlignment">setAlignment</a>().
784
785<h3 class=fn>void <a name="currentColorChanged"></a>QTextEdit::currentColorChanged ( const&nbsp;<a href="qcolor.html">QColor</a>&nbsp;&amp;&nbsp;c )<tt> [signal]</tt>
786</h3>
787
788<p> This signal is emitted if the color of the current format has
789changed.
790<p> The new color is <em>c</em>.
791<p> <p>See also <a href="#setColor">setColor</a>().
792
793<h3 class=fn><a href="qfont.html">QFont</a> <a name="currentFont"></a>QTextEdit::currentFont () const
794</h3>
795Returns the font of the current format.
796<p> <p>See also <a href="#setCurrentFont">setCurrentFont</a>(), <a href="#setFamily">setFamily</a>(), and <a href="#setPointSize">setPointSize</a>().
797
798<h3 class=fn>void <a name="currentFontChanged"></a>QTextEdit::currentFontChanged ( const&nbsp;<a href="qfont.html">QFont</a>&nbsp;&amp;&nbsp;f )<tt> [signal]</tt>
799</h3>
800
801<p> This signal is emitted if the font of the current format has
802changed.
803<p> The new font is <em>f</em>.
804<p> <p>See also <a href="#setCurrentFont">setCurrentFont</a>().
805
806<h3 class=fn>void <a name="currentVerticalAlignmentChanged"></a>QTextEdit::currentVerticalAlignmentChanged ( <a href="qtextedit.html#VerticalAlignment-enum">VerticalAlignment</a>&nbsp;a )<tt> [signal]</tt>
807</h3>
808
809<p> This signal is emitted if the vertical alignment of the current
810format has changed.
811<p> The new vertical alignment is <em>a</em>.
812<p> <p>See also <a href="#setVerticalAlignment">setVerticalAlignment</a>().
813
814<h3 class=fn>void <a name="cursorPositionChanged"></a>QTextEdit::cursorPositionChanged ( int&nbsp;para, int&nbsp;pos )<tt> [signal]</tt>
815</h3>
816
817<p> This signal is emitted if the position of the cursor has changed.
818<em>para</em> contains the paragraph index and <em>pos</em> contains the
819character position within the paragraph.
820<p> <p>See also <a href="#setCursorPosition">setCursorPosition</a>().
821
822<h3 class=fn>void <a name="cut"></a>QTextEdit::cut ()<tt> [virtual slot]</tt>
823</h3>
824Copies the selected text (from selection 0) to the clipboard and
825deletes it from the text edit.
826<p> If there is no selected text (in selection 0) nothing happens.
827<p> <p>See also <a href="#copy">QTextEdit::copy</a>(), <a href="#paste">paste</a>(), and <a href="#pasteSubType">pasteSubType</a>().
828
829<h3 class=fn>void <a name="del"></a>QTextEdit::del ()<tt> [virtual slot]</tt>
830</h3>
831If there is some selected text (in selection 0) it is deleted. If
832there is no selected text (in selection 0) the character to the
833right of the text cursor is deleted.
834<p> <p>See also <a href="#removeSelectedText">removeSelectedText</a>() and <a href="#cut">cut</a>().
835
836<h3 class=fn>void <a name="doKeyboardAction"></a>QTextEdit::doKeyboardAction ( <a href="qtextedit.html#KeyboardAction-enum">KeyboardAction</a>&nbsp;action )<tt> [virtual slot]</tt>
837</h3>
838Executes keyboard action <em>action</em>. This is normally called by a
839key event handler.
840
841<h3 class=fn><a href="qstring.html">QString</a> <a name="documentTitle"></a>QTextEdit::documentTitle () const
842</h3><p>Returns the title of the document parsed from the text.
843See the <a href="qtextedit.html#documentTitle-prop">"documentTitle"</a> property for details.
844<h3 class=fn>void <a name="doubleClicked"></a>QTextEdit::doubleClicked ( int&nbsp;para, int&nbsp;pos )<tt> [signal]</tt>
845</h3>
846<p> This signal is emitted when the mouse is double-clicked on the
847paragraph <em>para</em> at character position <em>pos</em>.
848<p> <p>See also <a href="#clicked">clicked</a>().
849
850<h3 class=fn>void <a name="ensureCursorVisible"></a>QTextEdit::ensureCursorVisible ()<tt> [virtual slot]</tt>
851</h3>
852Ensures that the cursor is visible by scrolling the text edit if
853necessary.
854<p> <p>See also <a href="#setCursorPosition">setCursorPosition</a>().
855
856<h3 class=fn><a href="qstring.html">QString</a> <a name="family"></a>QTextEdit::family () const
857</h3>
858Returns the font family of the current format.
859<p> <p>See also <a href="#setFamily">setFamily</a>(), <a href="#setCurrentFont">setCurrentFont</a>(), and <a href="#setPointSize">setPointSize</a>().
860
861<h3 class=fn>bool <a name="find"></a>QTextEdit::find ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;expr, bool&nbsp;cs, bool&nbsp;wo, bool&nbsp;forward = TRUE, int&nbsp;*&nbsp;para = 0, int&nbsp;*&nbsp;index = 0 )<tt> [virtual]</tt>
862</h3>
863Finds the next occurrence of the string, <em>expr</em>. Returns TRUE if
864<em>expr</em> was found; otherwise returns FALSE.
865<p> If <em>para</em> and <em>index</em> are both 0 the search begins from the
866current cursor position. If <em>para</em> and <em>index</em> are both not 0,
867the search begins from the <em>*index</em> character position in the
868<em>*para</em> paragraph.
869<p> If <em>cs</em> is TRUE the search is case sensitive, otherwise it is
870case insensitive. If <em>wo</em> is TRUE the search looks for whole word
871matches only; otherwise it searches for any matching text. If <em>forward</em> is TRUE (the default) the search works forward from the
872starting position to the end of the text, otherwise it works
873backwards to the beginning of the text.
874<p> If <em>expr</em> is found the function returns TRUE. If <em>index</em> and <em>para</em> are not 0, the number of the paragraph in which the first
875character of the match was found is put into <em>*para</em>, and the
876index position of that character within the paragraph is put into
877<em>*index</em>.
878<p> If <em>expr</em> is not found the function returns FALSE. If <em>index</em>
879and <em>para</em> are not 0 and <em>expr</em> is not found, <em>*index</em>
880and <em>*para</em> are undefined.
881<p> Please note that this function will make the next occurrence of
882the string (if found) the current selection, and will thus
883modify the cursor position.
884<p> Using the <em>para</em> and <em>index</em> parameters will not work correctly
885in case the document contains tables.
886
887<h3 class=fn>bool <a name="focusNextPrevChild"></a>QTextEdit::focusNextPrevChild ( bool&nbsp;n )<tt> [virtual protected]</tt>
888</h3>
889Reimplemented to allow tabbing through links. If <em>n</em> is TRUE the
890tab moves the focus to the next child; if <em>n</em> is FALSE the tab
891moves the focus to the previous child. Returns TRUE if the focus
892was moved; otherwise returns FALSE.
893
894<h3 class=fn><a href="qfont.html">QFont</a> <a name="font"></a>QTextEdit::font () const
895</h3>
896<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
897<p> Returns <a href="qwidget.html#font">QScrollView::font</a>()
898<p> <b>Warning:</b> In previous versions this function returned the font of
899the current format. This lead to confusion. Please use
900<a href="#currentFont">currentFont</a>() instead.
901
902<p>Example: <a href="qwerty-example.html#x396">qwerty/qwerty.cpp</a>.
903<h3 class=fn>void <a name="getCursorPosition"></a>QTextEdit::getCursorPosition ( int&nbsp;*&nbsp;para, int&nbsp;*&nbsp;index ) const
904</h3>
905This function sets the <em>*para</em> and <em>*index</em> parameters to the
906current cursor position. <em>para</em> and <em>index</em> must not be 0.
907<p> <p>See also <a href="#setCursorPosition">setCursorPosition</a>().
908
909<h3 class=fn>void <a name="getSelection"></a>QTextEdit::getSelection ( int&nbsp;*&nbsp;paraFrom, int&nbsp;*&nbsp;indexFrom, int&nbsp;*&nbsp;paraTo, int&nbsp;*&nbsp;indexTo, int&nbsp;selNum = 0 ) const
910</h3>
911If there is a selection, <em>*paraFrom</em> is set to the number of the
912paragraph in which the selection begins and <em>*paraTo</em> is set to
913the number of the paragraph in which the selection ends. (They
914could be the same.) <em>*indexFrom</em> is set to the index at which the
915selection begins within <em>*paraFrom</em>, and <em>*indexTo</em> is set to
916the index at which the selection ends within <em>*paraTo</em>.
917<p> If there is no selection, <em>*paraFrom</em>, <em>*indexFrom</em>, <em>*paraTo</em>
918and <em>*indexTo</em> are all set to -1.
919<p> If <em>paraFrom</em>, <em>indexFrom</em>, <em>paraTo</em> or <em>indexTo</em> is 0 this
920function does nothing.
921<p> The <em>selNum</em> is the number of the selection (multiple selections
922are supported). It defaults to 0 (the default selection).
923<p> <p>See also <a href="#setSelection">setSelection</a>() and <a href="#selectedText-prop">selectedText</a>.
924
925<h3 class=fn>bool <a name="hasSelectedText"></a>QTextEdit::hasSelectedText () const
926</h3><p>Returns TRUE if some text is selected in selection 0; otherwise returns FALSE.
927See the <a href="qtextedit.html#hasSelectedText-prop">"hasSelectedText"</a> property for details.
928<h3 class=fn>int <a name="heightForWidth"></a>QTextEdit::heightForWidth ( int&nbsp;w ) const<tt> [virtual]</tt>
929</h3>
930Returns how many pixels high the text edit needs to be to display
931all the text if the text edit is <em>w</em> pixels wide.
932
933<p>Reimplemented from <a href="qwidget.html#heightForWidth">QWidget</a>.
934<h3 class=fn>void <a name="insert"></a>QTextEdit::insert ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, uint&nbsp;insertionFlags = CheckNewLines | RemoveSelected )<tt> [slot]</tt>
935</h3>
936Inserts <em>text</em> at the current cursor position.
937<p> The <em>insertionFlags</em> define how the text is inserted. If <a href="#TextInsertionFlags-enum">RedoIndentation</a> is set, the paragraph is re-indented. If <a href="#TextInsertionFlags-enum">CheckNewLines</a> is set, newline characters in <em>text</em> result in hard
938line breaks (i.e. new paragraphs). If <tt>checkNewLine</tt> is not set,
939the behaviour of the editor is undefined if the <em>text</em> contains
940newlines. (It is not possible to change QTextEdit's newline handling
941behavior, but you can use <a href="qstring.html#replace">QString::replace</a>() to preprocess text
942before inserting it.) If <a href="#TextInsertionFlags-enum">RemoveSelected</a> is set, any selected
943text (in selection 0) is removed before the text is inserted.
944<p> The default flags are <a href="#TextInsertionFlags-enum">CheckNewLines</a> | <a href="#TextInsertionFlags-enum">RemoveSelected</a>.
945<p> If the widget is in <a href="qt.html#TextFormat-enum">LogText</a> mode this function will do nothing.
946<p> <p>See also <a href="#paste">paste</a>() and <a href="#pasteSubType">pasteSubType</a>().
947
948<h3 class=fn>void <a name="insert-2"></a>QTextEdit::insert ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, bool&nbsp;indent, bool&nbsp;checkNewLine = TRUE, bool&nbsp;removeSelected = TRUE )<tt> [virtual slot]</tt>
949</h3>
950<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
951<p>
952<h3 class=fn>void <a name="insertAt"></a>QTextEdit::insertAt ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, int&nbsp;para, int&nbsp;index )<tt> [virtual slot]</tt>
953</h3>
954Inserts <em>text</em> in the paragraph <em>para</em> at position <em>index</em>.
955
956<h3 class=fn>void <a name="insertParagraph"></a>QTextEdit::insertParagraph ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, int&nbsp;para )<tt> [virtual slot]</tt>
957</h3>
958Inserts <em>text</em> as a new paragraph at position <em>para</em>. If <em>para</em>
959is -1, the text is appended. Use <a href="#append">append</a>() if the append operation
960is performance critical.
961
962<h3 class=fn>bool <a name="isModified"></a>QTextEdit::isModified () const
963</h3><p>Returns TRUE if the document has been modified by the user; otherwise returns FALSE.
964See the <a href="qtextedit.html#modified-prop">"modified"</a> property for details.
965<h3 class=fn>bool <a name="isOverwriteMode"></a>QTextEdit::isOverwriteMode () const
966</h3><p>Returns the text edit's overwrite mode.
967See the <a href="qtextedit.html#overwriteMode-prop">"overwriteMode"</a> property for details.
968<h3 class=fn>bool <a name="isReadOnly"></a>QTextEdit::isReadOnly () const
969</h3><p>Returns TRUE if the text edit is read-only; otherwise returns FALSE.
970See the <a href="qtextedit.html#readOnly-prop">"readOnly"</a> property for details.
971<h3 class=fn>bool <a name="isRedoAvailable"></a>QTextEdit::isRedoAvailable () const
972</h3>
973Returns TRUE if redo is available; otherwise returns FALSE.
974
975<h3 class=fn>bool <a name="isUndoAvailable"></a>QTextEdit::isUndoAvailable () const
976</h3>
977Returns TRUE if undo is available; otherwise returns FALSE.
978
979<h3 class=fn>bool <a name="isUndoRedoEnabled"></a>QTextEdit::isUndoRedoEnabled () const
980</h3><p>Returns TRUE if undo/redo is enabled; otherwise returns FALSE.
981See the <a href="qtextedit.html#undoRedoEnabled-prop">"undoRedoEnabled"</a> property for details.
982<h3 class=fn>bool <a name="italic"></a>QTextEdit::italic () const
983</h3>
984Returns TRUE if the current format is italic; otherwise returns FALSE.
985<p> <p>See also <a href="#setItalic">setItalic</a>().
986
987<h3 class=fn>void <a name="keyPressEvent"></a>QTextEdit::keyPressEvent ( <a href="qkeyevent.html">QKeyEvent</a>&nbsp;*&nbsp;e )<tt> [virtual protected]</tt>
988</h3>
989Processes the key event, <em>e</em>. By default key events are used to
990provide keyboard navigation and text editing.
991
992<p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget</a>.
993<p>Reimplemented in <a href="qtextbrowser.html#keyPressEvent">QTextBrowser</a>.
994<h3 class=fn>int <a name="length"></a>QTextEdit::length () const
995</h3><p>Returns the number of characters in the text.
996See the <a href="qtextedit.html#length-prop">"length"</a> property for details.
997<h3 class=fn>int <a name="lineOfChar"></a>QTextEdit::lineOfChar ( int&nbsp;para, int&nbsp;index )
998</h3>
999Returns the line number of the line in paragraph <em>para</em> in which
1000the character at position <em>index</em> appears. The <em>index</em> position is
1001relative to the beginning of the paragraph. If there is no such
1002paragraph or no such character at the <em>index</em> position (e.g. the
1003index is out of range) -1 is returned.
1004
1005<h3 class=fn>int <a name="lines"></a>QTextEdit::lines () const
1006</h3>
1007Returns the number of lines in the text edit; this could be 0.
1008<p> <b>Warning:</b> This function may be slow. Lines change all the time
1009during word wrapping, so this function has to iterate over all the
1010paragraphs and get the number of lines from each one individually.
1011
1012<h3 class=fn>int <a name="linesOfParagraph"></a>QTextEdit::linesOfParagraph ( int&nbsp;para ) const
1013</h3>
1014Returns the number of lines in paragraph <em>para</em>, or -1 if there
1015is no paragraph with index <em>para</em>.
1016
1017<h3 class=fn>bool <a name="linkUnderline"></a>QTextEdit::linkUnderline () const
1018</h3><p>Returns TRUE if hypertext links will be underlined; otherwise returns FALSE.
1019See the <a href="qtextedit.html#linkUnderline-prop">"linkUnderline"</a> property for details.
1020<h3 class=fn>int <a name="maxLogLines"></a>QTextEdit::maxLogLines ()<tt> [slot]</tt>
1021</h3>
1022Returns the maximum number of lines QTextEdit can hold in <a href="qt.html#TextFormat-enum">LogText</a> mode. By default the number of lines is unlimited, which
1023is signified by a value of -1.
1024
1025<h3 class=fn><a href="qmimesourcefactory.html">QMimeSourceFactory</a>&nbsp;* <a name="mimeSourceFactory"></a>QTextEdit::mimeSourceFactory () const
1026</h3>
1027Returns the <a href="qmimesourcefactory.html">QMimeSourceFactory</a> which is being used by this text
1028edit.
1029<p> <p>See also <a href="#setMimeSourceFactory">setMimeSourceFactory</a>().
1030
1031<p>Examples: <a href="qaction-application-example.html#x1166">action/application.cpp</a>, <a href="simple-application-example.html#x1584">application/application.cpp</a>, <a href="helpviewer-example.html#x1030">helpviewer/helpwindow.cpp</a>, <a href="mdi-example.html#x2070">mdi/application.cpp</a>, and <a href="qdir-example.html#x1844">qdir/qdir.cpp</a>.
1032<h3 class=fn>void <a name="modificationChanged"></a>QTextEdit::modificationChanged ( bool&nbsp;m )<tt> [signal]</tt>
1033</h3>
1034
1035<p> This signal is emitted when the modification status of the
1036document has changed. If <em>m</em> is TRUE, the document was modified,
1037otherwise the modification state has been reset to unmodified.
1038<p> <p>See also <a href="#modified-prop">modified</a>.
1039
1040<h3 class=fn>void <a name="moveCursor"></a>QTextEdit::moveCursor ( <a href="qtextedit.html#CursorAction-enum">CursorAction</a>&nbsp;action, bool&nbsp;select )<tt> [virtual slot]</tt>
1041</h3>
1042Moves the text cursor according to <em>action</em>. This is normally
1043used by some key event handler. <em>select</em> specifies whether the
1044text between the current cursor position and the new position
1045should be selected.
1046
1047<h3 class=fn><a href="qbrush.html">QBrush</a> <a name="paper"></a>QTextEdit::paper () const
1048</h3><p>Returns the background (paper) brush.
1049See the <a href="qtextedit.html#paper-prop">"paper"</a> property for details.
1050<h3 class=fn>int <a name="paragraphAt"></a>QTextEdit::paragraphAt ( const&nbsp;<a href="qpoint.html">QPoint</a>&nbsp;&amp;&nbsp;pos ) const
1051</h3>
1052Returns the paragraph which is at position <em>pos</em> (in contents
1053coordinates).
1054
1055<h3 class=fn><a href="qcolor.html">QColor</a> <a name="paragraphBackgroundColor"></a>QTextEdit::paragraphBackgroundColor ( int&nbsp;para ) const
1056</h3>
1057Returns the background color of the paragraph <em>para</em> or an
1058invalid color if <em>para</em> is out of range or the paragraph has no
1059background set
1060
1061<h3 class=fn>int <a name="paragraphLength"></a>QTextEdit::paragraphLength ( int&nbsp;para ) const
1062</h3>
1063Returns the length of the paragraph <em>para</em> (i.e. the number of
1064characters), or -1 if there is no paragraph with index <em>para</em>.
1065<p> This function ignores newlines.
1066
1067<h3 class=fn><a href="qrect.html">QRect</a> <a name="paragraphRect"></a>QTextEdit::paragraphRect ( int&nbsp;para ) const
1068</h3>
1069Returns the rectangle of the paragraph <em>para</em> in contents
1070coordinates, or an invalid rectangle if <em>para</em> is out of range.
1071
1072<h3 class=fn>int <a name="paragraphs"></a>QTextEdit::paragraphs () const
1073</h3>
1074Returns the number of paragraphs in the text; an empty textedit is always
1075considered to have one paragraph, so 1 is returned in this case.
1076
1077<h3 class=fn>void <a name="paste"></a>QTextEdit::paste ()<tt> [virtual slot]</tt>
1078</h3>
1079Pastes the text from the clipboard into the text edit at the
1080current cursor position. Only plain text is pasted.
1081<p> If there is no text in the clipboard nothing happens.
1082<p> <p>See also <a href="#pasteSubType">pasteSubType</a>(), <a href="#cut">cut</a>(), and <a href="#copy">QTextEdit::copy</a>().
1083
1084<h3 class=fn>void <a name="pasteSubType"></a>QTextEdit::pasteSubType ( const&nbsp;<a href="qcstring.html">QCString</a>&nbsp;&amp;&nbsp;subtype )<tt> [virtual slot]</tt>
1085</h3>
1086Pastes the text with format <em>subtype</em> from the clipboard into the
1087text edit at the current cursor position. The <em>subtype</em> can be
1088"plain" or "html".
1089<p> If there is no text with format <em>subtype</em> in the clipboard
1090nothing happens.
1091<p> <p>See also <a href="#paste">paste</a>(), <a href="#cut">cut</a>(), and <a href="#copy">QTextEdit::copy</a>().
1092
1093<h3 class=fn>void <a name="placeCursor"></a>QTextEdit::placeCursor ( const&nbsp;<a href="qpoint.html">QPoint</a>&nbsp;&amp;&nbsp;pos, QTextCursor&nbsp;*&nbsp;c = 0 )<tt> [virtual slot]</tt>
1094</h3>
1095Places the cursor <em>c</em> at the character which is closest to position
1096<em>pos</em> (in contents coordinates). If <em>c</em> is 0, the default text
1097cursor is used.
1098<p> <p>See also <a href="#setCursorPosition">setCursorPosition</a>().
1099
1100<h3 class=fn>int <a name="pointSize"></a>QTextEdit::pointSize () const
1101</h3>
1102Returns the point size of the font of the current format.
1103<p> <p>See also <a href="#setFamily">setFamily</a>(), <a href="#setCurrentFont">setCurrentFont</a>(), and <a href="#setPointSize">setPointSize</a>().
1104
1105<h3 class=fn>void <a name="redo"></a>QTextEdit::redo ()<tt> [virtual slot]</tt>
1106</h3>
1107Redoes the last operation.
1108<p> If there is no operation to redo, i.e. there is no redo step in
1109the undo/redo history, nothing happens.
1110<p> <p>See also <a href="#redoAvailable">redoAvailable</a>(), <a href="#undo">undo</a>(), and <a href="#undoDepth-prop">undoDepth</a>.
1111
1112<h3 class=fn>void <a name="redoAvailable"></a>QTextEdit::redoAvailable ( bool&nbsp;yes )<tt> [signal]</tt>
1113</h3>
1114
1115<p> This signal is emitted when the availability of redo changes. If
1116<em>yes</em> is TRUE, then <a href="#redo">redo</a>() will work until <a href="#redoAvailable">redoAvailable</a>( FALSE )
1117is next emitted.
1118<p> <p>See also <a href="#redo">redo</a>() and <a href="#undoDepth-prop">undoDepth</a>.
1119
1120<h3 class=fn>void <a name="removeParagraph"></a>QTextEdit::removeParagraph ( int&nbsp;para )<tt> [virtual slot]</tt>
1121</h3>
1122Removes the paragraph <em>para</em>.
1123
1124<h3 class=fn>void <a name="removeSelectedText"></a>QTextEdit::removeSelectedText ( int&nbsp;selNum = 0 )<tt> [virtual slot]</tt>
1125</h3>
1126Deletes the text of selection <em>selNum</em> (by default, the default
1127selection, 0). If there is no selected text nothing happens.
1128<p> <p>See also <a href="#selectedText-prop">selectedText</a> and <a href="#removeSelection">removeSelection</a>().
1129
1130<h3 class=fn>void <a name="removeSelection"></a>QTextEdit::removeSelection ( int&nbsp;selNum = 0 )<tt> [virtual slot]</tt>
1131</h3>
1132Removes the selection <em>selNum</em> (by default 0). This does not
1133remove the selected text.
1134<p> <p>See also <a href="#removeSelectedText">removeSelectedText</a>().
1135
1136<h3 class=fn>void <a name="repaintChanged"></a>QTextEdit::repaintChanged ()<tt> [protected]</tt>
1137</h3>
1138Repaints any paragraphs that have changed.
1139<p> Although used extensively internally you shouldn't need to call
1140this yourself.
1141
1142<h3 class=fn>void <a name="returnPressed"></a>QTextEdit::returnPressed ()<tt> [signal]</tt>
1143</h3>
1144
1145<p> This signal is emitted if the user pressed the Return or the Enter
1146key.
1147
1148<h3 class=fn>void <a name="scrollToAnchor"></a>QTextEdit::scrollToAnchor ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name )<tt> [virtual slot]</tt>
1149</h3>
1150Scrolls the text edit to make the text at the anchor called <em>name</em> visible, if it can be found in the document. If the anchor
1151isn't found no scrolling will occur. An anchor is defined using
1152the HTML anchor tag, e.g. <tt>&lt;a name="target"&gt;</tt>.
1153
1154<h3 class=fn>void <a name="scrollToBottom"></a>QTextEdit::scrollToBottom ()<tt> [virtual slot]</tt>
1155</h3>
1156Scrolls to the bottom of the document and does formatting if
1157required.
1158
1159<h3 class=fn>void <a name="selectAll"></a>QTextEdit::selectAll ( bool&nbsp;select = TRUE )<tt> [virtual slot]</tt>
1160</h3>
1161If <em>select</em> is TRUE (the default), all the text is selected as
1162selection 0. If <em>select</em> is FALSE any selected text is
1163unselected, i.e. the default selection (selection 0) is cleared.
1164<p> <p>See also <a href="#selectedText-prop">selectedText</a>.
1165
1166<h3 class=fn><a href="qstring.html">QString</a> <a name="selectedText"></a>QTextEdit::selectedText () const
1167</h3><p>Returns the selected text (from selection 0) or an empty string if there is no currently selected text (in selection 0).
1168See the <a href="qtextedit.html#selectedText-prop">"selectedText"</a> property for details.
1169<h3 class=fn>void <a name="selectionChanged"></a>QTextEdit::selectionChanged ()<tt> [signal]</tt>
1170</h3>
1171
1172<p> This signal is emitted whenever the selection changes.
1173<p> <p>See also <a href="#setSelection">setSelection</a>() and <a href="#copyAvailable">copyAvailable</a>().
1174
1175<h3 class=fn>void <a name="setAlignment"></a>QTextEdit::setAlignment ( int&nbsp;a )<tt> [virtual slot]</tt>
1176</h3>
1177Sets the alignment of the current paragraph to <em>a</em>. Valid
1178alignments are <a href="qt.html#AlignmentFlags-enum">Qt::AlignLeft</a>, <a href="qt.html#AlignmentFlags-enum">Qt::AlignRight</a>,
1179<a href="qt.html#AlignmentFlags-enum">Qt::AlignJustify</a> and <a href="qt.html#AlignmentFlags-enum">Qt::AlignCenter</a> (which centers
1180horizontally).
1181
1182<p>Reimplemented in <a href="qmultilineedit.html#setAlignment">QMultiLineEdit</a>.
1183<h3 class=fn>void <a name="setAutoFormatting"></a>QTextEdit::setAutoFormatting ( uint&nbsp;features )
1184</h3><p>Sets the enabled set of auto formatting features to <em>features</em>.
1185See the <a href="qtextedit.html#autoFormatting-prop">"autoFormatting"</a> property for details.
1186<h3 class=fn>void <a name="setBold"></a>QTextEdit::setBold ( bool&nbsp;b )<tt> [virtual slot]</tt>
1187</h3>
1188If <em>b</em> is TRUE sets the current format to bold; otherwise sets
1189the current format to non-bold.
1190<p> <p>See also <a href="#bold">bold</a>().
1191
1192<h3 class=fn>void <a name="setColor"></a>QTextEdit::setColor ( const&nbsp;<a href="qcolor.html">QColor</a>&nbsp;&amp;&nbsp;c )<tt> [virtual slot]</tt>
1193</h3>
1194Sets the color of the current format, i.e. of the text, to <em>c</em>.
1195<p> <p>See also <a href="#color">color</a>() and <a href="#paper-prop">paper</a>.
1196
1197<h3 class=fn>void <a name="setCurrentFont"></a>QTextEdit::setCurrentFont ( const&nbsp;<a href="qfont.html">QFont</a>&nbsp;&amp;&nbsp;f )<tt> [virtual slot]</tt>
1198</h3>
1199
1200<p> Sets the font of the current format to <em>f</em>.
1201<p> If the widget is in <a href="qt.html#TextFormat-enum">LogText</a> mode this function will do
1202nothing. Use <a href="qwidget.html#setFont">setFont</a>() instead.
1203<p> <p>See also <a href="#currentFont">currentFont</a>(), <a href="#setPointSize">setPointSize</a>(), and <a href="#setFamily">setFamily</a>().
1204
1205<h3 class=fn>void <a name="setCursorPosition"></a>QTextEdit::setCursorPosition ( int&nbsp;para, int&nbsp;index )<tt> [virtual slot]</tt>
1206</h3>
1207Sets the cursor to position <em>index</em> in paragraph <em>para</em>.
1208<p> <p>See also <a href="#getCursorPosition">getCursorPosition</a>().
1209
1210<h3 class=fn>void <a name="setFamily"></a>QTextEdit::setFamily ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;fontFamily )<tt> [virtual slot]</tt>
1211</h3>
1212Sets the font family of the current format to <em>fontFamily</em>.
1213<p> <p>See also <a href="#family">family</a>() and <a href="#setCurrentFont">setCurrentFont</a>().
1214
1215<h3 class=fn>void <a name="setItalic"></a>QTextEdit::setItalic ( bool&nbsp;b )<tt> [virtual slot]</tt>
1216</h3>
1217If <em>b</em> is TRUE sets the current format to italic; otherwise sets
1218the current format to non-italic.
1219<p> <p>See also <a href="#italic">italic</a>().
1220
1221<h3 class=fn>void <a name="setLinkUnderline"></a>QTextEdit::setLinkUnderline ( bool )<tt> [virtual slot]</tt>
1222</h3><p>Sets whether hypertext links will be underlined.
1223See the <a href="qtextedit.html#linkUnderline-prop">"linkUnderline"</a> property for details.
1224<h3 class=fn>void <a name="setMaxLogLines"></a>QTextEdit::setMaxLogLines ( int&nbsp;limit )<tt> [slot]</tt>
1225</h3>
1226Sets the maximum number of lines a QTextEdit can hold in <a href="qt.html#TextFormat-enum">LogText</a> mode to <em>limit</em>. If <em>limit</em> is -1 (the default), this
1227signifies an unlimited number of lines.
1228<p> <b>Warning:</b> Never use formatting tags that span more than one line
1229when the maximum log lines is set. When lines are removed from the
1230top of the buffer it could result in an unbalanced tag pair, i.e.
1231the left formatting tag is removed before the right one.
1232
1233<h3 class=fn>void <a name="setMimeSourceFactory"></a>QTextEdit::setMimeSourceFactory ( <a href="qmimesourcefactory.html">QMimeSourceFactory</a>&nbsp;*&nbsp;factory )<tt> [virtual slot]</tt>
1234</h3>
1235Sets the text edit's mimesource factory to <em>factory</em>. See
1236<a href="qmimesourcefactory.html">QMimeSourceFactory</a> for further details.
1237<p> <p>See also <a href="#mimeSourceFactory">mimeSourceFactory</a>().
1238
1239<h3 class=fn>void <a name="setModified"></a>QTextEdit::setModified ( bool&nbsp;m )<tt> [virtual slot]</tt>
1240</h3><p>Sets whether the document has been modified by the user to <em>m</em>.
1241See the <a href="qtextedit.html#modified-prop">"modified"</a> property for details.
1242<h3 class=fn>void <a name="setOverwriteMode"></a>QTextEdit::setOverwriteMode ( bool&nbsp;b )<tt> [virtual slot]</tt>
1243</h3><p>Sets the text edit's overwrite mode to <em>b</em>.
1244See the <a href="qtextedit.html#overwriteMode-prop">"overwriteMode"</a> property for details.
1245<h3 class=fn>void <a name="setPaper"></a>QTextEdit::setPaper ( const&nbsp;<a href="qbrush.html">QBrush</a>&nbsp;&amp;&nbsp;pap )<tt> [virtual slot]</tt>
1246</h3><p>Sets the background (paper) brush to <em>pap</em>.
1247See the <a href="qtextedit.html#paper-prop">"paper"</a> property for details.
1248<h3 class=fn>void <a name="setParagraphBackgroundColor"></a>QTextEdit::setParagraphBackgroundColor ( int&nbsp;para, const&nbsp;<a href="qcolor.html">QColor</a>&nbsp;&amp;&nbsp;bg )<tt> [virtual slot]</tt>
1249</h3>
1250Sets the background color of the paragraph <em>para</em> to <em>bg</em>.
1251
1252<h3 class=fn>void <a name="setPointSize"></a>QTextEdit::setPointSize ( int&nbsp;s )<tt> [virtual slot]</tt>
1253</h3>
1254Sets the point size of the current format to <em>s</em>.
1255<p> Note that if <em>s</em> is zero or negative, the behaviour of this
1256function is not defined.
1257<p> <p>See also <a href="#pointSize">pointSize</a>(), <a href="#setCurrentFont">setCurrentFont</a>(), and <a href="#setFamily">setFamily</a>().
1258
1259<h3 class=fn>void <a name="setReadOnly"></a>QTextEdit::setReadOnly ( bool&nbsp;b )<tt> [virtual slot]</tt>
1260</h3><p>Sets whether the text edit is read-only to <em>b</em>.
1261See the <a href="qtextedit.html#readOnly-prop">"readOnly"</a> property for details.
1262<h3 class=fn>void <a name="setSelection"></a>QTextEdit::setSelection ( int&nbsp;paraFrom, int&nbsp;indexFrom, int&nbsp;paraTo, int&nbsp;indexTo, int&nbsp;selNum = 0 )<tt> [virtual slot]</tt>
1263</h3>
1264Sets a selection which starts at position <em>indexFrom</em> in
1265paragraph <em>paraFrom</em> and ends at position <em>indexTo</em> in paragraph
1266<em>paraTo</em>.
1267<p> Any existing selections which have a different id (<em>selNum</em>) are
1268left alone, but if an existing selection has the same id as <em>selNum</em> it is removed and replaced by this selection.
1269<p> Uses the selection settings of selection <em>selNum</em>. If <em>selNum</em>
1270is 0, this is the default selection.
1271<p> The cursor is moved to the end of the selection if <em>selNum</em> is 0,
1272otherwise the cursor position remains unchanged.
1273<p> <p>See also <a href="#getSelection">getSelection</a>() and <a href="#selectedText-prop">selectedText</a>.
1274
1275<h3 class=fn>void <a name="setSelectionAttributes"></a>QTextEdit::setSelectionAttributes ( int&nbsp;selNum, const&nbsp;<a href="qcolor.html">QColor</a>&nbsp;&amp;&nbsp;back, bool&nbsp;invertText )<tt> [virtual slot]</tt>
1276</h3>
1277Sets the background color of selection number <em>selNum</em> to <em>back</em>
1278and specifies whether the text of this selection should be
1279inverted with <em>invertText</em>.
1280<p> This only works for <em>selNum</em> > 0. The default selection (<em>selNum</em> == 0) gets its attributes from the text edit's
1281<a href="qwidget.html#colorGroup">colorGroup</a>().
1282
1283<h3 class=fn>void <a name="setStyleSheet"></a>QTextEdit::setStyleSheet ( <a href="qstylesheet.html">QStyleSheet</a>&nbsp;*&nbsp;styleSheet )<tt> [virtual slot]</tt>
1284</h3>
1285Sets the stylesheet to use with this text edit to <em>styleSheet</em>.
1286Changes will only take effect for new text added with <a href="#setText">setText</a>() or
1287<a href="#append">append</a>().
1288<p> <p>See also <a href="#styleSheet">styleSheet</a>().
1289
1290<h3 class=fn>void <a name="setTabChangesFocus"></a>QTextEdit::setTabChangesFocus ( bool&nbsp;b )<tt> [slot]</tt>
1291</h3><p>Sets whether TAB changes focus or is accepted as input to <em>b</em>.
1292See the <a href="qtextedit.html#tabChangesFocus-prop">"tabChangesFocus"</a> property for details.
1293<h3 class=fn>void <a name="setTabStopWidth"></a>QTextEdit::setTabStopWidth ( int&nbsp;ts )<tt> [virtual slot]</tt>
1294</h3><p>Sets the tab stop width in pixels to <em>ts</em>.
1295See the <a href="qtextedit.html#tabStopWidth-prop">"tabStopWidth"</a> property for details.
1296<h3 class=fn>void <a name="setText"></a>QTextEdit::setText ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;txt )<tt> [slot]</tt>
1297</h3><p>Sets the text edit's text to <em>txt</em>.
1298See the <a href="qtextedit.html#text-prop">"text"</a> property for details.
1299<h3 class=fn>void <a name="setText-2"></a>QTextEdit::setText ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;context )<tt> [virtual slot]</tt>
1300</h3>
1301This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
1302<p> Changes the text of the text edit to the string <em>text</em> and the
1303context to <em>context</em>. Any previous text is removed.
1304<p> <em>text</em> may be interpreted either as plain text or as rich text,
1305depending on the <a href="#textFormat">textFormat</a>(). The default setting is <a href="qt.html#TextFormat-enum">AutoText</a>,
1306i.e. the text edit auto-detects the format from <em>text</em>.
1307<p> For rich text the rendering style and available tags are defined
1308by a <a href="#styleSheet">styleSheet</a>(); see <a href="qstylesheet.html">QStyleSheet</a> for details.
1309<p> The optional <em>context</em> is a path which the text edit's
1310<a href="qmimesourcefactory.html">QMimeSourceFactory</a> uses to resolve the locations of files and
1311images. (See <a href="#QTextEdit">QTextEdit::QTextEdit</a>().) It is passed to the text
1312edit's QMimeSourceFactory when quering data.
1313<p> Note that the undo/redo history is cleared by this function.
1314<p> <p>See also <a href="#text-prop">text</a> and <a href="#textFormat-prop">textFormat</a>.
1315
1316<h3 class=fn>void <a name="setTextFormat"></a>QTextEdit::setTextFormat ( <a href="qt.html#TextFormat-enum">TextFormat</a>&nbsp;f )<tt> [virtual slot]</tt>
1317</h3><p>Sets the text format: rich text, plain text, log text or auto text to <em>f</em>.
1318See the <a href="qtextedit.html#textFormat-prop">"textFormat"</a> property for details.
1319<h3 class=fn>void <a name="setUnderline"></a>QTextEdit::setUnderline ( bool&nbsp;b )<tt> [virtual slot]</tt>
1320</h3>
1321If <em>b</em> is TRUE sets the current format to underline; otherwise
1322sets the current format to non-underline.
1323<p> <p>See also <a href="#underline">underline</a>().
1324
1325<h3 class=fn>void <a name="setUndoDepth"></a>QTextEdit::setUndoDepth ( int&nbsp;d )<tt> [virtual slot]</tt>
1326</h3><p>Sets the depth of the undo history to <em>d</em>.
1327See the <a href="qtextedit.html#undoDepth-prop">"undoDepth"</a> property for details.
1328<h3 class=fn>void <a name="setUndoRedoEnabled"></a>QTextEdit::setUndoRedoEnabled ( bool&nbsp;b )<tt> [virtual slot]</tt>
1329</h3><p>Sets whether undo/redo is enabled to <em>b</em>.
1330See the <a href="qtextedit.html#undoRedoEnabled-prop">"undoRedoEnabled"</a> property for details.
1331<h3 class=fn>void <a name="setVerticalAlignment"></a>QTextEdit::setVerticalAlignment ( <a href="qtextedit.html#VerticalAlignment-enum">VerticalAlignment</a>&nbsp;a )<tt> [virtual slot]</tt>
1332</h3>
1333Sets the vertical alignment of the current format, i.e. of the
1334text, to <em>a</em>.
1335<p> <p>See also <a href="#color">color</a>() and <a href="#paper-prop">paper</a>.
1336
1337<h3 class=fn>void <a name="setWordWrap"></a>QTextEdit::setWordWrap ( <a href="qtextedit.html#WordWrap-enum">WordWrap</a>&nbsp;mode )<tt> [virtual slot]</tt>
1338</h3><p>Sets the word wrap mode to <em>mode</em>.
1339See the <a href="qtextedit.html#wordWrap-prop">"wordWrap"</a> property for details.
1340<h3 class=fn>void <a name="setWrapColumnOrWidth"></a>QTextEdit::setWrapColumnOrWidth ( int )<tt> [virtual slot]</tt>
1341</h3><p>Sets the position (in pixels or columns depending on the wrap mode) where text will be wrapped.
1342See the <a href="qtextedit.html#wrapColumnOrWidth-prop">"wrapColumnOrWidth"</a> property for details.
1343<h3 class=fn>void <a name="setWrapPolicy"></a>QTextEdit::setWrapPolicy ( <a href="qtextedit.html#WrapPolicy-enum">WrapPolicy</a>&nbsp;policy )<tt> [virtual slot]</tt>
1344</h3><p>Sets the word wrap policy, at whitespace or anywhere to <em>policy</em>.
1345See the <a href="qtextedit.html#wrapPolicy-prop">"wrapPolicy"</a> property for details.
1346<h3 class=fn><a href="qstylesheet.html">QStyleSheet</a>&nbsp;* <a name="styleSheet"></a>QTextEdit::styleSheet () const
1347</h3>
1348Returns the <a href="qstylesheet.html">QStyleSheet</a> which is being used by this text edit.
1349<p> <p>See also <a href="#setStyleSheet">setStyleSheet</a>().
1350
1351<p>Examples: <a href="qaction-application-example.html#x1169">action/application.cpp</a>, <a href="simple-application-example.html#x1587">application/application.cpp</a>, <a href="helpviewer-example.html#x1031">helpviewer/helpwindow.cpp</a>, and <a href="mdi-example.html#x2072">mdi/application.cpp</a>.
1352<h3 class=fn>void <a name="sync"></a>QTextEdit::sync ()<tt> [virtual slot]</tt>
1353</h3>
1354QTextEdit is optimized for large amounts text. One of its
1355optimizations is to format only the visible text, formatting the rest
1356on demand, e.g. as the user scrolls, so you don't usually need to
1357call this function.
1358<p> In some situations you may want to force the whole text
1359to be formatted. For example, if after calling <a href="#setText">setText</a>(), you wanted
1360to know the height of the document (using <a href="qscrollview.html#contentsHeight">contentsHeight</a>()), you
1361would call this function first.
1362
1363<h3 class=fn><a href="qsyntaxhighlighter.html">QSyntaxHighlighter</a>&nbsp;* <a name="syntaxHighlighter"></a>QTextEdit::syntaxHighlighter () const
1364</h3>
1365Returns the <a href="qsyntaxhighlighter.html">QSyntaxHighlighter</a> set on this QTextEdit. 0 is
1366returned if no syntax highlighter is set.
1367
1368<h3 class=fn>bool <a name="tabChangesFocus"></a>QTextEdit::tabChangesFocus () const
1369</h3><p>Returns TRUE if TAB changes focus or is accepted as input; otherwise returns FALSE.
1370See the <a href="qtextedit.html#tabChangesFocus-prop">"tabChangesFocus"</a> property for details.
1371<h3 class=fn>int <a name="tabStopWidth"></a>QTextEdit::tabStopWidth () const
1372</h3><p>Returns the tab stop width in pixels.
1373See the <a href="qtextedit.html#tabStopWidth-prop">"tabStopWidth"</a> property for details.
1374<h3 class=fn><a href="qstring.html">QString</a> <a name="text"></a>QTextEdit::text () const
1375</h3><p>Returns the text edit's text.
1376See the <a href="qtextedit.html#text-prop">"text"</a> property for details.
1377<h3 class=fn><a href="qstring.html">QString</a> <a name="text-2"></a>QTextEdit::text ( int&nbsp;para ) const
1378</h3>
1379This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
1380<p> Returns the text of paragraph <em>para</em>.
1381<p> If <a href="#textFormat">textFormat</a>() is <a href="qt.html#TextFormat-enum">RichText</a> the text will contain HTML
1382formatting tags.
1383
1384<h3 class=fn>void <a name="textChanged"></a>QTextEdit::textChanged ()<tt> [signal]</tt>
1385</h3>
1386
1387<p> This signal is emitted whenever the text in the text edit changes.
1388<p> <p>See also <a href="#text-prop">text</a> and <a href="#append">append</a>().
1389
1390<p>Examples: <a href="qwerty-example.html#x400">qwerty/qwerty.cpp</a> and <a href="rot-example.html#x1375">rot13/rot13.cpp</a>.
1391<h3 class=fn>QTextCursor * <a name="textCursor"></a>QTextEdit::textCursor () const<tt> [protected]</tt>
1392</h3>
1393
1394<p> Returns the text edit's text cursor.
1395<p> <b>Warning:</b> QTextCursor is not in the public API, but in special
1396circumstances you might wish to use it.
1397
1398<h3 class=fn><a href="qt.html#TextFormat-enum">TextFormat</a> <a name="textFormat"></a>QTextEdit::textFormat () const
1399</h3><p>Returns the text format: rich text, plain text, log text or auto text.
1400See the <a href="qtextedit.html#textFormat-prop">"textFormat"</a> property for details.
1401<h3 class=fn>bool <a name="underline"></a>QTextEdit::underline () const
1402</h3>
1403Returns TRUE if the current format is underlined; otherwise returns
1404FALSE.
1405<p> <p>See also <a href="#setUnderline">setUnderline</a>().
1406
1407<h3 class=fn>void <a name="undo"></a>QTextEdit::undo ()<tt> [virtual slot]</tt>
1408</h3>
1409Undoes the last operation.
1410<p> If there is no operation to undo, i.e. there is no undo step in
1411the undo/redo history, nothing happens.
1412<p> <p>See also <a href="#undoAvailable">undoAvailable</a>(), <a href="#redo">redo</a>(), and <a href="#undoDepth-prop">undoDepth</a>.
1413
1414<h3 class=fn>void <a name="undoAvailable"></a>QTextEdit::undoAvailable ( bool&nbsp;yes )<tt> [signal]</tt>
1415</h3>
1416
1417<p> This signal is emitted when the availability of undo changes. If
1418<em>yes</em> is TRUE, then <a href="#undo">undo</a>() will work until <a href="#undoAvailable">undoAvailable</a>( FALSE )
1419is next emitted.
1420<p> <p>See also <a href="#undo">undo</a>() and <a href="#undoDepth-prop">undoDepth</a>.
1421
1422<h3 class=fn>int <a name="undoDepth"></a>QTextEdit::undoDepth () const
1423</h3><p>Returns the depth of the undo history.
1424See the <a href="qtextedit.html#undoDepth-prop">"undoDepth"</a> property for details.
1425<h3 class=fn><a href="qtextedit.html#WordWrap-enum">WordWrap</a> <a name="wordWrap"></a>QTextEdit::wordWrap () const
1426</h3><p>Returns the word wrap mode.
1427See the <a href="qtextedit.html#wordWrap-prop">"wordWrap"</a> property for details.
1428<h3 class=fn>int <a name="wrapColumnOrWidth"></a>QTextEdit::wrapColumnOrWidth () const
1429</h3><p>Returns the position (in pixels or columns depending on the wrap mode) where text will be wrapped.
1430See the <a href="qtextedit.html#wrapColumnOrWidth-prop">"wrapColumnOrWidth"</a> property for details.
1431<h3 class=fn><a href="qtextedit.html#WrapPolicy-enum">WrapPolicy</a> <a name="wrapPolicy"></a>QTextEdit::wrapPolicy () const
1432</h3><p>Returns the word wrap policy, at whitespace or anywhere.
1433See the <a href="qtextedit.html#wrapPolicy-prop">"wrapPolicy"</a> property for details.
1434<h3 class=fn>void <a name="zoomIn"></a>QTextEdit::zoomIn ( int&nbsp;range )<tt> [virtual slot]</tt>
1435</h3>
1436Zooms in on the text by making the base font size <em>range</em>
1437points larger and recalculating all font sizes to be the new size.
1438This does not change the size of any images.
1439<p> <p>See also <a href="#zoomOut">zoomOut</a>().
1440
1441<h3 class=fn>void <a name="zoomIn-2"></a>QTextEdit::zoomIn ()<tt> [virtual slot]</tt>
1442</h3>
1443
1444<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
1445<p> Zooms in on the text by making the base font size one point
1446larger and recalculating all font sizes to be the new size. This
1447does not change the size of any images.
1448<p> <p>See also <a href="#zoomOut">zoomOut</a>().
1449
1450<h3 class=fn>void <a name="zoomOut"></a>QTextEdit::zoomOut ( int&nbsp;range )<tt> [virtual slot]</tt>
1451</h3>
1452Zooms out on the text by making the base font size <em>range</em> points
1453smaller and recalculating all font sizes to be the new size. This
1454does not change the size of any images.
1455<p> <p>See also <a href="#zoomIn">zoomIn</a>().
1456
1457<h3 class=fn>void <a name="zoomOut-2"></a>QTextEdit::zoomOut ()<tt> [virtual slot]</tt>
1458</h3>
1459
1460<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
1461<p> Zooms out on the text by making the base font size one point
1462smaller and recalculating all font sizes to be the new size. This
1463does not change the size of any images.
1464<p> <p>See also <a href="#zoomIn">zoomIn</a>().
1465
1466<h3 class=fn>void <a name="zoomTo"></a>QTextEdit::zoomTo ( int&nbsp;size )<tt> [virtual slot]</tt>
1467</h3>
1468Zooms the text by making the base font size <em>size</em> points and
1469recalculating all font sizes to be the new size. This does not
1470change the size of any images.
1471
1472<hr><h2>Property Documentation</h2>
1473<h3 class=fn><a href="qtextedit.html#AutoFormatting-enum">AutoFormatting</a> <a name="autoFormatting-prop"></a>autoFormatting</h3>
1474<p>This property holds the enabled set of auto formatting features.
1475<p>The value can be any combination of the values in the <a href="#AutoFormatting-enum">AutoFormatting</a> enum. The default is <a href="#AutoFormatting-enum">AutoAll</a>. Choose <a href="#AutoFormatting-enum">AutoNone</a>
1476to disable all automatic formatting.
1477<p> Currently, the only automatic formatting feature provided is <a href="#AutoFormatting-enum">AutoBulletList</a>; future versions of Qt may offer more.
1478
1479<p>Set this property's value with <a href="#setAutoFormatting">setAutoFormatting</a>() and get this property's value with <a href="#autoFormatting">autoFormatting</a>().
1480<h3 class=fn><a href="qstring.html">QString</a> <a name="documentTitle-prop"></a>documentTitle</h3>
1481<p>This property holds the title of the document parsed from the text.
1482<p>For <a href="qt.html#TextFormat-enum">PlainText</a> the title will be an empty string. For <a href="qt.html#TextFormat-enum">RichText</a> the title will be the text between the <tt>&lt;title&gt;</tt> tags,
1483if present, otherwise an empty string.
1484
1485<p>Get this property's value with <a href="#documentTitle">documentTitle</a>().
1486<h3 class=fn>bool <a name="hasSelectedText-prop"></a>hasSelectedText</h3>
1487<p>This property holds whether some text is selected in selection 0.
1488<p>
1489<p>Get this property's value with <a href="#hasSelectedText">hasSelectedText</a>().
1490<h3 class=fn>int <a name="length-prop"></a>length</h3>
1491<p>This property holds the number of characters in the text.
1492<p>
1493<p>Get this property's value with <a href="#length">length</a>().
1494<h3 class=fn>bool <a name="linkUnderline-prop"></a>linkUnderline</h3>
1495<p>This property holds whether hypertext links will be underlined.
1496<p>If TRUE (the default) hypertext links will be displayed
1497underlined. If FALSE links will not be displayed underlined.
1498
1499<p>Set this property's value with <a href="#setLinkUnderline">setLinkUnderline</a>() and get this property's value with <a href="#linkUnderline">linkUnderline</a>().
1500<h3 class=fn>bool <a name="modified-prop"></a>modified</h3>
1501<p>This property holds whether the document has been modified by the user.
1502<p>
1503<p>Set this property's value with <a href="#setModified">setModified</a>() and get this property's value with <a href="#isModified">isModified</a>().
1504<h3 class=fn>bool <a name="overwriteMode-prop"></a>overwriteMode</h3>
1505<p>This property holds the text edit's overwrite mode.
1506<p>If FALSE (the default) characters entered by the user are inserted
1507with any characters to the right being moved out of the way. If
1508TRUE, the editor is in overwrite mode, i.e. characters entered by
1509the user overwrite any characters to the right of the cursor
1510position.
1511
1512<p>Set this property's value with <a href="#setOverwriteMode">setOverwriteMode</a>() and get this property's value with <a href="#isOverwriteMode">isOverwriteMode</a>().
1513<h3 class=fn><a href="qbrush.html">QBrush</a> <a name="paper-prop"></a>paper</h3>
1514<p>This property holds the background (paper) brush.
1515<p>The brush that is currently used to draw the background of the
1516text edit. The initial setting is an empty brush.
1517
1518<p>Set this property's value with <a href="#setPaper">setPaper</a>() and get this property's value with <a href="#paper">paper</a>().
1519<h3 class=fn>bool <a name="readOnly-prop"></a>readOnly</h3>
1520<p>This property holds whether the text edit is read-only.
1521<p>In a read-only text edit the user can only navigate through the
1522text and select text; modifying the text is not possible.
1523<p> This property's default is FALSE.
1524
1525<p>Set this property's value with <a href="#setReadOnly">setReadOnly</a>() and get this property's value with <a href="#isReadOnly">isReadOnly</a>().
1526<h3 class=fn><a href="qstring.html">QString</a> <a name="selectedText-prop"></a>selectedText</h3>
1527<p>This property holds the selected text (from selection 0) or an empty string if there is no currently selected text (in selection 0).
1528<p>The text is always returned as <a href="qt.html#TextFormat-enum">PlainText</a> if the <a href="#textFormat">textFormat</a>() is
1529<a href="qt.html#TextFormat-enum">PlainText</a> or <a href="qt.html#TextFormat-enum">AutoText</a>, otherwise it is returned as HTML.
1530<p> <p>See also <a href="#hasSelectedText-prop">hasSelectedText</a>.
1531
1532<p>Get this property's value with <a href="#selectedText">selectedText</a>().
1533<h3 class=fn>bool <a name="tabChangesFocus-prop"></a>tabChangesFocus</h3> <p>This property holds whether TAB changes focus or is accepted as input.
1534<p>In some occasions text edits should not allow the user to input
1535tabulators or change indentation using the TAB key, as this breaks
1536the focus chain. The default is FALSE.
1537<p>
1538<p>Set this property's value with <a href="#setTabChangesFocus">setTabChangesFocus</a>() and get this property's value with <a href="#tabChangesFocus">tabChangesFocus</a>().
1539<h3 class=fn>int <a name="tabStopWidth-prop"></a>tabStopWidth</h3>
1540<p>This property holds the tab stop width in pixels.
1541<p>
1542<p>Set this property's value with <a href="#setTabStopWidth">setTabStopWidth</a>() and get this property's value with <a href="#tabStopWidth">tabStopWidth</a>().
1543<h3 class=fn><a href="qstring.html">QString</a> <a name="text-prop"></a>text</h3>
1544<p>This property holds the text edit's text.
1545<p>There is no default text.
1546<p> On setting, any previous text is deleted.
1547<p> The text may be interpreted either as plain text or as rich text,
1548depending on the <a href="#textFormat">textFormat</a>(). The default setting is <a href="qt.html#TextFormat-enum">AutoText</a>,
1549i.e. the text edit auto-detects the format of the text.
1550<p> For richtext, calling <a href="#text">text</a>() on an editable QTextEdit will cause
1551the text to be regenerated from the textedit. This may mean that
1552the <a href="qstring.html">QString</a> returned may not be exactly the same as the one that
1553was set.
1554<p> <p>See also <a href="#textFormat-prop">textFormat</a>.
1555
1556<p>Set this property's value with <a href="#setText">setText</a>() and get this property's value with <a href="#text">text</a>().
1557<h3 class=fn><a href="qt.html#TextFormat-enum">TextFormat</a> <a name="textFormat-prop"></a>textFormat</h3>
1558<p>This property holds the text format: rich text, plain text, log text or auto text.
1559<p>The text format is one of the following:
1560<ul>
1561<li> PlainText - all characters, except newlines, are displayed
1562verbatim, including spaces. Whenever a newline appears in the text
1563the text edit inserts a hard line break and begins a new
1564paragraph.
1565<li> RichText - rich text rendering. The available styles are
1566defined in the default stylesheet <a href="qstylesheet.html#defaultSheet">QStyleSheet::defaultSheet</a>().
1567<li> LogText - optimized mode for very large texts. Supports a very
1568limited set of formatting tags (color, bold, underline and italic
1569settings).
1570<li> AutoText - this is the default. The text edit autodetects which
1571rendering style is best, <a href="qt.html#TextFormat-enum">PlainText</a> or <a href="qt.html#TextFormat-enum">RichText</a>. This is done
1572by using the <a href="qstylesheet.html#mightBeRichText">QStyleSheet::mightBeRichText</a>() function.
1573</ul>
1574
1575<p>Set this property's value with <a href="#setTextFormat">setTextFormat</a>() and get this property's value with <a href="#textFormat">textFormat</a>().
1576<h3 class=fn>int <a name="undoDepth-prop"></a>undoDepth</h3>
1577<p>This property holds the depth of the undo history.
1578<p>The maximum number of steps in the undo/redo history. The default
1579is 100.
1580<p> <p>See also <a href="#undo">undo</a>() and <a href="#redo">redo</a>().
1581
1582<p>Set this property's value with <a href="#setUndoDepth">setUndoDepth</a>() and get this property's value with <a href="#undoDepth">undoDepth</a>().
1583<h3 class=fn>bool <a name="undoRedoEnabled-prop"></a>undoRedoEnabled</h3>
1584<p>This property holds whether undo/redo is enabled.
1585<p>When changing this property, the undo/redo history is cleared.
1586<p> The default is TRUE.
1587
1588<p>Set this property's value with <a href="#setUndoRedoEnabled">setUndoRedoEnabled</a>() and get this property's value with <a href="#isUndoRedoEnabled">isUndoRedoEnabled</a>().
1589<h3 class=fn><a href="qtextedit.html#WordWrap-enum">WordWrap</a> <a name="wordWrap-prop"></a>wordWrap</h3>
1590<p>This property holds the word wrap mode.
1591<p>The default mode is <a href="#WordWrap-enum">WidgetWidth</a> which causes words to be
1592wrapped at the right edge of the text edit. Wrapping occurs at
1593whitespace, keeping whole words intact. If you want wrapping to
1594occur within words use <a href="#setWrapPolicy">setWrapPolicy</a>(). If you set a wrap mode of
1595<a href="#WordWrap-enum">FixedPixelWidth</a> or <a href="#WordWrap-enum">FixedColumnWidth</a> you should also call
1596<a href="#setWrapColumnOrWidth">setWrapColumnOrWidth</a>() with the width you want.
1597<p> <p>See also <a href="#WordWrap-enum">WordWrap</a>, <a href="#wrapColumnOrWidth-prop">wrapColumnOrWidth</a>, and <a href="#wrapPolicy-prop">wrapPolicy</a>.
1598
1599<p>Set this property's value with <a href="#setWordWrap">setWordWrap</a>() and get this property's value with <a href="#wordWrap">wordWrap</a>().
1600<h3 class=fn>int <a name="wrapColumnOrWidth-prop"></a>wrapColumnOrWidth</h3>
1601<p>This property holds the position (in pixels or columns depending on the wrap mode) where text will be wrapped.
1602<p>If the wrap mode is <a href="#WordWrap-enum">FixedPixelWidth</a>, the value is the number of
1603pixels from the left edge of the text edit at which text should be
1604wrapped. If the wrap mode is <a href="#WordWrap-enum">FixedColumnWidth</a>, the value is the
1605column number (in character columns) from the left edge of the
1606text edit at which text should be wrapped.
1607<p> <p>See also <a href="#wordWrap-prop">wordWrap</a>.
1608
1609<p>Set this property's value with <a href="#setWrapColumnOrWidth">setWrapColumnOrWidth</a>() and get this property's value with <a href="#wrapColumnOrWidth">wrapColumnOrWidth</a>().
1610<h3 class=fn><a href="qtextedit.html#WrapPolicy-enum">WrapPolicy</a> <a name="wrapPolicy-prop"></a>wrapPolicy</h3>
1611<p>This property holds the word wrap policy, at whitespace or anywhere.
1612<p>Defines where text can be wrapped when word wrap mode is not <a href="#WordWrap-enum">NoWrap</a>. The choices are <a href="#WrapPolicy-enum">AtWordBoundary</a> (the default), <a href="#WrapPolicy-enum">Anywhere</a> and <a href="#WrapPolicy-enum">AtWordOrDocumentBoundary</a>
1613<p> <p>See also <a href="#wordWrap-prop">wordWrap</a>.
1614
1615<p>Set this property's value with <a href="#setWrapPolicy">setWrapPolicy</a>() and get this property's value with <a href="#wrapPolicy">wrapPolicy</a>().
1616<!-- eof -->
1617<hr><p>
1618This file is part of the <a href="index.html">Qt toolkit</a>.
1619Copyright &copy; 1995-2007
1620<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
1621<table width=100% cellspacing=0 border=0><tr>
1622<td>Copyright &copy; 2007
1623<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
1624<td align=right><div align=right>Qt 3.3.8</div>
1625</table></div></address></body>
1626</html>
Note: See TracBrowser for help on using the repository browser.