~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/q3textedit.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/qt3support/text/q3textedit.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: Q3TextEdit Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">Q3TextEdit Class Reference</h1>
 
21
<p>The Q3TextEdit widget provides a powerful single-page rich text editor. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;Q3TextEdit&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See the <a href="porting4.html">Porting Guide</a> for more information.</p>
 
23
<p>Part of the <a href="qt3support.html">Qt3Support</a> module.</p>
 
24
<p>Inherits <a href="q3scrollview.html">Q3ScrollView</a>.</p>
 
25
<p>Inherited by <a href="q3multilineedit.html">Q3MultiLineEdit</a>, <a href="q3textbrowser.html">Q3TextBrowser</a>, and <a href="q3textview.html">Q3TextView</a>.</p>
 
26
<ul>
 
27
<li><a href="q3textedit-members.html">List of all members, including inherited members</a></li>
 
28
</ul>
 
29
<a name="public-types"></a>
 
30
<h3>Public Types</h3>
 
31
<ul>
 
32
<li><div class="fn"/>flags <b><a href="q3textedit.html#AutoFormattingFlag-enum">AutoFormatting</a></b></li>
 
33
<li><div class="fn"/>enum <b><a href="q3textedit.html#AutoFormattingFlag-enum">AutoFormattingFlag</a></b> { AutoNone, AutoBulletList, AutoAll }</li>
 
34
<li><div class="fn"/>enum <b><a href="q3textedit.html#CursorAction-enum">CursorAction</a></b> { MoveBackward, MoveWordBackward, MoveForward, MoveWordForward, ..., MovePgDown }</li>
 
35
<li><div class="fn"/>enum <b><a href="q3textedit.html#KeyboardAction-enum">KeyboardAction</a></b> { ActionBackspace, ActionDelete, ActionReturn, ActionKill, ActionWordBackspace, ActionWordDelete }</li>
 
36
<li><div class="fn"/>enum <b><a href="q3textedit.html#VerticalAlignment-enum">VerticalAlignment</a></b> { AlignNormal, AlignSuperScript, AlignSubScript }</li>
 
37
<li><div class="fn"/>enum <b><a href="q3textedit.html#WordWrap-enum">WordWrap</a></b> { NoWrap, WidgetWidth, FixedPixelWidth, FixedColumnWidth }</li>
 
38
<li><div class="fn"/>enum <b><a href="q3textedit.html#WrapPolicy-enum">WrapPolicy</a></b> { AtWhiteSpace, Anywhere, AtWordBoundary, AtWordOrDocumentBoundary }</li>
 
39
</ul>
 
40
<a name="properties"></a>
 
41
<h3>Properties</h3>
 
42
<table width="100%" border="0" cellpadding="0" cellspacing="0">
 
43
<tr><td width="45%" valign="top"><ul>
 
44
<li><div class="fn"/><b><a href="q3textedit.html#autoFormatting-prop">autoFormatting</a></b> : AutoFormattingFlag</li>
 
45
<li><div class="fn"/><b><a href="q3textedit.html#documentTitle-prop">documentTitle</a></b> : const QString</li>
 
46
<li><div class="fn"/><b><a href="q3textedit.html#hasSelectedText-prop">hasSelectedText</a></b> : const bool</li>
 
47
<li><div class="fn"/><b><a href="q3textedit.html#length-prop">length</a></b> : const int</li>
 
48
<li><div class="fn"/><b><a href="q3textedit.html#linkUnderline-prop">linkUnderline</a></b> : bool</li>
 
49
<li><div class="fn"/><b><a href="q3textedit.html#modified-prop">modified</a></b> : bool</li>
 
50
<li><div class="fn"/><b><a href="q3textedit.html#overwriteMode-prop">overwriteMode</a></b> : bool</li>
 
51
<li><div class="fn"/><b><a href="q3textedit.html#paper-prop">paper</a></b> : QBrush</li>
 
52
<li><div class="fn"/><b><a href="q3textedit.html#readOnly-prop">readOnly</a></b> : bool</li>
 
53
<li><div class="fn"/><b><a href="q3textedit.html#selectedText-prop">selectedText</a></b> : const QString</li>
 
54
</ul></td><td valign="top"><ul>
 
55
<li><div class="fn"/><b><a href="q3textedit.html#tabChangesFocus-prop">tabChangesFocus</a></b> : bool</li>
 
56
<li><div class="fn"/><b><a href="q3textedit.html#tabStopWidth-prop">tabStopWidth</a></b> : int</li>
 
57
<li><div class="fn"/><b><a href="q3textedit.html#text-prop">text</a></b> : QString</li>
 
58
<li><div class="fn"/><b><a href="q3textedit.html#textFormat-prop">textFormat</a></b> : Qt::TextFormat</li>
 
59
<li><div class="fn"/><b><a href="q3textedit.html#undoDepth-prop">undoDepth</a></b> : int</li>
 
60
<li><div class="fn"/><b><a href="q3textedit.html#undoRedoEnabled-prop">undoRedoEnabled</a></b> : bool</li>
 
61
<li><div class="fn"/><b><a href="q3textedit.html#wordWrap-prop">wordWrap</a></b> : WordWrap</li>
 
62
<li><div class="fn"/><b><a href="q3textedit.html#wrapColumnOrWidth-prop">wrapColumnOrWidth</a></b> : int</li>
 
63
<li><div class="fn"/><b><a href="q3textedit.html#wrapPolicy-prop">wrapPolicy</a></b> : WrapPolicy</li>
 
64
</ul>
 
65
</td></tr>
 
66
</table>
 
67
<ul>
 
68
<li><div class="fn"/>10 properties inherited from <a href="q3scrollview.html#properties">Q3ScrollView</a></li>
 
69
<li><div class="fn"/>2 properties inherited from <a href="q3frame.html#properties">Q3Frame</a></li>
 
70
<li><div class="fn"/>6 properties inherited from <a href="qframe.html#properties">QFrame</a></li>
 
71
<li><div class="fn"/>52 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
 
72
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
 
73
</ul>
 
74
<a name="public-functions"></a>
 
75
<h3>Public Functions</h3>
 
76
<ul>
 
77
<li><div class="fn"/><b><a href="q3textedit.html#Q3TextEdit">Q3TextEdit</a></b> ( const QString &amp; <i>text</i>, const QString &amp; <i>context</i> = QString(), QWidget * <i>parent</i> = 0, const char * <i>name</i> = 0 )</li>
 
78
<li><div class="fn"/><b><a href="q3textedit.html#Q3TextEdit-2">Q3TextEdit</a></b> ( QWidget * <i>parent</i> = 0, const char * <i>name</i> = 0 )</li>
 
79
<li><div class="fn"/>virtual <b><a href="q3textedit.html#dtor.Q3TextEdit">~Q3TextEdit</a></b> ()</li>
 
80
<li><div class="fn"/>int <b><a href="q3textedit.html#alignment">alignment</a></b> () const</li>
 
81
<li><div class="fn"/>QString <b><a href="q3textedit.html#anchorAt">anchorAt</a></b> ( const QPoint &amp; <i>pos</i>, Qt::AnchorAttribute <i>attr</i> = Qt::AnchorHref )</li>
 
82
<li><div class="fn"/>AutoFormatting <b><a href="q3textedit.html#autoFormatting-prop">autoFormatting</a></b> () const</li>
 
83
<li><div class="fn"/>bool <b><a href="q3textedit.html#bold">bold</a></b> () const</li>
 
84
<li><div class="fn"/>int <b><a href="q3textedit.html#charAt">charAt</a></b> ( const QPoint &amp; <i>pos</i>, int * <i>para</i> ) const</li>
 
85
<li><div class="fn"/>QColor <b><a href="q3textedit.html#color">color</a></b> () const</li>
 
86
<li><div class="fn"/>QString <b><a href="q3textedit.html#context">context</a></b> () const</li>
 
87
<li><div class="fn"/>QFont <b><a href="q3textedit.html#currentFont">currentFont</a></b> () const</li>
 
88
<li><div class="fn"/>QString <b><a href="q3textedit.html#documentTitle-prop">documentTitle</a></b> () const</li>
 
89
<li><div class="fn"/>QString <b><a href="q3textedit.html#family">family</a></b> () const</li>
 
90
<li><div class="fn"/>virtual bool <b><a href="q3textedit.html#find">find</a></b> ( const QString &amp; <i>expr</i>, bool <i>cs</i>, bool <i>wo</i>, bool <i>forward</i> = true, int * <i>para</i> = 0, int * <i>index</i> = 0 )</li>
 
91
<li><div class="fn"/>QFont <b><a href="q3textedit.html#font">font</a></b> () const</li>
 
92
<li><div class="fn"/>void <b><a href="q3textedit.html#getCursorPosition">getCursorPosition</a></b> ( int * <i>para</i>, int * <i>index</i> ) const</li>
 
93
<li><div class="fn"/>void <b><a href="q3textedit.html#getSelection">getSelection</a></b> ( int * <i>paraFrom</i>, int * <i>indexFrom</i>, int * <i>paraTo</i>, int * <i>indexTo</i>, int <i>selNum</i> = 0 ) const</li>
 
94
<li><div class="fn"/>bool <b><a href="q3textedit.html#hasSelectedText-prop">hasSelectedText</a></b> () const</li>
 
95
<li><div class="fn"/>virtual int <b><a href="q3textedit.html#heightForWidth">heightForWidth</a></b> ( int <i>w</i> ) const</li>
 
96
<li><div class="fn"/>bool <b><a href="q3textedit.html#modified-prop">isModified</a></b> () const</li>
 
97
<li><div class="fn"/>bool <b><a href="q3textedit.html#overwriteMode-prop">isOverwriteMode</a></b> () const</li>
 
98
<li><div class="fn"/>bool <b><a href="q3textedit.html#readOnly-prop">isReadOnly</a></b> () const</li>
 
99
<li><div class="fn"/>bool <b><a href="q3textedit.html#isRedoAvailable">isRedoAvailable</a></b> () const</li>
 
100
<li><div class="fn"/>bool <b><a href="q3textedit.html#isUndoAvailable">isUndoAvailable</a></b> () const</li>
 
101
<li><div class="fn"/>bool <b><a href="q3textedit.html#undoRedoEnabled-prop">isUndoRedoEnabled</a></b> () const</li>
 
102
<li><div class="fn"/>bool <b><a href="q3textedit.html#italic">italic</a></b> () const</li>
 
103
<li><div class="fn"/>int <b><a href="q3textedit.html#length-prop">length</a></b> () const</li>
 
104
<li><div class="fn"/>int <b><a href="q3textedit.html#lineOfChar">lineOfChar</a></b> ( int <i>para</i>, int <i>index</i> )</li>
 
105
<li><div class="fn"/>int <b><a href="q3textedit.html#lines">lines</a></b> () const</li>
 
106
<li><div class="fn"/>int <b><a href="q3textedit.html#linesOfParagraph">linesOfParagraph</a></b> ( int <i>para</i> ) const</li>
 
107
<li><div class="fn"/>bool <b><a href="q3textedit.html#linkUnderline-prop">linkUnderline</a></b> () const</li>
 
108
<li><div class="fn"/>Q3MimeSourceFactory * <b><a href="q3textedit.html#mimeSourceFactory">mimeSourceFactory</a></b> () const</li>
 
109
<li><div class="fn"/>QBrush <b><a href="q3textedit.html#paper-prop">paper</a></b> () const</li>
 
110
<li><div class="fn"/>int <b><a href="q3textedit.html#paragraphAt">paragraphAt</a></b> ( const QPoint &amp; <i>pos</i> ) const</li>
 
111
<li><div class="fn"/>QColor <b><a href="q3textedit.html#paragraphBackgroundColor">paragraphBackgroundColor</a></b> ( int <i>para</i> ) const</li>
 
112
<li><div class="fn"/>int <b><a href="q3textedit.html#paragraphLength">paragraphLength</a></b> ( int <i>para</i> ) const</li>
 
113
<li><div class="fn"/>QRect <b><a href="q3textedit.html#paragraphRect">paragraphRect</a></b> ( int <i>para</i> ) const</li>
 
114
<li><div class="fn"/>int <b><a href="q3textedit.html#paragraphs">paragraphs</a></b> () const</li>
 
115
<li><div class="fn"/>int <b><a href="q3textedit.html#pointSize">pointSize</a></b> () const</li>
 
116
<li><div class="fn"/>QString <b><a href="q3textedit.html#selectedText-prop">selectedText</a></b> () const</li>
 
117
<li><div class="fn"/>void <b><a href="q3textedit.html#autoFormatting-prop">setAutoFormatting</a></b> ( AutoFormatting )</li>
 
118
<li><div class="fn"/>Q3StyleSheet * <b><a href="q3textedit.html#styleSheet">styleSheet</a></b> () const</li>
 
119
<li><div class="fn"/>Q3SyntaxHighlighter * <b><a href="q3textedit.html#syntaxHighlighter">syntaxHighlighter</a></b> () const</li>
 
120
<li><div class="fn"/>bool <b><a href="q3textedit.html#tabChangesFocus-prop">tabChangesFocus</a></b> () const</li>
 
121
<li><div class="fn"/>int <b><a href="q3textedit.html#tabStopWidth-prop">tabStopWidth</a></b> () const</li>
 
122
<li><div class="fn"/>QString <b><a href="q3textedit.html#text-prop">text</a></b> () const</li>
 
123
<li><div class="fn"/>QString <b><a href="q3textedit.html#text-prop">text</a></b> ( int <i>para</i> ) const</li>
 
124
<li><div class="fn"/>Qt::TextFormat <b><a href="q3textedit.html#textFormat-prop">textFormat</a></b> () const</li>
 
125
<li><div class="fn"/>bool <b><a href="q3textedit.html#underline">underline</a></b> () const</li>
 
126
<li><div class="fn"/>int <b><a href="q3textedit.html#undoDepth-prop">undoDepth</a></b> () const</li>
 
127
<li><div class="fn"/>VerticalAlignment <b><a href="q3textedit.html#verticalAlignment">verticalAlignment</a></b> () const</li>
 
128
<li><div class="fn"/>WordWrap <b><a href="q3textedit.html#wordWrap-prop">wordWrap</a></b> () const</li>
 
129
<li><div class="fn"/>int <b><a href="q3textedit.html#wrapColumnOrWidth-prop">wrapColumnOrWidth</a></b> () const</li>
 
130
<li><div class="fn"/>WrapPolicy <b><a href="q3textedit.html#wrapPolicy-prop">wrapPolicy</a></b> () const</li>
 
131
</ul>
 
132
<ul>
 
133
<li><div class="fn"/>46 public functions inherited from <a href="q3scrollview.html#public-functions">Q3ScrollView</a></li>
 
134
<li><div class="fn"/>4 public functions inherited from <a href="q3frame.html#public-functions">Q3Frame</a></li>
 
135
<li><div class="fn"/>13 public functions inherited from <a href="qframe.html#public-functions">QFrame</a></li>
 
136
<li><div class="fn"/>183 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
 
137
<li><div class="fn"/>28 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
 
138
<li><div class="fn"/>10 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
 
139
</ul>
 
140
<a name="public-slots"></a>
 
141
<h3>Public Slots</h3>
 
142
<ul>
 
143
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#append">append</a></b> ( const QString &amp; <i>text</i> )</li>
 
144
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#clear">clear</a></b> ()</li>
 
145
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#clearParagraphBackground">clearParagraphBackground</a></b> ( int <i>para</i> )</li>
 
146
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#copy">copy</a></b> ()</li>
 
147
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#cut">cut</a></b> ()</li>
 
148
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#del">del</a></b> ()</li>
 
149
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#doKeyboardAction">doKeyboardAction</a></b> ( KeyboardAction <i>action</i> )</li>
 
150
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#ensureCursorVisible">ensureCursorVisible</a></b> ()</li>
 
151
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#insert">insert</a></b> ( const QString &amp; <i>text</i>, uint <i>insertionFlags</i> = CheckNewLines | RemoveSelected )</li>
 
152
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#insert-2">insert</a></b> ( const QString &amp; <i>text</i>, bool <i>indent</i>, bool <i>checkNewLine</i> = true, bool <i>removeSelected</i> = true )</li>
 
153
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#insertAt">insertAt</a></b> ( const QString &amp; <i>text</i>, int <i>para</i>, int <i>index</i> )</li>
 
154
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#insertParagraph">insertParagraph</a></b> ( const QString &amp; <i>text</i>, int <i>para</i> )</li>
 
155
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#moveCursor">moveCursor</a></b> ( CursorAction <i>action</i>, bool <i>select</i> )</li>
 
156
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#paste">paste</a></b> ()</li>
 
157
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#pasteSubType">pasteSubType</a></b> ( const QByteArray &amp; <i>subtype</i> )</li>
 
158
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#placeCursor">placeCursor</a></b> ( const QPoint &amp; <i>pos</i>, Q3TextCursor * <i>c</i> = 0 )</li>
 
159
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#redo">redo</a></b> ()</li>
 
160
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#removeParagraph">removeParagraph</a></b> ( int <i>para</i> )</li>
 
161
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#removeSelectedText">removeSelectedText</a></b> ( int <i>selNum</i> = 0 )</li>
 
162
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#removeSelection">removeSelection</a></b> ( int <i>selNum</i> = 0 )</li>
 
163
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#scrollToAnchor">scrollToAnchor</a></b> ( const QString &amp; <i>name</i> )</li>
 
164
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#scrollToBottom">scrollToBottom</a></b> ()</li>
 
165
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#selectAll">selectAll</a></b> ( bool <i>select</i> = true )</li>
 
166
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#setAlignment">setAlignment</a></b> ( int <i>a</i> )</li>
 
167
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#setBold">setBold</a></b> ( bool <i>b</i> )</li>
 
168
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#setColor">setColor</a></b> ( const QColor &amp; <i>c</i> )</li>
 
169
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#setCurrentFont">setCurrentFont</a></b> ( const QFont &amp; <i>f</i> )</li>
 
170
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#setCursorPosition">setCursorPosition</a></b> ( int <i>para</i>, int <i>index</i> )</li>
 
171
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#setFamily">setFamily</a></b> ( const QString &amp; <i>fontFamily</i> )</li>
 
172
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#setItalic">setItalic</a></b> ( bool <i>b</i> )</li>
 
173
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#linkUnderline-prop">setLinkUnderline</a></b> ( bool )</li>
 
174
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#setMimeSourceFactory">setMimeSourceFactory</a></b> ( Q3MimeSourceFactory * <i>factory</i> )</li>
 
175
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#modified-prop">setModified</a></b> ( bool <i>m</i> )</li>
 
176
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#overwriteMode-prop">setOverwriteMode</a></b> ( bool <i>b</i> )</li>
 
177
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#paper-prop">setPaper</a></b> ( const QBrush &amp; <i>pap</i> )</li>
 
178
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#setParagraphBackgroundColor">setParagraphBackgroundColor</a></b> ( int <i>para</i>, const QColor &amp; <i>bg</i> )</li>
 
179
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#setPointSize">setPointSize</a></b> ( int <i>s</i> )</li>
 
180
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#readOnly-prop">setReadOnly</a></b> ( bool <i>b</i> )</li>
 
181
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#setSelection">setSelection</a></b> ( int <i>paraFrom</i>, int <i>indexFrom</i>, int <i>paraTo</i>, int <i>indexTo</i>, int <i>selNum</i> = 0 )</li>
 
182
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#setSelectionAttributes">setSelectionAttributes</a></b> ( int <i>selNum</i>, const QColor &amp; <i>back</i>, bool <i>invertText</i> )</li>
 
183
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#setStyleSheet">setStyleSheet</a></b> ( Q3StyleSheet * <i>styleSheet</i> )</li>
 
184
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#tabChangesFocus-prop">setTabChangesFocus</a></b> ( bool <i>b</i> )</li>
 
185
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#tabStopWidth-prop">setTabStopWidth</a></b> ( int <i>ts</i> )</li>
 
186
<li><div class="fn"/>void <b><a href="q3textedit.html#text-prop">setText</a></b> ( const QString &amp; <i>txt</i> )</li>
 
187
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#text-prop">setText</a></b> ( const QString &amp; <i>text</i>, const QString &amp; <i>context</i> )</li>
 
188
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#textFormat-prop">setTextFormat</a></b> ( Qt::TextFormat <i>f</i> )</li>
 
189
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#setUnderline">setUnderline</a></b> ( bool <i>b</i> )</li>
 
190
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#undoDepth-prop">setUndoDepth</a></b> ( int <i>d</i> )</li>
 
191
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#undoRedoEnabled-prop">setUndoRedoEnabled</a></b> ( bool <i>b</i> )</li>
 
192
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#setVerticalAlignment">setVerticalAlignment</a></b> ( VerticalAlignment <i>a</i> )</li>
 
193
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#wordWrap-prop">setWordWrap</a></b> ( WordWrap <i>mode</i> )</li>
 
194
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#wrapColumnOrWidth-prop">setWrapColumnOrWidth</a></b> ( int )</li>
 
195
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#wrapPolicy-prop">setWrapPolicy</a></b> ( WrapPolicy <i>policy</i> )</li>
 
196
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#sync">sync</a></b> ()</li>
 
197
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#undo">undo</a></b> ()</li>
 
198
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#zoomIn">zoomIn</a></b> ( int <i>range</i> )</li>
 
199
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#zoomIn-2">zoomIn</a></b> ()</li>
 
200
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#zoomOut">zoomOut</a></b> ( int <i>range</i> )</li>
 
201
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#zoomOut-2">zoomOut</a></b> ()</li>
 
202
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#zoomTo">zoomTo</a></b> ( int <i>size</i> )</li>
 
203
</ul>
 
204
<ul>
 
205
<li><div class="fn"/>8 public slots inherited from <a href="q3scrollview.html#public-slots">Q3ScrollView</a></li>
 
206
<li><div class="fn"/>17 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
 
207
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
 
208
</ul>
 
209
<a name="signals"></a>
 
210
<h3>Signals</h3>
 
211
<ul>
 
212
<li><div class="fn"/>void <b><a href="q3textedit.html#clicked">clicked</a></b> ( int <i>para</i>, int <i>pos</i> )</li>
 
213
<li><div class="fn"/>void <b><a href="q3textedit.html#copyAvailable">copyAvailable</a></b> ( bool <i>yes</i> )</li>
 
214
<li><div class="fn"/>void <b><a href="q3textedit.html#currentAlignmentChanged">currentAlignmentChanged</a></b> ( int <i>a</i> )</li>
 
215
<li><div class="fn"/>void <b><a href="q3textedit.html#currentColorChanged">currentColorChanged</a></b> ( const QColor &amp; <i>c</i> )</li>
 
216
<li><div class="fn"/>void <b><a href="q3textedit.html#currentFontChanged">currentFontChanged</a></b> ( const QFont &amp; <i>f</i> )</li>
 
217
<li><div class="fn"/>void <b><a href="q3textedit.html#currentVerticalAlignmentChanged">currentVerticalAlignmentChanged</a></b> ( VerticalAlignment <i>a</i> )</li>
 
218
<li><div class="fn"/>void <b><a href="q3textedit.html#cursorPositionChanged-2">cursorPositionChanged</a></b> ( int <i>para</i>, int <i>pos</i> )</li>
 
219
<li><div class="fn"/>void <b><a href="q3textedit.html#doubleClicked">doubleClicked</a></b> ( int <i>para</i>, int <i>pos</i> )</li>
 
220
<li><div class="fn"/>void <b><a href="q3textedit.html#modificationChanged">modificationChanged</a></b> ( bool <i>m</i> )</li>
 
221
<li><div class="fn"/>void <b><a href="q3textedit.html#redoAvailable">redoAvailable</a></b> ( bool <i>yes</i> )</li>
 
222
<li><div class="fn"/>void <b><a href="q3textedit.html#returnPressed">returnPressed</a></b> ()</li>
 
223
<li><div class="fn"/>void <b><a href="q3textedit.html#selectionChanged">selectionChanged</a></b> ()</li>
 
224
<li><div class="fn"/>void <b><a href="q3textedit.html#textChanged">textChanged</a></b> ()</li>
 
225
<li><div class="fn"/>void <b><a href="q3textedit.html#undoAvailable">undoAvailable</a></b> ( bool <i>yes</i> )</li>
 
226
</ul>
 
227
<ul>
 
228
<li><div class="fn"/>5 signals inherited from <a href="q3scrollview.html#signals">Q3ScrollView</a></li>
 
229
<li><div class="fn"/>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
 
230
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
 
231
</ul>
 
232
<a name="protected-functions"></a>
 
233
<h3>Protected Functions</h3>
 
234
<ul>
 
235
<li><div class="fn"/>virtual Q3PopupMenu * <b><a href="q3textedit.html#createPopupMenu">createPopupMenu</a></b> ( const QPoint &amp; <i>pos</i> )</li>
 
236
<li><div class="fn"/>virtual Q3PopupMenu * <b><a href="q3textedit.html#createPopupMenu-2">createPopupMenu</a></b> ()</li>
 
237
<li><div class="fn"/>virtual bool <b><a href="q3textedit.html#focusNextPrevChild">focusNextPrevChild</a></b> ( bool <i>n</i> )</li>
 
238
<li><div class="fn"/>virtual void <b><a href="q3textedit.html#keyPressEvent">keyPressEvent</a></b> ( QKeyEvent * <i>e</i> )</li>
 
239
<li><div class="fn"/>void <b><a href="q3textedit.html#repaintChanged">repaintChanged</a></b> ()</li>
 
240
<li><div class="fn"/>Q3TextCursor * <b><a href="q3textedit.html#textCursor">textCursor</a></b> () const</li>
 
241
</ul>
 
242
<ul>
 
243
<li><div class="fn"/>17 protected functions inherited from <a href="q3scrollview.html#protected-functions">Q3ScrollView</a></li>
 
244
<li><div class="fn"/>5 protected functions inherited from <a href="q3frame.html#protected-functions">Q3Frame</a></li>
 
245
<li><div class="fn"/>39 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
 
246
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
 
247
</ul>
 
248
<h3>Additional Inherited Members</h3>
 
249
<ul>
 
250
<li><div class="fn"/>2 static public members inherited from <a href="qframe.html#static-public-members">QFrame</a></li>
 
251
<li><div class="fn"/>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
 
252
<li><div class="fn"/>4 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
 
253
</ul>
 
254
<a name="details"></a>
 
255
<hr />
 
256
<h2>Detailed Description</h2>
 
257
<p>The Q3TextEdit widget provides a powerful single-page rich text editor.</p>
 
258
<ul><li><a href="#introduction-and-concepts">Introduction and Concepts</a></li>
 
259
<li><a href="#using-q3textedit-as-a-display-widget">Using Q3TextEdit as a Display Widget</a></li>
 
260
<ul><li><a href="#read-only-key-bindings">Read-only key bindings</a></li>
 
261
<li><a href="#using-q3textedit-in-qt-logtext-mode">Using Q3TextEdit in Qt::LogText Mode</a></li>
 
262
</ul>
 
263
<li><a href="#using-q3textedit-as-an-editor">Using Q3TextEdit as an Editor</a></li>
 
264
<ul><li><a href="#editing-key-bindings">Editing key bindings</a></li>
 
265
</ul>
 
266
</ul>
 
267
<a name="introduction-and-concepts"></a>
 
268
<h3>Introduction and Concepts</h3>
 
269
<p>Q3TextEdit is an advanced WYSIWYG viewer/editor supporting rich text formatting using HTML-style tags. It is optimized to handle large documents and to respond quickly to user input.</p>
 
270
<p>Q3TextEdit has four modes of operation:</p>
 
271
<table align="center" cellpadding="2" cellspacing="1" border="0">
 
272
<tr valign="top" bgcolor="#a2c511"><th>Mode</th><th>Command</th><th>Notes</th></tr>
 
273
<tr valign="top" bgcolor="#f0f0f0"><td>Plain Text Editor</td><td>setTextFormat(<a href="qt.html#TextFormat-enum">Qt::PlainText</a>)</td><td>Set text with <a href="q3textedit.html#text-prop">setText</a>(); <a href="q3textedit.html#text-prop">text</a>() returns plain text. Text attributes (e.g. colors) can be set, but plain text is always returned.</td></tr>
 
274
<tr valign="top" bgcolor="#e0e0e0"><td>Rich Text Editor</td><td>setTextFormat(<a href="qt.html#TextFormat-enum">Qt::RichText</a>)</td><td>Set text with <a href="q3textedit.html#text-prop">setText</a>(); <a href="q3textedit.html#text-prop">text</a>() returns rich text. Rich text editing is fairly limited. You can't set margins or insert images for example (although you can read and correctly display files that have margins set and that include images). This mode is mostly useful for editing small amounts of rich text.</td></tr>
 
275
<tr valign="top" bgcolor="#f0f0f0"><td>Text Viewer</td><td>setReadOnly(true)</td><td>Set text with <a href="q3textedit.html#text-prop">setText</a>() or <a href="q3textedit.html#append">append</a>() (which has no undo history so is faster and uses less memory); <a href="q3textedit.html#text-prop">text</a>() returns plain or rich text depending on the <a href="q3textedit.html#textFormat-prop">textFormat</a>(). This mode can correctly display a large subset of HTML tags.</td></tr>
 
276
<tr valign="top" bgcolor="#e0e0e0"><td>Log Viewer</td><td>setTextFormat(<a href="qt.html#TextFormat-enum">Qt::LogText</a>)</td><td>Append text using <a href="q3textedit.html#append">append</a>(). The widget is set to be read only and rich text support is disabled although a few HTML tags (for color, bold, italic and underline) may be used. (See <a href="#logtextmode">Qt::LogText mode</a> for details.)</td></tr>
 
277
</table>
 
278
<p>Q3TextEdit can be used as a syntax highlighting editor when used in conjunction with <a href="porting4.html#qsyntaxhighlighter">QSyntaxHighlighter</a>.</p>
 
279
<p>We recommend that you always call <a href="q3textedit.html#textFormat-prop">setTextFormat</a>() to set the mode you want to use. If you use <tt>Qt::AutoText</tt> then <a href="q3textedit.html#text-prop">setText</a>() and <a href="q3textedit.html#append">append</a>() will try to determine whether the text they are given is plain text or rich text. If you use <tt>Qt::RichText</tt> then <a href="q3textedit.html#text-prop">setText</a>() and <a href="q3textedit.html#append">append</a>() will assume that the text they are given is rich text. <a href="q3textedit.html#insert">insert</a>() simply inserts the text it is given.</p>
 
280
<p>Q3TextEdit works on paragraphs and characters. A paragraph is a formatted string which is word-wrapped to fit into the width of the widget. By default when reading plain text, one newline signify a paragraph. A document consists of zero or more paragraphs, indexed from 0. Characters are indexed on a per-paragraph basis, also indexed from 0. The words in the paragraph are aligned in accordance with the paragraph's <a href="q3textedit.html#alignment">alignment</a>(). Paragraphs are separated by hard line breaks. Each character within a paragraph has its own attributes, for example, font and color.</p>
 
281
<p>The text edit documentation uses the following concepts:</p>
 
282
<ul>
 
283
<li><i>current format</i> -- this is the format at the current cursor position, <i>and</i> it is the format of the selected text if any.</li>
 
284
<li><i>current paragraph</i> -- the paragraph which contains the cursor.</li>
 
285
</ul>
 
286
<p>Q3TextEdit can display images (using <a href="q3mimesourcefactory.html">Q3MimeSourceFactory</a>), lists and tables. If the text is too large to view within the text edit's viewport, scrollbars will appear. The text edit can load both plain text and HTML files (a subset of HTML 3.2 and 4). The rendering style and the set of valid tags are defined by a <a href="q3textedit.html#styleSheet">styleSheet</a>(). Custom tags can be created and placed in a custom style sheet. Change the style sheet with <a href="q3textedit.html#setStyleSheet">setStyleSheet</a>(); see <a href="q3stylesheet.html">Q3StyleSheet</a> for details. The images identified by image tags are displayed if they can be interpreted using the text edit's <a href="q3mimesourcefactory.html">Q3MimeSourceFactory</a>; see <a href="q3textedit.html#setMimeSourceFactory">setMimeSourceFactory</a>().</p>
 
287
<p>If you want a text browser with more navigation use <a href="qtextbrowser.html">QTextBrowser</a>. If you just need to display a small piece of rich text use <a href="qlabel.html">QLabel</a> or <a href="porting4.html#qsimplerichtext">QSimpleRichText</a>.</p>
 
288
<p>If you create a new Q3TextEdit, and want to allow the user to edit rich text, call setTextFormat(<a href="qt.html#TextFormat-enum">Qt::RichText</a>) to ensure that the text is treated as rich text. (Rich text uses HTML tags to set text formatting attributes. See <a href="q3stylesheet.html">Q3StyleSheet</a> for information on the HTML tags that are supported.). If you don't call <a href="q3textedit.html#textFormat-prop">setTextFormat</a>() explicitly the text edit will guess from the text itself whether it is rich text or plain text. This means that if the text looks like HTML or XML it will probably be interpreted as rich text, so you should call setTextFormat(<a href="qt.html#TextFormat-enum">Qt::PlainText</a>) to preserve such text.</p>
 
289
<p>Note that we do not intend to add a full-featured web browser widget to Qt (because that would easily double Qt's size and only a few applications would benefit from it). The rich text support in Qt is designed to provide a fast, portable and efficient way to add reasonable online help facilities to applications, and to provide a basis for rich text editors.</p>
 
290
<a name="using-q3textedit-as-a-display-widget"></a>
 
291
<h3>Using Q3TextEdit as a Display Widget</h3>
 
292
<p>Q3TextEdit can display a large HTML subset, including tables and images.</p>
 
293
<p>The text is set or replaced using <a href="q3textedit.html#text-prop">setText</a>() which deletes any existing text and replaces it with the text passed in the <a href="q3textedit.html#text-prop">setText</a>() call. If you call <a href="q3textedit.html#text-prop">setText</a>() with legacy HTML (with setTextFormat(<a href="qt.html#TextFormat-enum">Qt::RichText</a>) in force), and then call <a href="q3textedit.html#text-prop">text</a>(), the text that is returned may have different markup, but will render the same. Text can be inserted with <a href="q3textedit.html#insert">insert</a>(), <a href="q3textedit.html#paste">paste</a>(), <a href="q3textedit.html#pasteSubType">pasteSubType</a>() and <a href="q3textedit.html#append">append</a>(). Text that is appended does not go into the undo history; this makes <a href="q3textedit.html#append">append</a>() faster and consumes less memory. Text can also be <a href="q3textedit.html#cut">cut</a>(). The entire text is deleted with <a href="q3textedit.html#clear">clear</a>() and the selected text is deleted with <a href="q3textedit.html#removeSelectedText">removeSelectedText</a>(). Selected (marked) text can also be deleted with <a href="q3textedit.html#del">del</a>() (which will delete the character to the right of the cursor if no text is selected).</p>
 
294
<p>Loading and saving text is achieved using <a href="q3textedit.html#text-prop">setText</a>() and <a href="q3textedit.html#text-prop">text</a>(), for example:</p>
 
295
<pre>&nbsp;   QFile file(fileName); // Read the text from a file
 
296
    if (file.open(IO_ReadOnly)) {
 
297
        QTextStream stream(&amp;file);
 
298
        textEdit-&gt;setText(stream.read());
 
299
    }
 
300
 
 
301
    QFile file(fileName); // Write the text to a file
 
302
    if (file.open(IO_WriteOnly)) {
 
303
        QTextStream stream(&amp;file);
 
304
        stream &lt;&lt; textEdit-&gt;text();
 
305
        textEdit-&gt;setModified(false);
 
306
    }</pre>
 
307
<p>By default the text edit wraps words at whitespace to fit within the text edit widget. The <a href="q3textedit.html#wordWrap-prop">setWordWrap</a>() function is used to specify the kind of word wrap you want, or <tt>NoWrap</tt> if you don't want any wrapping. Call <a href="q3textedit.html#wordWrap-prop">setWordWrap</a>() to set a fixed pixel width <tt>FixedPixelWidth</tt>, or character column (e.g. 80 column) <tt>FixedColumnWidth</tt> with the pixels or columns specified with <a href="q3textedit.html#wrapColumnOrWidth-prop">setWrapColumnOrWidth</a>(). If you use word wrap to the widget's width <tt>WidgetWidth</tt>, you can specify whether to break on whitespace or anywhere with <a href="q3textedit.html#wrapPolicy-prop">setWrapPolicy</a>().</p>
 
308
<p>The background color is set differently than other widgets, using <a href="q3textedit.html#paper-prop">setPaper</a>(). You specify a brush style which could be a plain color or a complex pixmap.</p>
 
309
<p>Hypertext links are automatically underlined; this can be changed with <a href="q3textedit.html#linkUnderline-prop">setLinkUnderline</a>(). The tab stop width is set with <a href="q3textedit.html#tabStopWidth-prop">setTabStopWidth</a>().</p>
 
310
<p>The <a href="q3textedit.html#zoomIn">zoomIn</a>() and <a href="q3textedit.html#zoomOut">zoomOut</a>() functions can be used to resize the text by increasing (decreasing for <a href="q3textedit.html#zoomOut">zoomOut</a>()) the point size used. Images are not affected by the zoom functions.</p>
 
311
<p>The <a href="q3textedit.html#lines">lines</a>() function returns the number of lines in the text and <a href="q3textedit.html#paragraphs">paragraphs</a>() returns the number of paragraphs. The number of lines within a particular paragraph is returned by <a href="q3textedit.html#linesOfParagraph">linesOfParagraph</a>(). The length of the entire text in characters is returned by <a href="q3textedit.html#length-prop">length</a>().</p>
 
312
<p>You can scroll to an anchor in the text, e.g. <tt>&lt;a name=&quot;anchor&quot;&gt;</tt> with <a href="q3textedit.html#scrollToAnchor">scrollToAnchor</a>(). The <a href="q3textedit.html#find">find</a>() function can be used to find and select a given string within the text.</p>
 
313
<p>A read-only Q3TextEdit provides the same functionality as the (obsolete) <a href="porting4.html#qtextview">QTextView</a>. (<a href="porting4.html#qtextview">QTextView</a> is still supplied for compatibility with old code.)</p>
 
314
<a name="read-only-key-bindings"></a>
 
315
<h4>Read-only key bindings</h4>
 
316
<p>When Q3TextEdit is used read-only the key-bindings are limited to navigation, and text may only be selected with the mouse:</p>
 
317
<table align="center" cellpadding="2" cellspacing="1" border="0">
 
318
<tr valign="top" bgcolor="#a2c511"><th>Keypresses</th><th>Action</th></tr>
 
319
<tr valign="top" bgcolor="#f0f0f0"><td><a href="qt.html#ArrowType-enum">Qt::UpArrow</a></td><td>Move one line up</td></tr>
 
320
<tr valign="top" bgcolor="#e0e0e0"><td><a href="qt.html#ArrowType-enum">Qt::DownArrow</a></td><td>Move one line down</td></tr>
 
321
<tr valign="top" bgcolor="#f0f0f0"><td><a href="qt.html#ArrowType-enum">Qt::LeftArrow</a></td><td>Move one character left</td></tr>
 
322
<tr valign="top" bgcolor="#e0e0e0"><td><a href="qt.html#ArrowType-enum">Qt::RightArrow</a></td><td>Move one character right</td></tr>
 
323
<tr valign="top" bgcolor="#f0f0f0"><td>PageUp</td><td>Move one (viewport) page up</td></tr>
 
324
<tr valign="top" bgcolor="#e0e0e0"><td>PageDown</td><td>Move one (viewport) page down</td></tr>
 
325
<tr valign="top" bgcolor="#f0f0f0"><td>Home</td><td>Move to the beginning of the text</td></tr>
 
326
<tr valign="top" bgcolor="#e0e0e0"><td>End</td><td>Move to the end of the text</td></tr>
 
327
<tr valign="top" bgcolor="#f0f0f0"><td>Shift+Wheel</td><td>Scroll the page horizontally (the Wheel is the mouse wheel)</td></tr>
 
328
<tr valign="top" bgcolor="#e0e0e0"><td>Ctrl+Wheel</td><td>Zoom the text</td></tr>
 
329
</table>
 
330
<p>The text edit may be able to provide some meta-information. For example, the <a href="q3textedit.html#documentTitle-prop">documentTitle</a>() function will return the text from within HTML <tt>&lt;title&gt;</tt> tags.</p>
 
331
<p>The text displayed in a text edit has a <i>context</i>. The context is a path which the text edit's <a href="q3mimesourcefactory.html">Q3MimeSourceFactory</a> uses to resolve the locations of files and images. It is passed to the <a href="q3textedit.html#mimeSourceFactory">mimeSourceFactory</a>() when quering data. (See <a href="q3textedit.html#Q3TextEdit">Q3TextEdit</a>() and <a href="q3textedit.html#context">context</a>().)</p>
 
332
<a name="logtextmode"></a><a name="using-q3textedit-in-qt-logtext-mode"></a>
 
333
<h4>Using Q3TextEdit in Qt::LogText Mode</h4>
 
334
<p>Setting the text format to <tt>Qt::LogText</tt> puts the widget in a special mode which is optimized for very large texts. In this mode editing and rich text support are disabled (the widget is explicitly set to read-only mode). This allows the text to be stored in a different, more memory efficient manner. However, a certain degree of text formatting is supported through the use of formatting tags. A tag is delimited by <tt>&lt;</tt> and <tt>&gt;</tt>. The characters <tt>&lt;</tt>, <tt>&gt;</tt> and <tt>&amp;</tt> are escaped by using <tt>&amp;lt;</tt>, <tt>&amp;gt;</tt> and <tt>&amp;amp;</tt>. A tag pair consists of a left and a right tag (or open/close tags). Left-tags mark the starting point for formatting, while right-tags mark the ending point. A right-tag always start with a <tt>/</tt> before the tag keyword. For example <tt>&lt;b&gt;</tt> and <tt>&lt;/b&gt;</tt> are a tag pair. Tags can be nested, but they have to be closed in the same order as they 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.</p>
 
335
<p>By using tags it is possible to change the color, bold, italic and underline settings for a piece of text. A color can be specified by using the HTML font tag <tt>&lt;font color=colorname&gt;</tt>. The color name can be one of the color names from the <a href="winsystem.html#x11">X11</a> color database, or a RGB hex value (e.g <tt>#00ff00</tt>). Example of valid color tags: <tt>&lt;font color=red&gt;</tt>, <tt>&lt;font color=&quot;light blue&quot;&gt;</tt>,<tt>&lt;font color=&quot;#223344&quot;&gt;</tt>. Bold, italic and underline settings can be specified by the tags <tt>&lt;b&gt;</tt>, <tt>&lt;i&gt;</tt> and <tt>&lt;u&gt;</tt>. Note that a tag does not necessarily have to be closed. A valid example:</p>
 
336
<pre>&nbsp;   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;.
 
337
    &lt;font color=green&gt;&lt;font color=yellow&gt;Yellow,&lt;/font&gt; and &lt;u&gt;green&lt;/u&gt;.</pre>
 
338
<p>Stylesheets can also be used in <a href="qt.html#TextFormat-enum">Qt::LogText</a> mode. To create and use a custom tag, you could do the following:</p>
 
339
<pre>&nbsp;   Q3TextEdit * log = new Q3TextEdit(this);
 
340
    log-&gt;setTextFormat(Qt::LogText);
 
341
    Q3StyleSheetItem * item = new Q3StyleSheetItem(log-&gt;styleSheet(), &quot;mytag&quot;);
 
342
    item-&gt;setColor(&quot;red&quot;);
 
343
    item-&gt;setFontWeight(QFont::Bold);
 
344
    item-&gt;setFontUnderline(true);
 
345
    log-&gt;append(&quot;This is a &lt;mytag&gt;custom tag&lt;/mytag&gt;!&quot;);</pre>
 
346
<p>Note that only the color, bold, underline and italic attributes of a <a href="q3stylesheetitem.html">Q3StyleSheetItem</a> is used in <a href="qt.html#TextFormat-enum">Qt::LogText</a> mode.</p>
 
347
<p>Note that you can use setMaxLogLines() to limit the number of lines the widget can hold in <a href="qt.html#TextFormat-enum">Qt::LogText</a> mode.</p>
 
348
<p>There are a few things that you need to be aware of when the widget is in this mode:</p>
 
349
<ul>
 
350
<li>Functions that deal with rich text formatting and cursor movement will not work or return anything valid.</li>
 
351
<li>Lines are equivalent to paragraphs.</li>
 
352
</ul>
 
353
<a name="using-q3textedit-as-an-editor"></a>
 
354
<h3>Using Q3TextEdit as an Editor</h3>
 
355
<p>All the information about using Q3TextEdit as a display widget also applies here.</p>
 
356
<p>The current format's attributes are set with <a href="q3textedit.html#setItalic">setItalic</a>(), <a href="q3textedit.html#setBold">setBold</a>(), <a href="q3textedit.html#setUnderline">setUnderline</a>(), <a href="q3textedit.html#setFamily">setFamily</a>() (font family), <a href="q3textedit.html#setPointSize">setPointSize</a>(), <a href="q3textedit.html#setColor">setColor</a>() and <a href="q3textedit.html#setCurrentFont">setCurrentFont</a>(). The current paragraph's alignment is set with <a href="q3textedit.html#setAlignment">setAlignment</a>().</p>
 
357
<p>Use <a href="q3textedit.html#setSelection">setSelection</a>() to select text. The <a href="q3textedit.html#setSelectionAttributes">setSelectionAttributes</a>() function is used to indicate how selected text should be displayed. Use <a href="q3textedit.html#hasSelectedText-prop">hasSelectedText</a>() to find out if any text is selected. The currently selected text's position is available using <a href="q3textedit.html#getSelection">getSelection</a>() and the selected text itself is returned by <a href="q3textedit.html#selectedText-prop">selectedText</a>(). The selection can be copied to the clipboard with <a href="q3textedit.html#copy">copy</a>(), or cut to the clipboard with <a href="q3textedit.html#cut">cut</a>(). It can be deleted with <a href="q3textedit.html#removeSelectedText">removeSelectedText</a>(). The entire text can be selected (or unselected) using <a href="q3textedit.html#selectAll">selectAll</a>(). Q3TextEdit supports multiple selections. Most of the selection functions operate on the default selection, selection 0. If the user presses a non-selecting key, e.g. a cursor key without also holding down Shift, all selections are cleared.</p>
 
358
<p>Set and get the position of the cursor with <a href="q3textedit.html#setCursorPosition">setCursorPosition</a>() and <a href="q3textedit.html#getCursorPosition">getCursorPosition</a>() respectively. When the cursor is moved, the signals <a href="q3textedit.html#currentFontChanged">currentFontChanged</a>(), <a href="q3textedit.html#currentColorChanged">currentColorChanged</a>() and <a href="q3textedit.html#currentAlignmentChanged">currentAlignmentChanged</a>() are emitted to reflect the font, color and alignment at the new cursor position.</p>
 
359
<p>If the text changes, the <a href="q3textedit.html#textChanged">textChanged</a>() signal is emitted, and if the user inserts a new line by pressing Return or Enter, <a href="q3textedit.html#returnPressed">returnPressed</a>() is emitted. The <a href="q3textedit.html#modified-prop">isModified</a>() function will return true if the text has been modified.</p>
 
360
<p>Q3TextEdit provides command-based undo and redo. To set the depth of the command history use <a href="q3textedit.html#undoDepth-prop">setUndoDepth</a>() which defaults to 100 steps. To undo or redo the last operation call <a href="q3textedit.html#undo">undo</a>() or <a href="q3textedit.html#redo">redo</a>(). The signals <a href="q3textedit.html#undoAvailable">undoAvailable</a>() and <a href="q3textedit.html#redoAvailable">redoAvailable</a>() indicate whether the undo and redo operations can be executed.</p>
 
361
<a name="editing-key-bindings"></a>
 
362
<h4>Editing key bindings</h4>
 
363
<p>The list of key-bindings which are implemented for editing:</p>
 
364
<table align="center" cellpadding="2" cellspacing="1" border="0">
 
365
<tr valign="top" bgcolor="#a2c511"><th>Keypresses</th><th>Action</th></tr>
 
366
<tr valign="top" bgcolor="#f0f0f0"><td>Backspace</td><td>Delete the character to the left of the cursor</td></tr>
 
367
<tr valign="top" bgcolor="#e0e0e0"><td>Delete</td><td>Delete the character to the right of the cursor</td></tr>
 
368
<tr valign="top" bgcolor="#f0f0f0"><td>Ctrl+A</td><td>Move the cursor to the beginning of the line</td></tr>
 
369
<tr valign="top" bgcolor="#e0e0e0"><td>Ctrl+B</td><td>Move the cursor one character left</td></tr>
 
370
<tr valign="top" bgcolor="#f0f0f0"><td>Ctrl+C</td><td>Copy the marked text to the clipboard (also Ctrl+Insert under Windows)</td></tr>
 
371
<tr valign="top" bgcolor="#e0e0e0"><td>Ctrl+D</td><td>Delete the character to the right of the cursor</td></tr>
 
372
<tr valign="top" bgcolor="#f0f0f0"><td>Ctrl+E</td><td>Move the cursor to the end of the line</td></tr>
 
373
<tr valign="top" bgcolor="#e0e0e0"><td>Ctrl+F</td><td>Move the cursor one character right</td></tr>
 
374
<tr valign="top" bgcolor="#f0f0f0"><td>Ctrl+H</td><td>Delete the character to the left of the cursor</td></tr>
 
375
<tr valign="top" bgcolor="#e0e0e0"><td>Ctrl+K</td><td>Delete to end of line</td></tr>
 
376
<tr valign="top" bgcolor="#f0f0f0"><td>Ctrl+N</td><td>Move the cursor one line down</td></tr>
 
377
<tr valign="top" bgcolor="#e0e0e0"><td>Ctrl+P</td><td>Move the cursor one line up</td></tr>
 
378
<tr valign="top" bgcolor="#f0f0f0"><td>Ctrl+V</td><td>Paste the clipboard text into line edit (also Shift+Insert under Windows)</td></tr>
 
379
<tr valign="top" bgcolor="#e0e0e0"><td>Ctrl+X</td><td>Cut the marked text, copy to clipboard (also Shift+Delete under Windows)</td></tr>
 
380
<tr valign="top" bgcolor="#f0f0f0"><td>Ctrl+Z</td><td>Undo the last operation</td></tr>
 
381
<tr valign="top" bgcolor="#e0e0e0"><td>Ctrl+Y</td><td>Redo the last operation</td></tr>
 
382
<tr valign="top" bgcolor="#f0f0f0"><td><a href="qt.html#ArrowType-enum">Qt::LeftArrow</a></td><td>Move the cursor one character left</td></tr>
 
383
<tr valign="top" bgcolor="#e0e0e0"><td>Ctrl+<a href="qt.html#ArrowType-enum">Qt::LeftArrow</a></td><td>Move the cursor one word left</td></tr>
 
384
<tr valign="top" bgcolor="#f0f0f0"><td><a href="qt.html#ArrowType-enum">Qt::RightArrow</a></td><td>Move the cursor one character right</td></tr>
 
385
<tr valign="top" bgcolor="#e0e0e0"><td>Ctrl+<a href="qt.html#ArrowType-enum">Qt::RightArrow</a></td><td>Move the cursor one word right</td></tr>
 
386
<tr valign="top" bgcolor="#f0f0f0"><td><a href="qt.html#ArrowType-enum">Qt::UpArrow</a></td><td>Move the cursor one line up</td></tr>
 
387
<tr valign="top" bgcolor="#e0e0e0"><td>Ctrl+<a href="qt.html#ArrowType-enum">Qt::UpArrow</a></td><td>Move the cursor one word up</td></tr>
 
388
<tr valign="top" bgcolor="#f0f0f0"><td><a href="qt.html#ArrowType-enum">Qt::DownArrow</a></td><td>Move the cursor one line down</td></tr>
 
389
<tr valign="top" bgcolor="#e0e0e0"><td>Ctrl+Down Arrow</td><td>Move the cursor one word down</td></tr>
 
390
<tr valign="top" bgcolor="#f0f0f0"><td>PageUp</td><td>Move the cursor one page up</td></tr>
 
391
<tr valign="top" bgcolor="#e0e0e0"><td>PageDown</td><td>Move the cursor one page down</td></tr>
 
392
<tr valign="top" bgcolor="#f0f0f0"><td>Home</td><td>Move the cursor to the beginning of the line</td></tr>
 
393
<tr valign="top" bgcolor="#e0e0e0"><td>Ctrl+Home</td><td>Move the cursor to the beginning of the text</td></tr>
 
394
<tr valign="top" bgcolor="#f0f0f0"><td>End</td><td>Move the cursor to the end of the line</td></tr>
 
395
<tr valign="top" bgcolor="#e0e0e0"><td>Ctrl+End</td><td>Move the cursor to the end of the text</td></tr>
 
396
<tr valign="top" bgcolor="#f0f0f0"><td>Shift+Wheel</td><td>Scroll the page horizontally (the Wheel is the mouse wheel)</td></tr>
 
397
<tr valign="top" bgcolor="#e0e0e0"><td>Ctrl+Wheel</td><td>Zoom the text</td></tr>
 
398
</table>
 
399
<p>To select (mark) text hold down the Shift key whilst pressing one of the movement keystrokes, for example, <i>Shift+Right Arrow</i> will select the character to the right, and <i>Shift+Ctrl+Right Arrow</i> will select the word to the right, etc.</p>
 
400
<p>By default the text edit widget operates in insert mode so all text that the user enters is inserted into the text edit and any text to the right of the cursor is moved out of the way. The mode can be changed to overwrite, where new text overwrites any text to the right of the cursor, using <a href="q3textedit.html#overwriteMode-prop">setOverwriteMode</a>().</p>
 
401
<hr />
 
402
<h2>Member Type Documentation</h2>
 
403
<h3 class="flags"><a name="AutoFormattingFlag-enum"></a>enum Q3TextEdit::AutoFormattingFlag<br />flags Q3TextEdit::AutoFormatting</h3>
 
404
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
405
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
406
<tr><td valign="top"><tt>Q3TextEdit::AutoNone</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Do not perform any automatic formatting</td></tr>
 
407
<tr><td valign="top"><tt>Q3TextEdit::AutoBulletList</tt></td><td align="center" valign="top"><tt>0x00000001</tt></td><td valign="top">Only automatically format bulletted lists</td></tr>
 
408
<tr><td valign="top"><tt>Q3TextEdit::AutoAll</tt></td><td align="center" valign="top"><tt>0xffffffff</tt></td><td valign="top">Apply all available autoformatting</td></tr>
 
409
</table>
 
410
<p>The AutoFormatting type is a typedef for <a href="qflags.html">QFlags</a>&lt;AutoFormattingFlag&gt;. It stores an OR combination of AutoFormattingFlag values.</p>
 
411
<h3 class="fn"><a name="CursorAction-enum"></a>enum Q3TextEdit::CursorAction</h3>
 
412
<p>This enum is used by <a href="q3textedit.html#moveCursor">moveCursor</a>() to specify in which direction the cursor should be moved:</p>
 
413
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
414
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
415
<tr><td valign="top"><tt>Q3TextEdit::MoveBackward</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Moves the cursor one character backward</td></tr>
 
416
<tr><td valign="top"><tt>Q3TextEdit::MoveWordBackward</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">Moves the cursor one word backward</td></tr>
 
417
<tr><td valign="top"><tt>Q3TextEdit::MoveForward</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Moves the cursor one character forward</td></tr>
 
418
<tr><td valign="top"><tt>Q3TextEdit::MoveWordForward</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">Moves the cursor one word forward</td></tr>
 
419
<tr><td valign="top"><tt>Q3TextEdit::MoveUp</tt></td><td align="center" valign="top"><tt>4</tt></td><td valign="top">Moves the cursor up one line</td></tr>
 
420
<tr><td valign="top"><tt>Q3TextEdit::MoveDown</tt></td><td align="center" valign="top"><tt>5</tt></td><td valign="top">Moves the cursor down one line</td></tr>
 
421
<tr><td valign="top"><tt>Q3TextEdit::MoveLineStart</tt></td><td align="center" valign="top"><tt>6</tt></td><td valign="top">Moves the cursor to the beginning of the line</td></tr>
 
422
<tr><td valign="top"><tt>Q3TextEdit::MoveLineEnd</tt></td><td align="center" valign="top"><tt>7</tt></td><td valign="top">Moves the cursor to the end of the line</td></tr>
 
423
<tr><td valign="top"><tt>Q3TextEdit::MoveHome</tt></td><td align="center" valign="top"><tt>8</tt></td><td valign="top">Moves the cursor to the beginning of the document</td></tr>
 
424
<tr><td valign="top"><tt>Q3TextEdit::MoveEnd</tt></td><td align="center" valign="top"><tt>9</tt></td><td valign="top">Moves the cursor to the end of the document</td></tr>
 
425
<tr><td valign="top"><tt>Q3TextEdit::MovePgUp</tt></td><td align="center" valign="top"><tt>10</tt></td><td valign="top">Moves the cursor one viewport page up</td></tr>
 
426
<tr><td valign="top"><tt>Q3TextEdit::MovePgDown</tt></td><td align="center" valign="top"><tt>11</tt></td><td valign="top">Moves the cursor one viewport page down</td></tr>
 
427
</table>
 
428
<h3 class="fn"><a name="KeyboardAction-enum"></a>enum Q3TextEdit::KeyboardAction</h3>
 
429
<p>This enum is used by <a href="q3textedit.html#doKeyboardAction">doKeyboardAction</a>() to specify which action should be executed:</p>
 
430
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
431
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
432
<tr><td valign="top"><tt>Q3TextEdit::ActionBackspace</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Delete the character to the left of the cursor.</td></tr>
 
433
<tr><td valign="top"><tt>Q3TextEdit::ActionDelete</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Delete the character to the right of the cursor.</td></tr>
 
434
<tr><td valign="top"><tt>Q3TextEdit::ActionReturn</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">Split the paragraph at the cursor position.</td></tr>
 
435
<tr><td valign="top"><tt>Q3TextEdit::ActionKill</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">If the cursor is not at the end of the paragraph, delete the text from the cursor position until the end of the paragraph. If the cursor is at the end of the paragraph, delete the hard line break at the end of the paragraph: this will cause this paragraph to be joined with the following paragraph.</td></tr>
 
436
<tr><td valign="top"><tt>Q3TextEdit::ActionWordBackspace</tt></td><td align="center" valign="top"><tt>4</tt></td><td valign="top">Delete the word to the left of the cursor position.</td></tr>
 
437
<tr><td valign="top"><tt>Q3TextEdit::ActionWordDelete</tt></td><td align="center" valign="top"><tt>5</tt></td><td valign="top">Delete the word to the right of the cursor position</td></tr>
 
438
</table>
 
439
<h3 class="fn"><a name="VerticalAlignment-enum"></a>enum Q3TextEdit::VerticalAlignment</h3>
 
440
<p>This enum is used to set the vertical alignment of the text.</p>
 
441
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
442
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
443
<tr><td valign="top"><tt>Q3TextEdit::AlignNormal</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Normal alignment</td></tr>
 
444
<tr><td valign="top"><tt>Q3TextEdit::AlignSuperScript</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Superscript</td></tr>
 
445
<tr><td valign="top"><tt>Q3TextEdit::AlignSubScript</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">Subscript</td></tr>
 
446
</table>
 
447
<h3 class="fn"><a name="WordWrap-enum"></a>enum Q3TextEdit::WordWrap</h3>
 
448
<p>This enum defines the <a href="q3textedit.html">Q3TextEdit</a>'s word wrap modes.</p>
 
449
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
450
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
451
<tr><td valign="top"><tt>Q3TextEdit::NoWrap</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Do not wrap the text.</td></tr>
 
452
<tr><td valign="top"><tt>Q3TextEdit::WidgetWidth</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Wrap the text at the current width of the widget (this is the default). Wrapping is at whitespace by default; this can be changed with <a href="q3textedit.html#wrapPolicy-prop">setWrapPolicy</a>().</td></tr>
 
453
<tr><td valign="top"><tt>Q3TextEdit::FixedPixelWidth</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">Wrap the text at a fixed number of pixels from the widget's left side. The number of pixels is set with <a href="q3textedit.html#wrapColumnOrWidth-prop">wrapColumnOrWidth</a>().</td></tr>
 
454
<tr><td valign="top"><tt>Q3TextEdit::FixedColumnWidth</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">Wrap the text at a fixed number of character columns from the widget's left side. The number of characters is set with <a href="q3textedit.html#wrapColumnOrWidth-prop">wrapColumnOrWidth</a>(). This is useful if you need formatted text that can also be displayed gracefully on devices with monospaced fonts, for example a standard VT100 terminal, where you might set <a href="q3textedit.html#wrapColumnOrWidth-prop">wrapColumnOrWidth</a>() to 80.</td></tr>
 
455
</table>
 
456
<p>See also <a href="q3textedit.html#wordWrap-prop">setWordWrap</a>() and <a href="q3textedit.html#wordWrap-prop">wordWrap</a>().</p>
 
457
<h3 class="fn"><a name="WrapPolicy-enum"></a>enum Q3TextEdit::WrapPolicy</h3>
 
458
<p>This enum defines where text can be wrapped in word wrap mode.</p>
 
459
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
460
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
461
<tr><td valign="top"><tt>Q3TextEdit::AtWhiteSpace</tt></td><td align="center" valign="top"><tt>AtWordBoundary</tt></td><td valign="top">Don't use this deprecated value (it is a synonym for <tt>AtWordBoundary</tt> which you should use instead).</td></tr>
 
462
<tr><td valign="top"><tt>Q3TextEdit::Anywhere</tt></td><td align="center" valign="top">&nbsp;</td><td valign="top">Break anywhere, including within words.</td></tr>
 
463
<tr><td valign="top"><tt>Q3TextEdit::AtWordBoundary</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Break lines at word boundaries, e.g. spaces or newlines</td></tr>
 
464
<tr><td valign="top"><tt>Q3TextEdit::AtWordOrDocumentBoundary</tt></td><td align="center" valign="top">&nbsp;</td><td valign="top">Break lines at whitespace, e.g. spaces or newlines if possible. Break it anywhere otherwise.</td></tr>
 
465
</table>
 
466
<p>See also <a href="q3textedit.html#wrapPolicy-prop">setWrapPolicy</a>().</p>
 
467
<hr />
 
468
<h2>Property Documentation</h2>
 
469
<h3 class="fn"><a name="autoFormatting-prop"></a>autoFormatting : <a href="q3textedit.html#AutoFormattingFlag-enum">AutoFormattingFlag</a></h3>
 
470
<p>This property holds the enabled set of auto formatting features.</p>
 
471
<p>The value can be any combination of the values in the <tt>AutoFormattingFlag</tt> enum. The default is <tt>AutoAll</tt>. Choose <tt>AutoNone</tt> to disable all automatic formatting.</p>
 
472
<p>Currently, the only automatic formatting feature provided is <tt>AutoBulletList</tt>; future versions of Qt may offer more.</p>
 
473
<p>Access functions:</p>
 
474
<ul>
 
475
<li><div class="fn"/><b>AutoFormatting autoFormatting () const</b></li>
 
476
<li><div class="fn"/><b>void setAutoFormatting ( AutoFormatting )</b></li>
 
477
</ul>
 
478
<h3 class="fn"><a name="documentTitle-prop"></a>documentTitle : const <a href="qstring.html">QString</a></h3>
 
479
<p>This property holds the title of the document parsed from the text.</p>
 
480
<p>For <tt>Qt::PlainText</tt> the title will be an empty string. For <tt>Qt::RichText</tt> the title will be the text between the <tt>&lt;title&gt;</tt> tags, if present, otherwise an empty string.</p>
 
481
<p>Access functions:</p>
 
482
<ul>
 
483
<li><div class="fn"/><b>QString documentTitle () const</b></li>
 
484
</ul>
 
485
<h3 class="fn"><a name="hasSelectedText-prop"></a>hasSelectedText : const bool</h3>
 
486
<p>This property holds whether some text is selected in selection 0.</p>
 
487
<p>Access functions:</p>
 
488
<ul>
 
489
<li><div class="fn"/><b>bool hasSelectedText () const</b></li>
 
490
</ul>
 
491
<h3 class="fn"><a name="length-prop"></a>length : const int</h3>
 
492
<p>This property holds the number of characters in the text.</p>
 
493
<p>Access functions:</p>
 
494
<ul>
 
495
<li><div class="fn"/><b>int length () const</b></li>
 
496
</ul>
 
497
<h3 class="fn"><a name="linkUnderline-prop"></a>linkUnderline : bool</h3>
 
498
<p>This property holds whether hypertext links will be underlined.</p>
 
499
<p>If true (the default) hypertext links will be displayed underlined. If false links will not be displayed underlined.</p>
 
500
<p>Access functions:</p>
 
501
<ul>
 
502
<li><div class="fn"/><b>bool linkUnderline () const</b></li>
 
503
<li><div class="fn"/><b>virtual void setLinkUnderline ( bool )</b></li>
 
504
</ul>
 
505
<h3 class="fn"><a name="modified-prop"></a>modified : bool</h3>
 
506
<p>This property holds whether the document has been modified by the user.</p>
 
507
<p>Access functions:</p>
 
508
<ul>
 
509
<li><div class="fn"/><b>bool isModified () const</b></li>
 
510
<li><div class="fn"/><b>virtual void setModified ( bool <i>m</i> )</b></li>
 
511
</ul>
 
512
<h3 class="fn"><a name="overwriteMode-prop"></a>overwriteMode : bool</h3>
 
513
<p>This property holds the text edit's overwrite mode.</p>
 
514
<p>If false (the default) characters entered by the user are inserted with any characters to the right being moved out of the way. If true, the editor is in overwrite mode, i.e. characters entered by the user overwrite any characters to the right of the cursor position.</p>
 
515
<p>Access functions:</p>
 
516
<ul>
 
517
<li><div class="fn"/><b>bool isOverwriteMode () const</b></li>
 
518
<li><div class="fn"/><b>virtual void setOverwriteMode ( bool <i>b</i> )</b></li>
 
519
</ul>
 
520
<h3 class="fn"><a name="paper-prop"></a>paper : <a href="qbrush.html">QBrush</a></h3>
 
521
<p>This property holds the background (paper) brush.</p>
 
522
<p>The brush that is currently used to draw the background of the text edit. The initial setting is an empty brush.</p>
 
523
<p>Access functions:</p>
 
524
<ul>
 
525
<li><div class="fn"/><b>QBrush paper () const</b></li>
 
526
<li><div class="fn"/><b>virtual void setPaper ( const QBrush &amp; <i>pap</i> )</b></li>
 
527
</ul>
 
528
<h3 class="fn"><a name="readOnly-prop"></a>readOnly : bool</h3>
 
529
<p>This property holds whether the text edit is read-only.</p>
 
530
<p>In a read-only text edit the user can only navigate through the text and select text; modifying the text is not possible.</p>
 
531
<p>This property's default is false.</p>
 
532
<p>Access functions:</p>
 
533
<ul>
 
534
<li><div class="fn"/><b>bool isReadOnly () const</b></li>
 
535
<li><div class="fn"/><b>virtual void setReadOnly ( bool <i>b</i> )</b></li>
 
536
</ul>
 
537
<h3 class="fn"><a name="selectedText-prop"></a>selectedText : const <a href="qstring.html">QString</a></h3>
 
538
<p>This property holds the selected text (from selection 0) or an empty string if there is no currently selected text (in selection 0).</p>
 
539
<p>The text is always returned as <tt>Qt::PlainText</tt> if the <a href="q3textedit.html#textFormat-prop">textFormat</a>() is <tt>Qt::PlainText</tt> or <tt>Qt::AutoText</tt>, otherwise it is returned as HTML.</p>
 
540
<p>Access functions:</p>
 
541
<ul>
 
542
<li><div class="fn"/><b>QString selectedText () const</b></li>
 
543
</ul>
 
544
<p>See also <a href="q3textedit.html#hasSelectedText-prop">hasSelectedText</a>.</p>
 
545
<h3 class="fn"><a name="tabChangesFocus-prop"></a>tabChangesFocus : bool</h3>
 
546
<p>This property holds whether TAB changes focus or is accepted as input.</p>
 
547
<p>In some occasions text edits should not allow the user to input tabulators or change indentation using the TAB key, as this breaks the focus chain. The default is false.</p>
 
548
<p>Access functions:</p>
 
549
<ul>
 
550
<li><div class="fn"/><b>bool tabChangesFocus () const</b></li>
 
551
<li><div class="fn"/><b>virtual void setTabChangesFocus ( bool <i>b</i> )</b></li>
 
552
</ul>
 
553
<h3 class="fn"><a name="tabStopWidth-prop"></a>tabStopWidth : int</h3>
 
554
<p>This property holds the tab stop width in pixels.</p>
 
555
<p>Access functions:</p>
 
556
<ul>
 
557
<li><div class="fn"/><b>int tabStopWidth () const</b></li>
 
558
<li><div class="fn"/><b>virtual void setTabStopWidth ( int <i>ts</i> )</b></li>
 
559
</ul>
 
560
<h3 class="fn"><a name="text-prop"></a>text : <a href="qstring.html">QString</a></h3>
 
561
<p>This property holds the text edit's text.</p>
 
562
<p>There is no default text.</p>
 
563
<p>On setting, any previous text is deleted.</p>
 
564
<p>The text may be interpreted either as plain text or as rich text, depending on the <a href="q3textedit.html#textFormat-prop">textFormat</a>(). The default setting is <tt>Qt::AutoText</tt>, i.e. the text edit auto-detects the format of the text.</p>
 
565
<p>For richtext, calling text() on an editable <a href="q3textedit.html">Q3TextEdit</a> will cause the text to be regenerated from the textedit. This may mean that the <a href="qstring.html">QString</a> returned may not be exactly the same as the one that was set.</p>
 
566
<p>Access functions:</p>
 
567
<ul>
 
568
<li><div class="fn"/><b>QString text () const</b></li>
 
569
<li><div class="fn"/><b>QString text ( int <i>para</i> ) const</b></li>
 
570
<li><div class="fn"/><b>void setText ( const QString &amp; <i>txt</i> )</b></li>
 
571
<li><div class="fn"/><b>virtual void setText ( const QString &amp; <i>text</i>, const QString &amp; <i>context</i> )</b></li>
 
572
</ul>
 
573
<p>See also <a href="q3textedit.html#textFormat-prop">textFormat</a>.</p>
 
574
<h3 class="fn"><a name="textFormat-prop"></a>textFormat : <a href="qt.html#TextFormat-enum">Qt::TextFormat</a></h3>
 
575
<p>This property holds the text format: rich text, plain text, log text or auto text.</p>
 
576
<p>The text format is one of the following:</p>
 
577
<ul>
 
578
<li><a href="qt.html#TextFormat-enum">Qt::PlainText</a> - all characters, except newlines, are displayed verbatim, including spaces. Whenever a newline appears in the text the text edit inserts a hard line break and begins a new paragraph.</li>
 
579
<li><a href="qt.html#TextFormat-enum">Qt::RichText</a> - rich text rendering. The available styles are defined in the default stylesheet <a href="q3stylesheet.html#defaultSheet">Q3StyleSheet::defaultSheet</a>().</li>
 
580
<li><a href="qt.html#TextFormat-enum">Qt::LogText</a> - optimized mode for very large texts. Supports a very limited set of formatting tags (color, bold, underline and italic settings).</li>
 
581
<li><a href="qt.html#TextFormat-enum">Qt::AutoText</a> - this is the default. The text edit autodetects which rendering style is best, <tt>Qt::PlainText</tt> or <tt>Qt::RichText</tt>. This is done by using the <a href="q3stylesheet.html#mightBeRichText">Q3StyleSheet::mightBeRichText</a>() function.</li>
 
582
</ul>
 
583
<p>Access functions:</p>
 
584
<ul>
 
585
<li><div class="fn"/><b>Qt::TextFormat textFormat () const</b></li>
 
586
<li><div class="fn"/><b>virtual void setTextFormat ( Qt::TextFormat <i>f</i> )</b></li>
 
587
</ul>
 
588
<h3 class="fn"><a name="undoDepth-prop"></a>undoDepth : int</h3>
 
589
<p>This property holds the depth of the undo history.</p>
 
590
<p>The maximum number of steps in the undo/redo history. The default is 100.</p>
 
591
<p>Access functions:</p>
 
592
<ul>
 
593
<li><div class="fn"/><b>int undoDepth () const</b></li>
 
594
<li><div class="fn"/><b>virtual void setUndoDepth ( int <i>d</i> )</b></li>
 
595
</ul>
 
596
<p>See also <a href="q3textedit.html#undo">undo</a>() and <a href="q3textedit.html#redo">redo</a>().</p>
 
597
<h3 class="fn"><a name="undoRedoEnabled-prop"></a>undoRedoEnabled : bool</h3>
 
598
<p>This property holds whether undo/redo is enabled.</p>
 
599
<p>When changing this property, the undo/redo history is cleared.</p>
 
600
<p>The default is true.</p>
 
601
<p>Access functions:</p>
 
602
<ul>
 
603
<li><div class="fn"/><b>bool isUndoRedoEnabled () const</b></li>
 
604
<li><div class="fn"/><b>virtual void setUndoRedoEnabled ( bool <i>b</i> )</b></li>
 
605
</ul>
 
606
<h3 class="fn"><a name="wordWrap-prop"></a>wordWrap : <a href="q3textedit.html#WordWrap-enum">WordWrap</a></h3>
 
607
<p>This property holds the word wrap mode.</p>
 
608
<p>The default mode is <tt>WidgetWidth</tt> which causes words to be wrapped at the right edge of the text edit. Wrapping occurs at whitespace, keeping whole words intact. If you want wrapping to occur within words use <a href="q3textedit.html#wrapPolicy-prop">setWrapPolicy</a>(). If you set a wrap mode of <tt>FixedPixelWidth</tt> or <tt>FixedColumnWidth</tt> you should also call <a href="q3textedit.html#wrapColumnOrWidth-prop">setWrapColumnOrWidth</a>() with the width you want.</p>
 
609
<p>Access functions:</p>
 
610
<ul>
 
611
<li><div class="fn"/><b>WordWrap wordWrap () const</b></li>
 
612
<li><div class="fn"/><b>virtual void setWordWrap ( WordWrap <i>mode</i> )</b></li>
 
613
</ul>
 
614
<p>See also <a href="q3textedit.html#WordWrap-enum">WordWrap</a>, <a href="q3textedit.html#wrapColumnOrWidth-prop">wrapColumnOrWidth</a>, and <a href="q3textedit.html#wrapPolicy-prop">wrapPolicy</a>.</p>
 
615
<h3 class="fn"><a name="wrapColumnOrWidth-prop"></a>wrapColumnOrWidth : int</h3>
 
616
<p>This property holds the position (in pixels or columns depending on the wrap mode) where text will be wrapped.</p>
 
617
<p>If the wrap mode is <tt>FixedPixelWidth</tt>, the value is the number of pixels from the left edge of the text edit at which text should be wrapped. If the wrap mode is <tt>FixedColumnWidth</tt>, the value is the column number (in character columns) from the left edge of the text edit at which text should be wrapped.</p>
 
618
<p>Access functions:</p>
 
619
<ul>
 
620
<li><div class="fn"/><b>int wrapColumnOrWidth () const</b></li>
 
621
<li><div class="fn"/><b>virtual void setWrapColumnOrWidth ( int )</b></li>
 
622
</ul>
 
623
<p>See also <a href="q3textedit.html#wordWrap-prop">wordWrap</a>.</p>
 
624
<h3 class="fn"><a name="wrapPolicy-prop"></a>wrapPolicy : <a href="q3textedit.html#WrapPolicy-enum">WrapPolicy</a></h3>
 
625
<p>This property holds the word wrap policy, at whitespace or anywhere.</p>
 
626
<p>Defines where text can be wrapped when word wrap mode is not <tt>NoWrap</tt>. The choices are <tt>AtWordBoundary</tt> (the default), <tt>Anywhere</tt> and <tt>AtWordOrDocumentBoundary</tt></p>
 
627
<p>Access functions:</p>
 
628
<ul>
 
629
<li><div class="fn"/><b>WrapPolicy wrapPolicy () const</b></li>
 
630
<li><div class="fn"/><b>virtual void setWrapPolicy ( WrapPolicy <i>policy</i> )</b></li>
 
631
</ul>
 
632
<p>See also <a href="q3textedit.html#wordWrap-prop">wordWrap</a>.</p>
 
633
<hr />
 
634
<h2>Member Function Documentation</h2>
 
635
<h3 class="fn"><a name="Q3TextEdit"></a>Q3TextEdit::Q3TextEdit ( const <a href="qstring.html">QString</a> &amp; <i>text</i>, const <a href="qstring.html">QString</a> &amp; <i>context</i> = QString(), <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, const char * <i>name</i> = 0 )</h3>
 
636
<p>Constructs a <a href="q3textedit.html">Q3TextEdit</a> called <i>name</i>, with parent <i>parent</i>. The text edit will display the text <i>text</i> using context <i>context</i>.</p>
 
637
<p>The <i>context</i> is a path which the text edit's <a href="q3mimesourcefactory.html">Q3MimeSourceFactory</a> uses to resolve the locations of files and images. It is passed to the <a href="q3textedit.html#mimeSourceFactory">mimeSourceFactory</a>() when quering data.</p>
 
638
<p>For example if the text contains an image tag, <tt>&lt;img src=&quot;image.png&quot;&gt;</tt>, and the context is &quot;path/to/look/in&quot;, the <a href="q3mimesourcefactory.html">Q3MimeSourceFactory</a> will try to load the image from &quot;path/to/look/in/image.png&quot;. If the tag was <tt>&lt;img src=&quot;/image.png&quot;&gt;</tt>, the context will not be used (because <a href="q3mimesourcefactory.html">Q3MimeSourceFactory</a> recognizes that we have used an absolute path) and will try to load &quot;/image.png&quot;. The context is applied in exactly the same way to <i>hrefs</i>, for example, <tt>&lt;a href=&quot;target.html&quot;&gt;Target&lt;/a&gt;</tt>, would resolve to &quot;path/to/look/in/target.html&quot;.</p>
 
639
<h3 class="fn"><a name="Q3TextEdit-2"></a>Q3TextEdit::Q3TextEdit ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, const char * <i>name</i> = 0 )</h3>
 
640
<p>Constructs an empty <a href="q3textedit.html">Q3TextEdit</a> called <i>name</i>, with parent <i>parent</i>.</p>
 
641
<h3 class="fn"><a name="dtor.Q3TextEdit"></a>Q3TextEdit::~Q3TextEdit ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
642
<p>Destructor.</p>
 
643
<h3 class="fn"><a name="alignment"></a>int Q3TextEdit::alignment () const</h3>
 
644
<p>Returns the alignment of the current paragraph.</p>
 
645
<p>See also <a href="q3textedit.html#setAlignment">setAlignment</a>().</p>
 
646
<h3 class="fn"><a name="anchorAt"></a><a href="qstring.html">QString</a> Q3TextEdit::anchorAt ( const <a href="qpoint.html">QPoint</a> &amp; <i>pos</i>, <a href="qt.html#AnchorAttribute-enum">Qt::AnchorAttribute</a> <i>attr</i> = Qt::AnchorHref )</h3>
 
647
<p>Returns the text for the attribute <i>attr</i> (<tt>Qt::AnchorHref</tt> by default) if there is an anchor at position <i>pos</i> (in contents coordinates); otherwise returns an empty string.</p>
 
648
<h3 class="fn"><a name="append"></a>void Q3TextEdit::append ( const <a href="qstring.html">QString</a> &amp; <i>text</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
649
<p>Appends a new paragraph with <i>text</i> to the end of the text edit. Note that the undo/redo history is cleared by this function, and no undo history is kept for appends which makes them faster than <a href="q3textedit.html#insert">insert</a>()s. If you want to append text which is added to the undo/redo history as well, use <a href="q3textedit.html#insertParagraph">insertParagraph</a>().</p>
 
650
<h3 class="fn"><a name="bold"></a>bool Q3TextEdit::bold () const</h3>
 
651
<p>Returns true if the current format is bold; otherwise returns false.</p>
 
652
<p>See also <a href="q3textedit.html#setBold">setBold</a>().</p>
 
653
<h3 class="fn"><a name="charAt"></a>int Q3TextEdit::charAt ( const <a href="qpoint.html">QPoint</a> &amp; <i>pos</i>, int * <i>para</i> ) const</h3>
 
654
<p>Returns the index of the character (relative to its paragraph) at position <i>pos</i> (in contents coordinates). If <i>para</i> is not 0, <tt>*</tt><i>para</i> is set to the character's paragraph.</p>
 
655
<h3 class="fn"><a name="clear"></a>void Q3TextEdit::clear ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
656
<p>Deletes all the text in the text edit.</p>
 
657
<p>See also <a href="q3textedit.html#cut">cut</a>(), <a href="q3textedit.html#removeSelectedText">removeSelectedText</a>(), and <a href="q3textedit.html#text-prop">setText</a>().</p>
 
658
<h3 class="fn"><a name="clearParagraphBackground"></a>void Q3TextEdit::clearParagraphBackground ( int <i>para</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
659
<p>Clears the background color of the paragraph <i>para</i>, so that the default color is used again.</p>
 
660
<h3 class="fn"><a name="clicked"></a>void Q3TextEdit::clicked ( int <i>para</i>, int <i>pos</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
661
<p>This signal is emitted when the mouse is clicked on the paragraph <i>para</i> at character position <i>pos</i>.</p>
 
662
<p>See also <a href="q3textedit.html#doubleClicked">doubleClicked</a>().</p>
 
663
<h3 class="fn"><a name="color"></a><a href="qcolor.html">QColor</a> Q3TextEdit::color () const</h3>
 
664
<p>Returns the color of the current format.</p>
 
665
<p>See also <a href="q3textedit.html#setColor">setColor</a>() and <a href="q3textedit.html#paper-prop">setPaper</a>().</p>
 
666
<h3 class="fn"><a name="context"></a><a href="qstring.html">QString</a> Q3TextEdit::context () const</h3>
 
667
<p>Returns the context of the text edit. The context is a path which the text edit's <a href="q3mimesourcefactory.html">Q3MimeSourceFactory</a> uses to resolve the locations of files and images.</p>
 
668
<p>See also <a href="q3textedit.html#text-prop">text</a>.</p>
 
669
<h3 class="fn"><a name="copy"></a>void Q3TextEdit::copy ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
670
<p>Copies any selected text (from selection 0) to the clipboard.</p>
 
671
<p>See also <a href="q3textedit.html#hasSelectedText-prop">hasSelectedText</a>() and <a href="q3textedit.html#copyAvailable">copyAvailable</a>().</p>
 
672
<h3 class="fn"><a name="copyAvailable"></a>void Q3TextEdit::copyAvailable ( bool <i>yes</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
673
<p>This signal is emitted when text is selected or de-selected in the text edit.</p>
 
674
<p>When text is selected this signal will be emitted with <i>yes</i> set to true. If no text has been selected or if the selected text is de-selected this signal is emitted with <i>yes</i> set to false.</p>
 
675
<p>If <i>yes</i> is true then <a href="q3textedit.html#copy">copy</a>() can be used to copy the selection to the clipboard. If <i>yes</i> is false then <a href="q3textedit.html#copy">copy</a>() does nothing.</p>
 
676
<p>See also <a href="q3textedit.html#selectionChanged">selectionChanged</a>().</p>
 
677
<h3 class="fn"><a name="createPopupMenu"></a><a href="q3popupmenu.html">Q3PopupMenu</a> * Q3TextEdit::createPopupMenu ( const <a href="qpoint.html">QPoint</a> &amp; <i>pos</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
678
<p>This function is called to create a right mouse button popup menu at the document position <i>pos</i>. If you want to create a custom popup menu, reimplement this function and return the created popup menu. Ownership of the popup menu is transferred to the caller.</p>
 
679
<h3 class="fn"><a name="createPopupMenu-2"></a><a href="q3popupmenu.html">Q3PopupMenu</a> * Q3TextEdit::createPopupMenu ()&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
680
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
681
<p>This function is called to create a right mouse button popup menu. If you want to create a custom popup menu, reimplement this function and return the created popup menu. Ownership of the popup menu is transferred to the caller.</p>
 
682
<p>This function is only called if createPopupMenu(const <a href="qpoint.html">QPoint</a> &amp;) returns 0.</p>
 
683
<h3 class="fn"><a name="currentAlignmentChanged"></a>void Q3TextEdit::currentAlignmentChanged ( int <i>a</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
684
<p>This signal is emitted if the alignment of the current paragraph has changed.</p>
 
685
<p>The new alignment is <i>a</i>.</p>
 
686
<p>See also <a href="q3textedit.html#setAlignment">setAlignment</a>().</p>
 
687
<h3 class="fn"><a name="currentColorChanged"></a>void Q3TextEdit::currentColorChanged ( const <a href="qcolor.html">QColor</a> &amp; <i>c</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
688
<p>This signal is emitted if the color of the current format has changed.</p>
 
689
<p>The new color is <i>c</i>.</p>
 
690
<p>See also <a href="q3textedit.html#setColor">setColor</a>().</p>
 
691
<h3 class="fn"><a name="currentFont"></a><a href="qfont.html">QFont</a> Q3TextEdit::currentFont () const</h3>
 
692
<p>Returns the font of the current format.</p>
 
693
<p>See also <a href="q3textedit.html#setCurrentFont">setCurrentFont</a>(), <a href="q3textedit.html#setFamily">setFamily</a>(), and <a href="q3textedit.html#setPointSize">setPointSize</a>().</p>
 
694
<h3 class="fn"><a name="currentFontChanged"></a>void Q3TextEdit::currentFontChanged ( const <a href="qfont.html">QFont</a> &amp; <i>f</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
695
<p>This signal is emitted if the font of the current format has changed.</p>
 
696
<p>The new font is <i>f</i>.</p>
 
697
<p>See also <a href="q3textedit.html#setCurrentFont">setCurrentFont</a>().</p>
 
698
<h3 class="fn"><a name="currentVerticalAlignmentChanged"></a>void Q3TextEdit::currentVerticalAlignmentChanged ( <a href="q3textedit.html#VerticalAlignment-enum">VerticalAlignment</a> <i>a</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
699
<p>This signal is emitted if the vertical alignment of the current format has changed.</p>
 
700
<p>The new vertical alignment is <i>a</i>.</p>
 
701
<p>See also <a href="q3textedit.html#setVerticalAlignment">setVerticalAlignment</a>().</p>
 
702
<h3 class="fn"><a name="cursorPositionChanged-2"></a>void Q3TextEdit::cursorPositionChanged ( int <i>para</i>, int <i>pos</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
703
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
704
<p>This signal is emitted if the position of the cursor has changed. <i>para</i> contains the paragraph index and <i>pos</i> contains the character position within the paragraph.</p>
 
705
<p>See also <a href="q3textedit.html#setCursorPosition">setCursorPosition</a>().</p>
 
706
<h3 class="fn"><a name="cut"></a>void Q3TextEdit::cut ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
707
<p>Copies the selected text (from selection 0) to the clipboard and deletes it from the text edit.</p>
 
708
<p>If there is no selected text (in selection 0) nothing happens.</p>
 
709
<p>See also <a href="q3textedit.html#copy">Q3TextEdit::copy</a>(), <a href="q3textedit.html#paste">paste</a>(), and <a href="q3textedit.html#pasteSubType">pasteSubType</a>().</p>
 
710
<h3 class="fn"><a name="del"></a>void Q3TextEdit::del ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
711
<p>If there is some selected text (in selection 0) it is deleted. If there is no selected text (in selection 0) the character to the right of the text cursor is deleted.</p>
 
712
<p>See also <a href="q3textedit.html#removeSelectedText">removeSelectedText</a>() and <a href="q3textedit.html#cut">cut</a>().</p>
 
713
<h3 class="fn"><a name="doKeyboardAction"></a>void Q3TextEdit::doKeyboardAction ( <a href="q3textedit.html#KeyboardAction-enum">KeyboardAction</a> <i>action</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
714
<p>Executes keyboard action <i>action</i>. This is normally called by a key event handler.</p>
 
715
<h3 class="fn"><a name="doubleClicked"></a>void Q3TextEdit::doubleClicked ( int <i>para</i>, int <i>pos</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
716
<p>This signal is emitted when the mouse is double-clicked on the paragraph <i>para</i> at character position <i>pos</i>.</p>
 
717
<p>See also <a href="q3textedit.html#clicked">clicked</a>().</p>
 
718
<h3 class="fn"><a name="ensureCursorVisible"></a>void Q3TextEdit::ensureCursorVisible ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
719
<p>Ensures that the cursor is visible by scrolling the text edit if necessary.</p>
 
720
<p>See also <a href="q3textedit.html#setCursorPosition">setCursorPosition</a>().</p>
 
721
<h3 class="fn"><a name="family"></a><a href="qstring.html">QString</a> Q3TextEdit::family () const</h3>
 
722
<p>Returns the font family of the current format.</p>
 
723
<p>See also <a href="q3textedit.html#setFamily">setFamily</a>(), <a href="q3textedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="q3textedit.html#setPointSize">setPointSize</a>().</p>
 
724
<h3 class="fn"><a name="find"></a>bool Q3TextEdit::find ( const <a href="qstring.html">QString</a> &amp; <i>expr</i>, bool <i>cs</i>, bool <i>wo</i>, bool <i>forward</i> = true, int * <i>para</i> = 0, int * <i>index</i> = 0 )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
725
<p>Finds the next occurrence of the string, <i>expr</i>. Returns true if <i>expr</i> was found; otherwise returns false.</p>
 
726
<p>If <i>para</i> and <i>index</i> are both 0 the search begins from the current cursor position. If <i>para</i> and <i>index</i> are both not 0, the search begins from the <tt>*</tt><i>index</i> character position in the <tt>*</tt><i>para</i> paragraph.</p>
 
727
<p>If <i>cs</i> is true the search is case sensitive, otherwise it is case insensitive. If <i>wo</i> is true the search looks for whole word matches only; otherwise it searches for any matching text. If <i>forward</i> is true (the default) the search works forward from the starting position to the end of the text, otherwise it works backwards to the beginning of the text.</p>
 
728
<p>If <i>expr</i> is found the function returns true. If <i>index</i> and <i>para</i> are not 0, the number of the paragraph in which the first character of the match was found is put into <tt>*</tt><i>para</i>, and the index position of that character within the paragraph is put into <tt>*</tt><i>index</i>.</p>
 
729
<p>If <i>expr</i> is not found the function returns false. If <i>index</i> and <i>para</i> are not 0 and <i>expr</i> is not found, <tt>*</tt><i>index</i> and <tt>*</tt><i>para</i> are undefined.</p>
 
730
<p>Please note that this function will make the next occurrence of the string (if found) the current selection, and will thus modify the cursor position.</p>
 
731
<h3 class="fn"><a name="focusNextPrevChild"></a>bool Q3TextEdit::focusNextPrevChild ( bool <i>n</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
732
<p>Reimplemented to allow tabbing through links. If <i>n</i> is true the tab moves the focus to the next child; if <i>n</i> is false the tab moves the focus to the previous child. Returns true if the focus was moved; otherwise returns false.</p>
 
733
<p>Reimplemented from <a href="qwidget.html#focusNextPrevChild">QWidget</a>.</p>
 
734
<h3 class="fn"><a name="font"></a><a href="qfont.html">QFont</a> Q3TextEdit::font () const</h3>
 
735
<p>Returns <a href="qwidget.html#font-prop">Q3ScrollView::font</a>()</p>
 
736
<p><b>Warning:</b> In previous versions this function returned the font of the current format. This lead to confusion. Please use <a href="q3textedit.html#currentFont">currentFont</a>() instead.</p>
 
737
<h3 class="fn"><a name="getCursorPosition"></a>void Q3TextEdit::getCursorPosition ( int * <i>para</i>, int * <i>index</i> ) const</h3>
 
738
<p>This function sets the <tt>*</tt><i>para</i> and <tt>*</tt><i>index</i> parameters to the current cursor position. <i>para</i> and <i>index</i> must not be 0.</p>
 
739
<p>See also <a href="q3textedit.html#setCursorPosition">setCursorPosition</a>().</p>
 
740
<h3 class="fn"><a name="getSelection"></a>void Q3TextEdit::getSelection ( int * <i>paraFrom</i>, int * <i>indexFrom</i>, int * <i>paraTo</i>, int * <i>indexTo</i>, int <i>selNum</i> = 0 ) const</h3>
 
741
<p>If there is a selection, <tt>*</tt><i>paraFrom</i> is set to the number of the paragraph in which the selection begins and <tt>*</tt><i>paraTo</i> is set to the number of the paragraph in which the selection ends. (They could be the same.) <tt>*</tt><i>indexFrom</i> is set to the index at which the selection begins within <tt>*</tt><i>paraFrom</i>, and <tt>*</tt><i>indexTo</i> is set to the index at which the selection ends within <tt>*</tt><i>paraTo</i>.</p>
 
742
<p>If there is no selection, <tt>*</tt><i>paraFrom</i>, <tt>*</tt><i>indexFrom</i>, <tt>*</tt><i>paraTo</i> and <tt>*</tt><i>indexTo</i> are all set to -1.</p>
 
743
<p>If <i>paraFrom</i>, <i>indexFrom</i>, <i>paraTo</i> or <i>indexTo</i> is 0 this function does nothing.</p>
 
744
<p>The <i>selNum</i> is the number of the selection (multiple selections are supported). It defaults to 0 (the default selection).</p>
 
745
<p>See also <a href="q3textedit.html#setSelection">setSelection</a>() and <a href="q3textedit.html#selectedText-prop">selectedText</a>.</p>
 
746
<h3 class="fn"><a name="heightForWidth"></a>int Q3TextEdit::heightForWidth ( int <i>w</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
747
<p>Returns how many pixels high the text edit needs to be to display all the text if the text edit is <i>w</i> pixels wide.</p>
 
748
<p>Reimplemented from <a href="qwidget.html#heightForWidth">QWidget</a>.</p>
 
749
<h3 class="fn"><a name="insert"></a>void Q3TextEdit::insert ( const <a href="qstring.html">QString</a> &amp; <i>text</i>, <a href="qtglobal.html#uint-typedef">uint</a> <i>insertionFlags</i> = CheckNewLines | RemoveSelected )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
750
<p>Inserts <i>text</i> at the current cursor position.</p>
 
751
<p>The <i>insertionFlags</i> define how the text is inserted. If <tt>RedoIndentation</tt> is set, the paragraph is re-indented. If <tt>CheckNewLines</tt> is set, newline characters in <i>text</i> result in hard line breaks (i.e. new paragraphs). If <tt>checkNewLine</tt> is not set, the behavior of the editor is undefined if the <i>text</i> contains newlines. (It is not possible to change <a href="q3textedit.html">Q3TextEdit</a>'s newline handling behavior, but you can use <a href="qstring.html#replace">QString::replace</a>() to preprocess text before inserting it.) If <tt>RemoveSelected</tt> is set, any selected text (in selection 0) is removed before the text is inserted.</p>
 
752
<p>The default flags are <tt>CheckNewLines</tt> | <tt>RemoveSelected</tt>.</p>
 
753
<p>If the widget is in <tt>Qt::LogText</tt> mode this function will do nothing.</p>
 
754
<p>See also <a href="q3textedit.html#paste">paste</a>() and <a href="q3textedit.html#pasteSubType">pasteSubType</a>().</p>
 
755
<h3 class="fn"><a name="insert-2"></a>void Q3TextEdit::insert ( const <a href="qstring.html">QString</a> &amp; <i>text</i>, bool <i>indent</i>, bool <i>checkNewLine</i> = true, bool <i>removeSelected</i> = true )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
756
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
757
<p>Inserts the given <i>text</i>. If <i>indent</i> is true the paragraph that contains the text is reindented; if <i>checkNewLine</i> is true the <i>text</i> is checked for newlines and relaid out. If <i>removeSelected</i> is true and there is a selection, the insertion replaces the selected text.</p>
 
758
<h3 class="fn"><a name="insertAt"></a>void Q3TextEdit::insertAt ( const <a href="qstring.html">QString</a> &amp; <i>text</i>, int <i>para</i>, int <i>index</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
759
<p>Inserts <i>text</i> in the paragraph <i>para</i> at position <i>index</i>.</p>
 
760
<h3 class="fn"><a name="insertParagraph"></a>void Q3TextEdit::insertParagraph ( const <a href="qstring.html">QString</a> &amp; <i>text</i>, int <i>para</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
761
<p>Inserts <i>text</i> as a new paragraph at position <i>para</i>. If <i>para</i> is -1, the text is appended. Use <a href="q3textedit.html#append">append</a>() if the append operation is performance critical.</p>
 
762
<h3 class="fn"><a name="isRedoAvailable"></a>bool Q3TextEdit::isRedoAvailable () const</h3>
 
763
<p>Returns true if redo is available; otherwise returns false.</p>
 
764
<h3 class="fn"><a name="isUndoAvailable"></a>bool Q3TextEdit::isUndoAvailable () const</h3>
 
765
<p>Returns true if undo is available; otherwise returns false.</p>
 
766
<h3 class="fn"><a name="italic"></a>bool Q3TextEdit::italic () const</h3>
 
767
<p>Returns true if the current format is italic; otherwise returns false.</p>
 
768
<p>See also <a href="q3textedit.html#setItalic">setItalic</a>().</p>
 
769
<h3 class="fn"><a name="keyPressEvent"></a>void Q3TextEdit::keyPressEvent ( <a href="qkeyevent.html">QKeyEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
770
<p>Processes the key event, <i>e</i>. By default key events are used to provide keyboard navigation and text editing.</p>
 
771
<p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget</a>.</p>
 
772
<h3 class="fn"><a name="lineOfChar"></a>int Q3TextEdit::lineOfChar ( int <i>para</i>, int <i>index</i> )</h3>
 
773
<p>Returns the line number of the line in paragraph <i>para</i> in which the character at position <i>index</i> appears. The <i>index</i> position is relative to the beginning of the paragraph. If there is no such paragraph or no such character at the <i>index</i> position (e.g. the index is out of range) -1 is returned.</p>
 
774
<h3 class="fn"><a name="lines"></a>int Q3TextEdit::lines () const</h3>
 
775
<p>Returns the number of lines in the text edit; this could be 0.</p>
 
776
<p><b>Warning:</b> This function may be slow. Lines change all the time during word wrapping, so this function has to iterate over all the paragraphs and get the number of lines from each one individually.</p>
 
777
<h3 class="fn"><a name="linesOfParagraph"></a>int Q3TextEdit::linesOfParagraph ( int <i>para</i> ) const</h3>
 
778
<p>Returns the number of lines in paragraph <i>para</i>, or -1 if there is no paragraph with index <i>para</i>.</p>
 
779
<h3 class="fn"><a name="mimeSourceFactory"></a><a href="q3mimesourcefactory.html">Q3MimeSourceFactory</a> * Q3TextEdit::mimeSourceFactory () const</h3>
 
780
<p>Returns the <a href="q3mimesourcefactory.html">Q3MimeSourceFactory</a> which is being used by this text edit.</p>
 
781
<p>See also <a href="q3textedit.html#setMimeSourceFactory">setMimeSourceFactory</a>().</p>
 
782
<h3 class="fn"><a name="modificationChanged"></a>void Q3TextEdit::modificationChanged ( bool <i>m</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
783
<p>This signal is emitted when the modification status of the document has changed. If <i>m</i> is true, the document was modified, otherwise the modification state has been reset to unmodified.</p>
 
784
<p>See also <a href="q3textedit.html#modified-prop">modified</a>.</p>
 
785
<h3 class="fn"><a name="moveCursor"></a>void Q3TextEdit::moveCursor ( <a href="q3textedit.html#CursorAction-enum">CursorAction</a> <i>action</i>, bool <i>select</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
786
<p>Moves the text cursor according to <i>action</i>. This is normally used by some key event handler. <i>select</i> specifies whether the text between the current cursor position and the new position should be selected.</p>
 
787
<h3 class="fn"><a name="paragraphAt"></a>int Q3TextEdit::paragraphAt ( const <a href="qpoint.html">QPoint</a> &amp; <i>pos</i> ) const</h3>
 
788
<p>Returns the paragraph which is at position <i>pos</i> (in contents coordinates).</p>
 
789
<h3 class="fn"><a name="paragraphBackgroundColor"></a><a href="qcolor.html">QColor</a> Q3TextEdit::paragraphBackgroundColor ( int <i>para</i> ) const</h3>
 
790
<p>Returns the background color of the paragraph <i>para</i> or an invalid color if <i>para</i> is out of range or the paragraph has no background set</p>
 
791
<h3 class="fn"><a name="paragraphLength"></a>int Q3TextEdit::paragraphLength ( int <i>para</i> ) const</h3>
 
792
<p>Returns the length of the paragraph <i>para</i> (i.e. the number of characters), or -1 if there is no paragraph with index <i>para</i>.</p>
 
793
<p>This function ignores newlines.</p>
 
794
<h3 class="fn"><a name="paragraphRect"></a><a href="qrect.html">QRect</a> Q3TextEdit::paragraphRect ( int <i>para</i> ) const</h3>
 
795
<p>Returns the rectangle of the paragraph <i>para</i> in contents coordinates, or an invalid rectangle if <i>para</i> is out of range.</p>
 
796
<h3 class="fn"><a name="paragraphs"></a>int Q3TextEdit::paragraphs () const</h3>
 
797
<p>Returns the number of paragraphs in the text; an empty textedit is always considered to have one paragraph, so 1 is returned in this case.</p>
 
798
<h3 class="fn"><a name="paste"></a>void Q3TextEdit::paste ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
799
<p>Pastes the text from the clipboard into the text edit at the current cursor position. Only plain text is pasted.</p>
 
800
<p>If there is no text in the clipboard nothing happens.</p>
 
801
<p>See also <a href="q3textedit.html#pasteSubType">pasteSubType</a>(), <a href="q3textedit.html#cut">cut</a>(), and <a href="q3textedit.html#copy">Q3TextEdit::copy</a>().</p>
 
802
<h3 class="fn"><a name="pasteSubType"></a>void Q3TextEdit::pasteSubType ( const <a href="qbytearray.html">QByteArray</a> &amp; <i>subtype</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
803
<p>Pastes the text with format <i>subtype</i> from the clipboard into the text edit at the current cursor position. The <i>subtype</i> can be &quot;plain&quot; or &quot;html&quot;.</p>
 
804
<p>If there is no text with format <i>subtype</i> in the clipboard nothing happens.</p>
 
805
<p>See also <a href="q3textedit.html#paste">paste</a>(), <a href="q3textedit.html#cut">cut</a>(), and <a href="q3textedit.html#copy">Q3TextEdit::copy</a>().</p>
 
806
<h3 class="fn"><a name="placeCursor"></a>void Q3TextEdit::placeCursor ( const <a href="qpoint.html">QPoint</a> &amp; <i>pos</i>, <a href="q3textcursor.html">Q3TextCursor</a> * <i>c</i> = 0 )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
807
<p>Places the cursor <i>c</i> at the character which is closest to position <i>pos</i> (in contents coordinates). If <i>c</i> is 0, the default text cursor is used.</p>
 
808
<p>See also <a href="q3textedit.html#setCursorPosition">setCursorPosition</a>().</p>
 
809
<h3 class="fn"><a name="pointSize"></a>int Q3TextEdit::pointSize () const</h3>
 
810
<p>Returns the point size of the font of the current format.</p>
 
811
<p>See also <a href="q3textedit.html#setFamily">setFamily</a>(), <a href="q3textedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="q3textedit.html#setPointSize">setPointSize</a>().</p>
 
812
<h3 class="fn"><a name="redo"></a>void Q3TextEdit::redo ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
813
<p>Redoes the last operation.</p>
 
814
<p>If there is no operation to redo, i.e. there is no redo step in the undo/redo history, nothing happens.</p>
 
815
<p>See also <a href="q3textedit.html#redoAvailable">redoAvailable</a>(), <a href="q3textedit.html#undo">undo</a>(), and <a href="q3textedit.html#undoDepth-prop">undoDepth</a>().</p>
 
816
<h3 class="fn"><a name="redoAvailable"></a>void Q3TextEdit::redoAvailable ( bool <i>yes</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
817
<p>This signal is emitted when the availability of redo changes. If <i>yes</i> is true, then <a href="q3textedit.html#redo">redo</a>() will work until redoAvailable(false) is next emitted.</p>
 
818
<p>See also <a href="q3textedit.html#redo">redo</a>() and <a href="q3textedit.html#undoDepth-prop">undoDepth</a>().</p>
 
819
<h3 class="fn"><a name="removeParagraph"></a>void Q3TextEdit::removeParagraph ( int <i>para</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
820
<p>Removes the paragraph <i>para</i>.</p>
 
821
<h3 class="fn"><a name="removeSelectedText"></a>void Q3TextEdit::removeSelectedText ( int <i>selNum</i> = 0 )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
822
<p>Deletes the text of selection <i>selNum</i> (by default, the default selection, 0). If there is no selected text nothing happens.</p>
 
823
<p>See also <a href="q3textedit.html#selectedText-prop">selectedText</a> and <a href="q3textedit.html#removeSelection">removeSelection</a>().</p>
 
824
<h3 class="fn"><a name="removeSelection"></a>void Q3TextEdit::removeSelection ( int <i>selNum</i> = 0 )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
825
<p>Removes the selection <i>selNum</i> (by default 0). This does not remove the selected text.</p>
 
826
<p>See also <a href="q3textedit.html#removeSelectedText">removeSelectedText</a>().</p>
 
827
<h3 class="fn"><a name="repaintChanged"></a>void Q3TextEdit::repaintChanged ()&nbsp;&nbsp;<tt> [protected]</tt></h3>
 
828
<p>Repaints any paragraphs that have changed.</p>
 
829
<p>Although used extensively internally you shouldn't need to call this yourself.</p>
 
830
<h3 class="fn"><a name="returnPressed"></a>void Q3TextEdit::returnPressed ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
831
<p>This signal is emitted if the user pressed the Return or the Enter key.</p>
 
832
<h3 class="fn"><a name="scrollToAnchor"></a>void Q3TextEdit::scrollToAnchor ( const <a href="qstring.html">QString</a> &amp; <i>name</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
833
<p>Scrolls the text edit to make the text at the anchor called <i>name</i> visible, if it can be found in the document. If the anchor isn't found no scrolling will occur. An anchor is defined using the HTML anchor tag, e.g. <tt>&lt;a name=&quot;target&quot;&gt;</tt>.</p>
 
834
<h3 class="fn"><a name="scrollToBottom"></a>void Q3TextEdit::scrollToBottom ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
835
<p>Scrolls to the bottom of the document and does formatting if required.</p>
 
836
<h3 class="fn"><a name="selectAll"></a>void Q3TextEdit::selectAll ( bool <i>select</i> = true )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
837
<p>If <i>select</i> is true (the default), all the text is selected as selection 0. If <i>select</i> is false any selected text is unselected, i.e. the default selection (selection 0) is cleared.</p>
 
838
<p>See also <a href="q3textedit.html#selectedText-prop">selectedText</a>.</p>
 
839
<h3 class="fn"><a name="selectionChanged"></a>void Q3TextEdit::selectionChanged ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
840
<p>This signal is emitted whenever the selection changes.</p>
 
841
<p>See also <a href="q3textedit.html#setSelection">setSelection</a>() and <a href="q3textedit.html#copyAvailable">copyAvailable</a>().</p>
 
842
<h3 class="fn"><a name="setAlignment"></a>void Q3TextEdit::setAlignment ( int <i>a</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
843
<p>Sets the alignment of the current paragraph to <i>a</i>. Valid alignments are <tt>Qt::AlignLeft</tt>, <tt>Qt::AlignRight</tt>, <tt>Qt::AlignJustify</tt> and <tt>Qt::AlignCenter</tt> (which centers horizontally).</p>
 
844
<h3 class="fn"><a name="setBold"></a>void Q3TextEdit::setBold ( bool <i>b</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
845
<p>If <i>b</i> is true sets the current format to bold; otherwise sets the current format to non-bold.</p>
 
846
<p>See also <a href="q3textedit.html#bold">bold</a>().</p>
 
847
<h3 class="fn"><a name="setColor"></a>void Q3TextEdit::setColor ( const <a href="qcolor.html">QColor</a> &amp; <i>c</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
848
<p>Sets the color of the current format, i.e. of the text, to <i>c</i>.</p>
 
849
<p>See also <a href="q3textedit.html#color">color</a>() and <a href="q3textedit.html#paper-prop">setPaper</a>().</p>
 
850
<h3 class="fn"><a name="setCurrentFont"></a>void Q3TextEdit::setCurrentFont ( const <a href="qfont.html">QFont</a> &amp; <i>f</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
851
<p>Sets the font of the current format to <i>f</i>.</p>
 
852
<p>If the widget is in <tt>Qt::LogText</tt> mode this function will do nothing. Use <a href="qwidget.html#font-prop">setFont</a>() instead.</p>
 
853
<p>See also <a href="q3textedit.html#currentFont">currentFont</a>(), <a href="q3textedit.html#setPointSize">setPointSize</a>(), and <a href="q3textedit.html#setFamily">setFamily</a>().</p>
 
854
<h3 class="fn"><a name="setCursorPosition"></a>void Q3TextEdit::setCursorPosition ( int <i>para</i>, int <i>index</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
855
<p>Sets the cursor to position <i>index</i> in paragraph <i>para</i>.</p>
 
856
<p>See also <a href="q3textedit.html#getCursorPosition">getCursorPosition</a>().</p>
 
857
<h3 class="fn"><a name="setFamily"></a>void Q3TextEdit::setFamily ( const <a href="qstring.html">QString</a> &amp; <i>fontFamily</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
858
<p>Sets the font family of the current format to <i>fontFamily</i>.</p>
 
859
<p>See also <a href="q3textedit.html#family">family</a>() and <a href="q3textedit.html#setCurrentFont">setCurrentFont</a>().</p>
 
860
<h3 class="fn"><a name="setItalic"></a>void Q3TextEdit::setItalic ( bool <i>b</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
861
<p>If <i>b</i> is true sets the current format to italic; otherwise sets the current format to non-italic.</p>
 
862
<p>See also <a href="q3textedit.html#italic">italic</a>().</p>
 
863
<h3 class="fn"><a name="setMimeSourceFactory"></a>void Q3TextEdit::setMimeSourceFactory ( <a href="q3mimesourcefactory.html">Q3MimeSourceFactory</a> * <i>factory</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
864
<p>Sets the text edit's mimesource factory to <i>factory</i>. See <a href="q3mimesourcefactory.html">Q3MimeSourceFactory</a> for further details.</p>
 
865
<p>See also <a href="q3textedit.html#mimeSourceFactory">mimeSourceFactory</a>().</p>
 
866
<h3 class="fn"><a name="setParagraphBackgroundColor"></a>void Q3TextEdit::setParagraphBackgroundColor ( int <i>para</i>, const <a href="qcolor.html">QColor</a> &amp; <i>bg</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
867
<p>Sets the background color of the paragraph <i>para</i> to <i>bg</i>.</p>
 
868
<h3 class="fn"><a name="setPointSize"></a>void Q3TextEdit::setPointSize ( int <i>s</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
869
<p>Sets the point size of the current format to <i>s</i>.</p>
 
870
<p>Note that if <i>s</i> is zero or negative, the behavior of this function is not defined.</p>
 
871
<p>See also <a href="q3textedit.html#pointSize">pointSize</a>(), <a href="q3textedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="q3textedit.html#setFamily">setFamily</a>().</p>
 
872
<h3 class="fn"><a name="setSelection"></a>void Q3TextEdit::setSelection ( int <i>paraFrom</i>, int <i>indexFrom</i>, int <i>paraTo</i>, int <i>indexTo</i>, int <i>selNum</i> = 0 )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
873
<p>Sets a selection which starts at position <i>indexFrom</i> in paragraph <i>paraFrom</i> and ends at position <i>indexTo</i> in paragraph <i>paraTo</i>.</p>
 
874
<p>Any existing selections which have a different id (<i>selNum</i>) are left alone, but if an existing selection has the same id as <i>selNum</i> it is removed and replaced by this selection.</p>
 
875
<p>Uses the selection settings of selection <i>selNum</i>. If <i>selNum</i> is 0, this is the default selection.</p>
 
876
<p>The cursor is moved to the end of the selection if <i>selNum</i> is 0, otherwise the cursor position remains unchanged.</p>
 
877
<p>See also <a href="q3textedit.html#getSelection">getSelection</a>() and <a href="q3textedit.html#selectedText-prop">selectedText</a>.</p>
 
878
<h3 class="fn"><a name="setSelectionAttributes"></a>void Q3TextEdit::setSelectionAttributes ( int <i>selNum</i>, const <a href="qcolor.html">QColor</a> &amp; <i>back</i>, bool <i>invertText</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
879
<p>Sets the background color of selection number <i>selNum</i> to <i>back</i> and specifies whether the text of this selection should be inverted with <i>invertText</i>.</p>
 
880
<p>This only works for <i>selNum</i> &gt; 0. The default selection (<i>selNum</i> == 0) gets its attributes from the text edit's <a href="qwidget.html#palette-prop">palette</a>().</p>
 
881
<h3 class="fn"><a name="setStyleSheet"></a>void Q3TextEdit::setStyleSheet ( <a href="q3stylesheet.html">Q3StyleSheet</a> * <i>styleSheet</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
882
<p>Sets the stylesheet to use with this text edit to <i>styleSheet</i>. Changes will only take effect for new text added with <a href="q3textedit.html#text-prop">setText</a>() or <a href="q3textedit.html#append">append</a>().</p>
 
883
<p>See also <a href="q3textedit.html#styleSheet">styleSheet</a>().</p>
 
884
<h3 class="fn"><a name="setUnderline"></a>void Q3TextEdit::setUnderline ( bool <i>b</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
885
<p>If <i>b</i> is true sets the current format to underline; otherwise sets the current format to non-underline.</p>
 
886
<p>See also <a href="q3textedit.html#underline">underline</a>().</p>
 
887
<h3 class="fn"><a name="setVerticalAlignment"></a>void Q3TextEdit::setVerticalAlignment ( <a href="q3textedit.html#VerticalAlignment-enum">VerticalAlignment</a> <i>a</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
888
<p>Sets the vertical alignment of the current format, i.e. of the text, to <i>a</i>.</p>
 
889
<p>See also <a href="q3textedit.html#color">color</a>() and <a href="q3textedit.html#paper-prop">setPaper</a>().</p>
 
890
<h3 class="fn"><a name="styleSheet"></a><a href="q3stylesheet.html">Q3StyleSheet</a> * Q3TextEdit::styleSheet () const</h3>
 
891
<p>Returns the <a href="q3stylesheet.html">Q3StyleSheet</a> which is being used by this text edit.</p>
 
892
<p>See also <a href="q3textedit.html#setStyleSheet">setStyleSheet</a>().</p>
 
893
<h3 class="fn"><a name="sync"></a>void Q3TextEdit::sync ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
894
<p><a href="q3textedit.html">Q3TextEdit</a> is optimized for large amounts text. One of its optimizations is to format only the visible text, formatting the rest on demand, e.g. as the user scrolls, so you don't usually need to call this function.</p>
 
895
<p>In some situations you may want to force the whole text to be formatted. For example, if after calling <a href="q3textedit.html#text-prop">setText</a>(), you wanted to know the height of the document (using <a href="q3scrollview.html#contentsHeight-prop">contentsHeight</a>()), you would call this function first.</p>
 
896
<h3 class="fn"><a name="syntaxHighlighter"></a><a href="q3syntaxhighlighter.html">Q3SyntaxHighlighter</a> * Q3TextEdit::syntaxHighlighter () const</h3>
 
897
<p>Returns the <a href="porting4.html#qsyntaxhighlighter">QSyntaxHighlighter</a> set on this <a href="q3textedit.html">Q3TextEdit</a>. 0 is returned if no syntax highlighter is set.</p>
 
898
<h3 class="fn"><a name="textChanged"></a>void Q3TextEdit::textChanged ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
899
<p>This signal is emitted whenever the text in the text edit changes.</p>
 
900
<p>See also <a href="q3textedit.html#text-prop">setText</a>() and <a href="q3textedit.html#append">append</a>().</p>
 
901
<h3 class="fn"><a name="textCursor"></a><a href="q3textcursor.html">Q3TextCursor</a> * Q3TextEdit::textCursor () const&nbsp;&nbsp;<tt> [protected]</tt></h3>
 
902
<p>Returns the text edit's text cursor.</p>
 
903
<p><b>Warning:</b> <a href="q3textcursor.html">Q3TextCursor</a> is not in the public API, but in special circumstances you might wish to use it.</p>
 
904
<h3 class="fn"><a name="underline"></a>bool Q3TextEdit::underline () const</h3>
 
905
<p>Returns true if the current format is underlined; otherwise returns false.</p>
 
906
<p>See also <a href="q3textedit.html#setUnderline">setUnderline</a>().</p>
 
907
<h3 class="fn"><a name="undo"></a>void Q3TextEdit::undo ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
908
<p>Undoes the last operation.</p>
 
909
<p>If there is no operation to undo, i.e. there is no undo step in the undo/redo history, nothing happens.</p>
 
910
<p>See also <a href="q3textedit.html#undoAvailable">undoAvailable</a>(), <a href="q3textedit.html#redo">redo</a>(), and <a href="q3textedit.html#undoDepth-prop">undoDepth</a>().</p>
 
911
<h3 class="fn"><a name="undoAvailable"></a>void Q3TextEdit::undoAvailable ( bool <i>yes</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
912
<p>This signal is emitted when the availability of undo changes. If <i>yes</i> is true, then <a href="q3textedit.html#undo">undo</a>() will work until undoAvailable(false) is next emitted.</p>
 
913
<p>See also <a href="q3textedit.html#undo">undo</a>() and <a href="q3textedit.html#undoDepth-prop">undoDepth</a>().</p>
 
914
<h3 class="fn"><a name="verticalAlignment"></a><a href="q3textedit.html#VerticalAlignment-enum">VerticalAlignment</a> Q3TextEdit::verticalAlignment () const</h3>
 
915
<p>Returns the vertical alignment of the current format.</p>
 
916
<p>See also <a href="q3textedit.html#setVerticalAlignment">setVerticalAlignment</a>().</p>
 
917
<h3 class="fn"><a name="zoomIn"></a>void Q3TextEdit::zoomIn ( int <i>range</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
918
<p>Zooms in on the text by by making the base font size <i>range</i> points larger and recalculating all font sizes to be the new size. This does not change the size of any images.</p>
 
919
<p>See also <a href="q3textedit.html#zoomOut">zoomOut</a>().</p>
 
920
<h3 class="fn"><a name="zoomIn-2"></a>void Q3TextEdit::zoomIn ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
921
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
922
<p>Zooms in on the text by by making the base font size one point larger and recalculating all font sizes to be the new size. This does not change the size of any images.</p>
 
923
<p>See also <a href="q3textedit.html#zoomOut">zoomOut</a>().</p>
 
924
<h3 class="fn"><a name="zoomOut"></a>void Q3TextEdit::zoomOut ( int <i>range</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
925
<p>Zooms out on the text by making the base font size <i>range</i> points smaller and recalculating all font sizes to be the new size. This does not change the size of any images.</p>
 
926
<p>See also <a href="q3textedit.html#zoomIn">zoomIn</a>().</p>
 
927
<h3 class="fn"><a name="zoomOut-2"></a>void Q3TextEdit::zoomOut ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
928
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
929
<p>Zooms out on the text by by making the base font size one point smaller and recalculating all font sizes to be the new size. This does not change the size of any images.</p>
 
930
<p>See also <a href="q3textedit.html#zoomIn">zoomIn</a>().</p>
 
931
<h3 class="fn"><a name="zoomTo"></a>void Q3TextEdit::zoomTo ( int <i>size</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
932
<p>Zooms the text by making the base font size <i>size</i> points and recalculating all font sizes to be the new size. This does not change the size of any images.</p>
 
933
<p /><address><hr /><div align="center">
 
934
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
935
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
936
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
937
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
938
</tr></table></div></address></body>
 
939
</html>