File: qtextedit.html

package info (click to toggle)
python-qt4 4.7.3-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,504 kB
  • ctags: 4,680
  • sloc: python: 28,738; cpp: 8,897; sh: 245; xml: 243; makefile: 150
file content (404 lines) | stat: -rw-r--r-- 74,474 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QTextEdit Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QTextEdit Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QTextEdit class provides a widget that is used to edit and display both plain and rich text. <a href="#details">More...</a></p>
<p>Inherits <a href="qabstractscrollarea.html">QAbstractScrollArea</a>.</p><p>Inherited by <a href="qtextbrowser.html">QTextBrowser</a>.</p><h3>Types</h3><ul><li><div class="fn" />class <b><a href="qtextedit-autoformatting.html">AutoFormatting</a></b></li><li><div class="fn" />enum <b><a href="qtextedit.html#AutoFormattingFlag-enum">AutoFormattingFlag</a></b> { AutoNone, AutoBulletList, AutoAll }</li><li><div class="fn" />class <b><a href="qtextedit-extraselection.html">ExtraSelection</a></b></li><li><div class="fn" />enum <b><a href="qtextedit.html#LineWrapMode-enum">LineWrapMode</a></b> { NoWrap, WidgetWidth, FixedPixelWidth, FixedColumnWidth }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtextedit.html#QTextEdit">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qtextedit.html#QTextEdit-2">__init__</a></b> (<i>self</i>, QString, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" />bool <b><a href="qtextedit.html#acceptRichText">acceptRichText</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.Alignment <b><a href="qtextedit.html#alignment">alignment</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qtextedit.html#anchorAt">anchorAt</a></b> (<i>self</i>, QPoint)</li><li><div class="fn" /><b><a href="qtextedit.html#append">append</a></b> (<i>self</i>, QString)</li><li><div class="fn" />AutoFormatting <b><a href="qtextedit.html#autoFormatting">autoFormatting</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextedit.html#canInsertFromMimeData">canInsertFromMimeData</a></b> (<i>self</i>, QMimeData)</li><li><div class="fn" />bool <b><a href="qtextedit.html#canPaste">canPaste</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#changeEvent">changeEvent</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" /><b><a href="qtextedit.html#clear">clear</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#contextMenuEvent">contextMenuEvent</a></b> (<i>self</i>, QContextMenuEvent)</li><li><div class="fn" /><b><a href="qtextedit.html#copy">copy</a></b> (<i>self</i>)</li><li><div class="fn" />QMimeData <b><a href="qtextedit.html#createMimeDataFromSelection">createMimeDataFromSelection</a></b> (<i>self</i>)</li><li><div class="fn" />QMenu <b><a href="qtextedit.html#createStandardContextMenu">createStandardContextMenu</a></b> (<i>self</i>)</li><li><div class="fn" />QMenu <b><a href="qtextedit.html#createStandardContextMenu-2">createStandardContextMenu</a></b> (<i>self</i>, QPoint)</li><li><div class="fn" />QTextCharFormat <b><a href="qtextedit.html#currentCharFormat">currentCharFormat</a></b> (<i>self</i>)</li><li><div class="fn" />QFont <b><a href="qtextedit.html#currentFont">currentFont</a></b> (<i>self</i>)</li><li><div class="fn" />QTextCursor <b><a href="qtextedit.html#cursorForPosition">cursorForPosition</a></b> (<i>self</i>, QPoint)</li><li><div class="fn" />QRect <b><a href="qtextedit.html#cursorRect">cursorRect</a></b> (<i>self</i>, QTextCursor)</li><li><div class="fn" />QRect <b><a href="qtextedit.html#cursorRect-2">cursorRect</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtextedit.html#cursorWidth">cursorWidth</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#cut">cut</a></b> (<i>self</i>)</li><li><div class="fn" />QTextDocument <b><a href="qtextedit.html#document">document</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qtextedit.html#documentTitle">documentTitle</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#dragEnterEvent">dragEnterEvent</a></b> (<i>self</i>, QDragEnterEvent)</li><li><div class="fn" /><b><a href="qtextedit.html#dragLeaveEvent">dragLeaveEvent</a></b> (<i>self</i>, QDragLeaveEvent)</li><li><div class="fn" /><b><a href="qtextedit.html#dragMoveEvent">dragMoveEvent</a></b> (<i>self</i>, QDragMoveEvent)</li><li><div class="fn" /><b><a href="qtextedit.html#dropEvent">dropEvent</a></b> (<i>self</i>, QDropEvent)</li><li><div class="fn" /><b><a href="qtextedit.html#ensureCursorVisible">ensureCursorVisible</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextedit.html#event">event</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" />list-of-QTextEdit.ExtraSelection <b><a href="qtextedit.html#extraSelections">extraSelections</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextedit.html#find">find</a></b> (<i>self</i>, QString, QTextDocument.FindFlags&#160;<i>options</i>&#160;=&#160;0)</li><li><div class="fn" /><b><a href="qtextedit.html#focusInEvent">focusInEvent</a></b> (<i>self</i>, QFocusEvent)</li><li><div class="fn" />bool <b><a href="qtextedit.html#focusNextPrevChild">focusNextPrevChild</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtextedit.html#focusOutEvent">focusOutEvent</a></b> (<i>self</i>, QFocusEvent)</li><li><div class="fn" />QString <b><a href="qtextedit.html#fontFamily">fontFamily</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextedit.html#fontItalic">fontItalic</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qtextedit.html#fontPointSize">fontPointSize</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextedit.html#fontUnderline">fontUnderline</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtextedit.html#fontWeight">fontWeight</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#inputMethodEvent">inputMethodEvent</a></b> (<i>self</i>, QInputMethodEvent)</li><li><div class="fn" />QVariant <b><a href="qtextedit.html#inputMethodQuery">inputMethodQuery</a></b> (<i>self</i>, Qt.InputMethodQuery)</li><li><div class="fn" /><b><a href="qtextedit.html#insertFromMimeData">insertFromMimeData</a></b> (<i>self</i>, QMimeData)</li><li><div class="fn" /><b><a href="qtextedit.html#insertHtml">insertHtml</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qtextedit.html#insertPlainText">insertPlainText</a></b> (<i>self</i>, QString)</li><li><div class="fn" />bool <b><a href="qtextedit.html#isReadOnly">isReadOnly</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextedit.html#isUndoRedoEnabled">isUndoRedoEnabled</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#keyPressEvent">keyPressEvent</a></b> (<i>self</i>, QKeyEvent)</li><li><div class="fn" /><b><a href="qtextedit.html#keyReleaseEvent">keyReleaseEvent</a></b> (<i>self</i>, QKeyEvent)</li><li><div class="fn" />int <b><a href="qtextedit.html#lineWrapColumnOrWidth">lineWrapColumnOrWidth</a></b> (<i>self</i>)</li><li><div class="fn" />LineWrapMode <b><a href="qtextedit.html#lineWrapMode">lineWrapMode</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qtextedit.html#loadResource">loadResource</a></b> (<i>self</i>, int, QUrl)</li><li><div class="fn" /><b><a href="qtextedit.html#mergeCurrentCharFormat">mergeCurrentCharFormat</a></b> (<i>self</i>, QTextCharFormat)</li><li><div class="fn" /><b><a href="qtextedit.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a></b> (<i>self</i>, QMouseEvent)</li><li><div class="fn" /><b><a href="qtextedit.html#mouseMoveEvent">mouseMoveEvent</a></b> (<i>self</i>, QMouseEvent)</li><li><div class="fn" /><b><a href="qtextedit.html#mousePressEvent">mousePressEvent</a></b> (<i>self</i>, QMouseEvent)</li><li><div class="fn" /><b><a href="qtextedit.html#mouseReleaseEvent">mouseReleaseEvent</a></b> (<i>self</i>, QMouseEvent)</li><li><div class="fn" /><b><a href="qtextedit.html#moveCursor">moveCursor</a></b> (<i>self</i>, QTextCursor.MoveOperation, QTextCursor.MoveMode&#160;<i>mode</i>&#160;=&#160;QTextCursor.MoveAnchor)</li><li><div class="fn" />bool <b><a href="qtextedit.html#overwriteMode">overwriteMode</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#paintEvent">paintEvent</a></b> (<i>self</i>, QPaintEvent)</li><li><div class="fn" /><b><a href="qtextedit.html#paste">paste</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#print">print</a></b> (<i>self</i>, QPrinter&#160;<i>printer</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#print">print_</a></b> (<i>self</i>, QPrinter)</li><li><div class="fn" /><b><a href="qtextedit.html#redo">redo</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#resizeEvent">resizeEvent</a></b> (<i>self</i>, QResizeEvent)</li><li><div class="fn" /><b><a href="qtextedit.html#scrollContentsBy">scrollContentsBy</a></b> (<i>self</i>, int, int)</li><li><div class="fn" /><b><a href="qtextedit.html#scrollToAnchor">scrollToAnchor</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qtextedit.html#selectAll">selectAll</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setAcceptRichText">setAcceptRichText</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtextedit.html#setAlignment">setAlignment</a></b> (<i>self</i>, Qt.Alignment)</li><li><div class="fn" /><b><a href="qtextedit.html#setAutoFormatting">setAutoFormatting</a></b> (<i>self</i>, AutoFormatting)</li><li><div class="fn" /><b><a href="qtextedit.html#setCurrentCharFormat">setCurrentCharFormat</a></b> (<i>self</i>, QTextCharFormat)</li><li><div class="fn" /><b><a href="qtextedit.html#setCurrentFont">setCurrentFont</a></b> (<i>self</i>, QFont)</li><li><div class="fn" /><b><a href="qtextedit.html#setCursorWidth">setCursorWidth</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtextedit.html#setDocument">setDocument</a></b> (<i>self</i>, QTextDocument)</li><li><div class="fn" /><b><a href="qtextedit.html#setDocumentTitle">setDocumentTitle</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qtextedit.html#setExtraSelections">setExtraSelections</a></b> (<i>self</i>, list-of-QTextEdit.ExtraSelection)</li><li><div class="fn" /><b><a href="qtextedit.html#setFontFamily">setFontFamily</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qtextedit.html#setFontItalic">setFontItalic</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtextedit.html#setFontPointSize">setFontPointSize</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qtextedit.html#setFontUnderline">setFontUnderline</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtextedit.html#setFontWeight">setFontWeight</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtextedit.html#setHtml">setHtml</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qtextedit.html#setLineWrapColumnOrWidth">setLineWrapColumnOrWidth</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtextedit.html#setLineWrapMode">setLineWrapMode</a></b> (<i>self</i>, LineWrapMode)</li><li><div class="fn" /><b><a href="qtextedit.html#setOverwriteMode">setOverwriteMode</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtextedit.html#setPlainText">setPlainText</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qtextedit.html#setReadOnly">setReadOnly</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtextedit.html#setTabChangesFocus">setTabChangesFocus</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtextedit.html#setTabStopWidth">setTabStopWidth</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtextedit.html#setText">setText</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qtextedit.html#setTextBackgroundColor">setTextBackgroundColor</a></b> (<i>self</i>, QColor)</li><li><div class="fn" /><b><a href="qtextedit.html#setTextColor">setTextColor</a></b> (<i>self</i>, QColor)</li><li><div class="fn" /><b><a href="qtextedit.html#setTextCursor">setTextCursor</a></b> (<i>self</i>, QTextCursor)</li><li><div class="fn" /><b><a href="qtextedit.html#setTextInteractionFlags">setTextInteractionFlags</a></b> (<i>self</i>, Qt.TextInteractionFlags)</li><li><div class="fn" /><b><a href="qtextedit.html#setUndoRedoEnabled">setUndoRedoEnabled</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtextedit.html#setWordWrapMode">setWordWrapMode</a></b> (<i>self</i>, QTextOption.WrapMode)</li><li><div class="fn" /><b><a href="qtextedit.html#showEvent">showEvent</a></b> (<i>self</i>, QShowEvent)</li><li><div class="fn" />bool <b><a href="qtextedit.html#tabChangesFocus">tabChangesFocus</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtextedit.html#tabStopWidth">tabStopWidth</a></b> (<i>self</i>)</li><li><div class="fn" />QColor <b><a href="qtextedit.html#textBackgroundColor">textBackgroundColor</a></b> (<i>self</i>)</li><li><div class="fn" />QColor <b><a href="qtextedit.html#textColor">textColor</a></b> (<i>self</i>)</li><li><div class="fn" />QTextCursor <b><a href="qtextedit.html#textCursor">textCursor</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.TextInteractionFlags <b><a href="qtextedit.html#textInteractionFlags">textInteractionFlags</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#timerEvent">timerEvent</a></b> (<i>self</i>, QTimerEvent)</li><li><div class="fn" />QString <b><a href="qtextedit.html#toHtml">toHtml</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qtextedit.html#toPlainText">toPlainText</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#undo">undo</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#wheelEvent">wheelEvent</a></b> (<i>self</i>, QWheelEvent)</li><li><div class="fn" />QTextOption.WrapMode <b><a href="qtextedit.html#wordWrapMode">wordWrapMode</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#zoomIn">zoomIn</a></b> (<i>self</i>, int&#160;<i>range</i>&#160;=&#160;1)</li><li><div class="fn" /><b><a href="qtextedit.html#zoomOut">zoomOut</a></b> (<i>self</i>, int&#160;<i>range</i>&#160;=&#160;1)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qtextedit.html#copyAvailable">copyAvailable</a></b> (bool)</li><li><div class="fn" />void <b><a href="qtextedit.html#currentCharFormatChanged">currentCharFormatChanged</a></b> (const QTextCharFormat&amp;)</li><li><div class="fn" />void <b><a href="qtextedit.html#cursorPositionChanged">cursorPositionChanged</a></b> ()</li><li><div class="fn" />void <b><a href="qtextedit.html#redoAvailable">redoAvailable</a></b> (bool)</li><li><div class="fn" />void <b><a href="qtextedit.html#selectionChanged">selectionChanged</a></b> ()</li><li><div class="fn" />void <b><a href="qtextedit.html#textChanged">textChanged</a></b> ()</li><li><div class="fn" />void <b><a href="qtextedit.html#undoAvailable">undoAvailable</a></b> (bool)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QTextEdit class provides a widget that is used to edit and display both plain and rich text.</p>
<ul><li><a href="#introduction-and-concepts">Introduction and Concepts</a></li>
<li><a href="#using-qtextedit-as-a-display-widget">Using QTextEdit as a Display Widget</a></li>
<ul><li><a href="#read-only-key-bindings">Read-only Key Bindings</a></li>
</ul>
<li><a href="#using-qtextedit-as-an-editor">Using QTextEdit as an Editor</a></li>
<ul><li><a href="#drag-and-drop">Drag and Drop</a></li>
<li><a href="#editing-key-bindings">Editing Key Bindings</a></li>
</ul>
</ul>
<a name="introduction-and-concepts" />
<h3>Introduction and Concepts</h3>
<p>QTextEdit is an advanced WYSIWYG viewer/editor supporting rich text formatting using HTML-style tags. It is optimized to handle large documents and to respond quickly to user input.</p>
<p>QTextEdit works on paragraphs and characters. A paragraph is a formatted string which is word-wrapped to fit into the width of the widget. By default when reading plain text, one newline signifies a paragraph. A document consists of zero or more paragraphs. The words in the paragraph are aligned in accordance with the paragraph's alignment. Paragraphs are separated by hard line breaks. Each character within a paragraph has its own attributes, for example, font and color.</p>
<p>QTextEdit can display images, lists and tables. If the text is too large to view within the text edit's viewport, scroll bars will appear. The text edit can load both plain text and HTML files (a subset of HTML 3.2 and 4).</p>
<p>If you just need to display a small piece of rich text use <a href="qlabel.html">QLabel</a>.</p>
<p>The rich text support in Qt is designed to provide a fast, portable and efficient way to add reasonable online help facilities to applications, and to provide a basis for rich text editors. If you find the HTML support insufficient for your needs you may consider the use of <a href="qtwebkit.html">QtWebKit</a>, which provides a full-featured web browser widget.</p>
<p>The shape of the mouse cursor on a QTextEdit is <a href="qt.html#CursorShape-enum">Qt.IBeamCursor</a> by default. It can be changed through the <a href="qabstractscrollarea.html#viewport">viewport</a>()'s cursor property.</p>
<a name="using-qtextedit-as-a-display-widget" />
<h3>Using QTextEdit as a Display Widget</h3>
<p>QTextEdit can display a large HTML subset, including tables and images.</p>
<p>The text is set or replaced using <a href="qtextedit.html#html-prop">setHtml</a>() which deletes any existing text and replaces it with the text passed in the <a href="qtextedit.html#html-prop">setHtml</a>() call. If you call <a href="qtextedit.html#html-prop">setHtml</a>() with legacy HTML, and then call <a href="qtextedit.html#html-prop">toHtml</a>(), the text that is returned may have different markup, but will render the same. The entire text can be deleted with <a href="qtextedit.html#clear">clear</a>().</p>
<p>Text itself can be inserted using the <a href="qtextcursor.html">QTextCursor</a> class or using the convenience functions <a href="qtextedit.html#insertHtml">insertHtml</a>(), <a href="qtextedit.html#insertPlainText">insertPlainText</a>(), <a href="qtextedit.html#append">append</a>() or <a href="qtextedit.html#paste">paste</a>(). <a href="qtextcursor.html">QTextCursor</a> is also able to insert complex objects like tables or lists into the document, and it deals with creating selections and applying changes to selected text.</p>
<p>By default the text edit wraps words at whitespace to fit within the text edit widget. The <a href="qtextedit.html#lineWrapMode-prop">setLineWrapMode</a>() function is used to specify the kind of line wrap you want, or <a href="qtextedit.html#LineWrapMode-enum">NoWrap</a> if you don't want any wrapping. Call <a href="qtextedit.html#lineWrapMode-prop">setLineWrapMode</a>() to set a fixed pixel width <a href="qtextedit.html#LineWrapMode-enum">FixedPixelWidth</a>, or character column (e.g. 80 column) <a href="qtextedit.html#LineWrapMode-enum">FixedColumnWidth</a> with the pixels or columns specified with <a href="qtextedit.html#lineWrapColumnOrWidth-prop">setLineWrapColumnOrWidth</a>(). If you use word wrap to the widget's width <a href="qtextedit.html#LineWrapMode-enum">WidgetWidth</a>, you can specify whether to break on whitespace or anywhere with <a href="qtextedit.html#wordWrapMode-prop">setWordWrapMode</a>().</p>
<p>The <a href="qtextedit.html#find">find</a>() function can be used to find and select a given string within the text.</p>
<p>If you want to limit the total number of paragraphs in a QTextEdit, as it is for example open useful in a log viewer, then you can use <a href="qtextdocument.html">QTextDocument</a>'s maximumBlockCount property for that.</p>
<a name="read-only-key-bindings" />
<h4>Read-only Key Bindings</h4>
<p>When QTextEdit is used read-only the key bindings are limited to navigation, and text may only be selected with the mouse:</p>
<p><table align="center" border="0" cellpadding="2" cellspacing="1" class="generic">
<thead><tr class="qt-style" valign="top"><th>Keypresses</th><th>Action</th></tr></thead>
<tr class="odd" valign="top"><td>Up</td><td>Moves one line up.</td></tr>
<tr class="even" valign="top"><td>Down</td><td>Moves one line down.</td></tr>
<tr class="odd" valign="top"><td>Left</td><td>Moves one character to the left.</td></tr>
<tr class="even" valign="top"><td>Right</td><td>Moves one character to the right.</td></tr>
<tr class="odd" valign="top"><td>PageUp</td><td>Moves one (viewport) page up.</td></tr>
<tr class="even" valign="top"><td>PageDown</td><td>Moves one (viewport) page down.</td></tr>
<tr class="odd" valign="top"><td>Home</td><td>Moves to the beginning of the text.</td></tr>
<tr class="even" valign="top"><td>End</td><td>Moves to the end of the text.</td></tr>
<tr class="odd" valign="top"><td>Alt+Wheel</td><td>Scrolls the page horizontally (the Wheel is the mouse wheel).</td></tr>
<tr class="even" valign="top"><td>Ctrl+Wheel</td><td>Zooms the text.</td></tr>
<tr class="odd" valign="top"><td>Ctrl+A</td><td>Selects all text.</td></tr>
</table></p>
<p>The text edit may be able to provide some meta-information. For example, the <a href="qtextedit.html#documentTitle-prop">documentTitle</a>() function will return the text from within HTML <tt>&lt;title&gt;</tt> tags.</p>
<a name="using-qtextedit-as-an-editor" />
<h3>Using QTextEdit as an Editor</h3>
<p>All the information about using QTextEdit as a display widget also applies here.</p>
<p>The current char format's attributes are set with <a href="qtextedit.html#setFontItalic">setFontItalic</a>(), <a href="qtextedit.html#setFontWeight">setFontWeight</a>(), <a href="qtextedit.html#setFontUnderline">setFontUnderline</a>(), <a href="qtextedit.html#setFontFamily">setFontFamily</a>(), <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>(), <a href="qtextedit.html#setTextColor">setTextColor</a>() and <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(). The current paragraph's alignment is set with <a href="qtextedit.html#setAlignment">setAlignment</a>().</p>
<p>Selection of text is handled by the <a href="qtextcursor.html">QTextCursor</a> class, which provides functionality for creating selections, retrieving the text contents or deleting selections. You can retrieve the object that corresponds with the user-visible cursor using the <a href="qtextedit.html#textCursor">textCursor</a>() method. If you want to set a selection in QTextEdit just create one on a <a href="qtextcursor.html">QTextCursor</a> object and then make that cursor the visible cursor using <a href="qtextedit.html#setTextCursor">setTextCursor</a>(). The selection can be copied to the clipboard with <a href="qtextedit.html#copy">copy</a>(), or cut to the clipboard with <a href="qtextedit.html#cut">cut</a>(). The entire text can be selected using <a href="qtextedit.html#selectAll">selectAll</a>().</p>
<p>When the cursor is moved and the underlying formatting attributes change, the <a href="qtextedit.html#currentCharFormatChanged">currentCharFormatChanged</a>() signal is emitted to reflect the new attributes at the new cursor position.</p>
<p>QTextEdit holds a <a href="qtextdocument.html">QTextDocument</a> object which can be retrieved using the <a href="qtextedit.html#document">document</a>() method. You can also set your own document object using <a href="qtextedit.html#setDocument">setDocument</a>(). <a href="qtextdocument.html">QTextDocument</a> emits a <a href="qtextedit.html#textChanged">textChanged</a>() signal if the text changes and it also provides a <a class="compat" href="qtextedit-qt3.html#isModified">isModified</a>() function which will return true if the text has been modified since it was either loaded or since the last call to setModified with false as argument. In addition it provides methods for undo and redo.</p>
<a name="drag-and-drop" />
<h4>Drag and Drop</h4>
<p>QTextEdit also supports custom drag and drop behavior. By default, QTextEdit will insert plain text, HTML and rich text when the user drops data of these MIME types onto a document. Reimplement <a href="qtextedit.html#canInsertFromMimeData">canInsertFromMimeData</a>() and <a href="qtextedit.html#insertFromMimeData">insertFromMimeData</a>() to add support for additional MIME types.</p>
<p>For example, to allow the user to drag and drop an image onto a QTextEdit, you could the implement these functions in the following way:</p>
<pre> bool TextEdit.canInsertFromMimeData( const QMimeData *source ) const
 {
     if (source-&gt;hasImage())
         return true;
     else
         return QTextEdit.canInsertFromMimeData(source);
 }</pre>
<p>We add support for image MIME types by returning true. For all other MIME types, we use the default implementation.</p>
<pre> void TextEdit.insertFromMimeData( const QMimeData *source )
 {
     if (source-&gt;hasImage())
     {
         QImage image = qvariant_cast&lt;QImage&gt;(source-&gt;imageData());
         QTextCursor cursor = this-&gt;textCursor();
         QTextDocument *document = this-&gt;document();
         document-&gt;addResource(QTextDocument.ImageResource, QUrl("image"), image);
         cursor.insertImage("image");
     }
 }</pre>
<p>We unpack the image from the <a href="qvariant.html">QVariant</a> held by the MIME source and insert it into the document as a resource.</p>
<a name="editing-key-bindings" />
<h4>Editing Key Bindings</h4>
<p>The list of key bindings which are implemented for editing:</p>
<p><table align="center" border="0" cellpadding="2" cellspacing="1" class="generic">
<thead><tr class="qt-style" valign="top"><th>Keypresses</th><th>Action</th></tr></thead>
<tr class="odd" valign="top"><td>Backspace</td><td>Deletes the character to the left of the cursor.</td></tr>
<tr class="even" valign="top"><td>Delete</td><td>Deletes the character to the right of the cursor.</td></tr>
<tr class="odd" valign="top"><td>Ctrl+C</td><td>Copy the selected text to the clipboard.</td></tr>
<tr class="even" valign="top"><td>Ctrl+Insert</td><td>Copy the selected text to the clipboard.</td></tr>
<tr class="odd" valign="top"><td>Ctrl+K</td><td>Deletes to the end of the line.</td></tr>
<tr class="even" valign="top"><td>Ctrl+V</td><td>Pastes the clipboard text into text edit.</td></tr>
<tr class="odd" valign="top"><td>Shift+Insert</td><td>Pastes the clipboard text into text edit.</td></tr>
<tr class="even" valign="top"><td>Ctrl+X</td><td>Deletes the selected text and copies it to the clipboard.</td></tr>
<tr class="odd" valign="top"><td>Shift+Delete</td><td>Deletes the selected text and copies it to the clipboard.</td></tr>
<tr class="even" valign="top"><td>Ctrl+Z</td><td>Undoes the last operation.</td></tr>
<tr class="odd" valign="top"><td>Ctrl+Y</td><td>Redoes the last operation.</td></tr>
<tr class="even" valign="top"><td>Left</td><td>Moves the cursor one character to the left.</td></tr>
<tr class="odd" valign="top"><td>Ctrl+Left</td><td>Moves the cursor one word to the left.</td></tr>
<tr class="even" valign="top"><td>Right</td><td>Moves the cursor one character to the right.</td></tr>
<tr class="odd" valign="top"><td>Ctrl+Right</td><td>Moves the cursor one word to the right.</td></tr>
<tr class="even" valign="top"><td>Up</td><td>Moves the cursor one line up.</td></tr>
<tr class="odd" valign="top"><td>Down</td><td>Moves the cursor one line down.</td></tr>
<tr class="even" valign="top"><td>PageUp</td><td>Moves the cursor one page up.</td></tr>
<tr class="odd" valign="top"><td>PageDown</td><td>Moves the cursor one page down.</td></tr>
<tr class="even" valign="top"><td>Home</td><td>Moves the cursor to the beginning of the line.</td></tr>
<tr class="odd" valign="top"><td>Ctrl+Home</td><td>Moves the cursor to the beginning of the text.</td></tr>
<tr class="even" valign="top"><td>End</td><td>Moves the cursor to the end of the line.</td></tr>
<tr class="odd" valign="top"><td>Ctrl+End</td><td>Moves the cursor to the end of the text.</td></tr>
<tr class="even" valign="top"><td>Alt+Wheel</td><td>Scrolls the page horizontally (the Wheel is the mouse wheel).</td></tr>
</table></p>
<p>To select (mark) text hold down the Shift key whilst pressing one of the movement keystrokes, for example, <i>Shift+Right</i> will select the character to the right, and <i>Shift+Ctrl+Right</i> will select the word to the right, etc.</p>
<p>See also <a href="qtextdocument.html">QTextDocument</a>, <a href="qtextcursor.html">QTextCursor</a>, <a href="mainwindows-application.html">Application Example</a>, <a href="richtext-syntaxhighlighter.html">Syntax Highlighter Example</a>, and <a href="richtext.html">Rich Text Processing</a>.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="AutoFormattingFlag-enum" />QTextEdit.AutoFormattingFlag</h3><p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QTextEdit.AutoNone</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Don't do any automatic formatting.</td></tr>
<tr><td valign="top"><tt>QTextEdit.AutoBulletList</tt></td><td align="center" valign="top"><tt>0x00000001</tt></td><td valign="top">Automatically create bullet lists (e.g. when the user enters an asterisk ('*') in the left most column, or presses Enter in an existing list item.</td></tr>
<tr><td valign="top"><tt>QTextEdit.AutoAll</tt></td><td align="center" valign="top"><tt>0xffffffff</tt></td><td valign="top">Apply all automatic formatting. Currently only automatic bullet lists are supported.</td></tr>
</table></p>
<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>
<a name="//apple_ref/cpp/tag/QTextEdit/LineWrapMode" />
<a name="//apple_ref/cpp/econst/QTextEdit/NoWrap" />
<a name="//apple_ref/cpp/econst/QTextEdit/WidgetWidth" />
<a name="//apple_ref/cpp/econst/QTextEdit/FixedPixelWidth" />
<a name="//apple_ref/cpp/econst/QTextEdit/FixedColumnWidth" />
<h3 class="fn"><a name="LineWrapMode-enum" />QTextEdit.LineWrapMode</h3><p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="40%">
<tr><th width="60%">Constant</th><th width="40%">Value</th></tr>
<tr><td valign="top"><tt>QTextEdit.NoWrap</tt></td><td align="center" valign="top"><tt>0</tt></td></tr>
<tr><td valign="top"><tt>QTextEdit.WidgetWidth</tt></td><td align="center" valign="top"><tt>1</tt></td></tr>
<tr><td valign="top"><tt>QTextEdit.FixedPixelWidth</tt></td><td align="center" valign="top"><tt>2</tt></td></tr>
<tr><td valign="top"><tt>QTextEdit.FixedColumnWidth</tt></td><td align="center" valign="top"><tt>3</tt></td></tr>
</table></p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QTextEdit" />QTextEdit.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs an empty <a href="qtextedit.html">QTextEdit</a> with parent <i>parent</i>.</p>
<h3 class="fn"><a name="QTextEdit-2" />QTextEdit.__init__ (<i>self</i>, QString, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a <a href="qtextedit.html">QTextEdit</a> with parent <i>parent</i>. The text edit will display the text <i>text</i>. The text is interpreted as html.</p>
<a name="//apple_ref/cpp/instm/QTextEdit/~QTextEdit" />
<h3 class="fn"><a name="acceptRichText" />bool QTextEdit.acceptRichText (<i>self</i>)</h3><h3 class="fn"><a name="alignment" /><a href="qt-alignment.html">Qt.Alignment</a> QTextEdit.alignment (<i>self</i>)</h3><p>Returns the alignment of the current paragraph.</p>
<p>See also <a href="qtextedit.html#setAlignment">setAlignment</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/anchorAt" />
<h3 class="fn"><a name="anchorAt" />QString QTextEdit.anchorAt (<i>self</i>, <a href="qpoint.html">QPoint</a>)</h3><p>Returns the reference of the anchor at position <i>pos</i>, or an empty string if no anchor exists at that point.</p>
<a name="//apple_ref/cpp/instm/QTextEdit/append" />
<h3 class="fn"><a name="append" />QTextEdit.append (<i>self</i>, QString)</h3><p>Appends a new paragraph with <i>text</i> to the end of the text edit.</p>
<p><b>Note:</b> The new paragraph appended will have the same character format and block format as the current paragraph, determined by the position of the cursor.</p>
<p>See also <a href="qtextedit.html#currentCharFormat">currentCharFormat</a>() and <a href="qtextcursor.html#blockFormat">QTextCursor.blockFormat</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/canInsertFromMimeData" />
<h3 class="fn"><a name="autoFormatting" /><a href="qtextedit-autoformatting.html">AutoFormatting</a> QTextEdit.autoFormatting (<i>self</i>)</h3><h3 class="fn"><a name="canInsertFromMimeData" />bool QTextEdit.canInsertFromMimeData (<i>self</i>, <a href="qmimedata.html">QMimeData</a>)</h3><p>This function returns true if the contents of the MIME data object, specified by <i>source</i>, can be decoded and inserted into the document. It is called for example when during a drag operation the mouse enters this widget and it is necessary to determine whether it is possible to accept the drag and drop operation.</p>
<p>Reimplement this function to enable drag and drop support for additional MIME types.</p>
<a name="//apple_ref/cpp/instm/QTextEdit/canPaste" />
<h3 class="fn"><a name="canPaste" />bool QTextEdit.canPaste (<i>self</i>)</h3><p>Returns whether text can be pasted from the clipboard into the textedit.</p>
<p>This function was introduced in Qt 4.2.</p>
<a name="//apple_ref/cpp/instm/QTextEdit/changeEvent" />
<h3 class="fn"><a name="changeEvent" />QTextEdit.changeEvent (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget.changeEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/clear" />
<h3 class="fn"><a name="clear" />QTextEdit.clear (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void clear()</tt>.</p><p>Deletes all the text in the text edit.</p>
<p>Note that the undo/redo history is cleared by this function.</p>
<p>See also <a href="qtextedit.html#cut">cut</a>(), <a href="qtextedit.html#plainText-prop">setPlainText</a>(), and <a href="qtextedit.html#html-prop">setHtml</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/contextMenuEvent" />
<h3 class="fn"><a name="contextMenuEvent" />QTextEdit.contextMenuEvent (<i>self</i>, <a href="qcontextmenuevent.html">QContextMenuEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#contextMenuEvent">QWidget.contextMenuEvent</a>().</p>
<p>Shows the standard context menu created with <a href="qtextedit.html#createStandardContextMenu">createStandardContextMenu</a>().</p>
<p>If you do not want the text edit to have a context menu, you can set its <a href="qwidget.html#contextMenuPolicy-prop">contextMenuPolicy</a> to <a href="qt.html#ContextMenuPolicy-enum">Qt.NoContextMenu</a>. If you want to customize the context menu, reimplement this function. If you want to extend the standard context menu, reimplement this function, call <a href="qtextedit.html#createStandardContextMenu">createStandardContextMenu</a>() and extend the menu returned.</p>
<p>Information about the event is passed in the <i>event</i> object.</p>
<pre> void MyTextEdit.contextMenuEvent(QContextMenuEvent *event)
 {
     QMenu *menu = createStandardContextMenu();
     menu-&gt;addAction(tr("My Menu Item"));
     <span class="comment">//...</span>
     menu-&gt;exec(event-&gt;globalPos());
     delete menu;
 }</pre>
<a name="//apple_ref/cpp/instm/QTextEdit/copy" />
<h3 class="fn"><a name="copy" />QTextEdit.copy (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void copy()</tt>.</p><p>Copies any selected text to the clipboard.</p>
<p>See also <a href="qtextedit.html#copyAvailable">copyAvailable</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/copyAvailable" />
<h3 class="fn"><a name="createMimeDataFromSelection" /><a href="qmimedata.html">QMimeData</a> QTextEdit.createMimeDataFromSelection (<i>self</i>)</h3><p>This function returns a new MIME data object to represent the contents of the text edit's current selection. It is called when the selection needs to be encapsulated into a new <a href="qmimedata.html">QMimeData</a> object; for example, when a drag and drop operation is started, or when data is copyied to the clipboard.</p>
<p>If you reimplement this function, note that the ownership of the returned <a href="qmimedata.html">QMimeData</a> object is passed to the caller. The selection can be retrieved by using the <a href="qtextedit.html#textCursor">textCursor</a>() function.</p>
<a name="//apple_ref/cpp/instm/QTextEdit/createStandardContextMenu" />
<h3 class="fn"><a name="createStandardContextMenu" /><a href="qmenu.html">QMenu</a> QTextEdit.createStandardContextMenu (<i>self</i>)</h3><p>This function creates the standard context menu which is shown when the user clicks on the text edit with the right mouse button. It is called from the default <a href="qtextedit.html#contextMenuEvent">contextMenuEvent</a>() handler. The popup menu's ownership is transferred to the caller.</p>
<p>We recommend that you use the createStandardContextMenu(<a href="qpoint.html">QPoint</a>) version instead which will enable the actions that are sensitive to where the user clicked.</p>
<h3 class="fn"><a name="createStandardContextMenu-2" /><a href="qmenu.html">QMenu</a> QTextEdit.createStandardContextMenu (<i>self</i>, <a href="qpoint.html">QPoint</a>)</h3><p>This function creates the standard context menu which is shown when the user clicks on the text edit with the right mouse button. It is called from the default <a href="qtextedit.html#contextMenuEvent">contextMenuEvent</a>() handler and it takes the <i>position</i> of where the mouse click was. This can enable actions that are sensitive to the position where the user clicked. The popup menu's ownership is transferred to the caller.</p>
<p>This function was introduced in Qt 4.4.</p>
<a name="//apple_ref/cpp/instm/QTextEdit/currentCharFormat" />
<h3 class="fn"><a name="currentCharFormat" /><a href="qtextcharformat.html">QTextCharFormat</a> QTextEdit.currentCharFormat (<i>self</i>)</h3><p>Returns the char format that is used when inserting new text.</p>
<p>See also <a href="qtextedit.html#setCurrentCharFormat">setCurrentCharFormat</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/currentCharFormatChanged" />
<h3 class="fn"><a name="currentFont" /><a href="qfont.html">QFont</a> QTextEdit.currentFont (<i>self</i>)</h3><p>Returns the font of the current format.</p>
<p>See also <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), <a href="qtextedit.html#setFontFamily">setFontFamily</a>(), and <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/cursorForPosition" />
<h3 class="fn"><a name="cursorForPosition" /><a href="qtextcursor.html">QTextCursor</a> QTextEdit.cursorForPosition (<i>self</i>, <a href="qpoint.html">QPoint</a>)</h3><p>returns a <a href="qtextcursor.html">QTextCursor</a> at position <i>pos</i> (in viewport coordinates).</p>
<a name="//apple_ref/cpp/instm/QTextEdit/cursorPositionChanged" />
<h3 class="fn"><a name="cursorRect" /><a href="qrect.html">QRect</a> QTextEdit.cursorRect (<i>self</i>, <a href="qtextcursor.html">QTextCursor</a>)</h3><p>returns a rectangle (in viewport coordinates) that includes the <i>cursor</i>.</p>
<h3 class="fn"><a name="cursorRect-2" /><a href="qrect.html">QRect</a> QTextEdit.cursorRect (<i>self</i>)</h3><p>returns a rectangle (in viewport coordinates) that includes the cursor of the text edit.</p>
<a name="//apple_ref/cpp/instm/QTextEdit/cut" />
<h3 class="fn"><a name="cursorWidth" />int QTextEdit.cursorWidth (<i>self</i>)</h3><h3 class="fn"><a name="cut" />QTextEdit.cut (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void cut()</tt>.</p><p>Copies the selected text to the clipboard and deletes it from the text edit.</p>
<p>If there is no selected text nothing happens.</p>
<p>See also <a href="qtextedit.html#copy">copy</a>() and <a href="qtextedit.html#paste">paste</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/document" />
<h3 class="fn"><a name="document" /><a href="qtextdocument.html">QTextDocument</a> QTextEdit.document (<i>self</i>)</h3><p>Returns a pointer to the underlying document.</p>
<p>See also <a href="qtextedit.html#setDocument">setDocument</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/dragEnterEvent" />
<h3 class="fn"><a name="documentTitle" />QString QTextEdit.documentTitle (<i>self</i>)</h3><h3 class="fn"><a name="dragEnterEvent" />QTextEdit.dragEnterEvent (<i>self</i>, <a href="qdragenterevent.html">QDragEnterEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#dragEnterEvent">QWidget.dragEnterEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/dragLeaveEvent" />
<h3 class="fn"><a name="dragLeaveEvent" />QTextEdit.dragLeaveEvent (<i>self</i>, <a href="qdragleaveevent.html">QDragLeaveEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#dragLeaveEvent">QWidget.dragLeaveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/dragMoveEvent" />
<h3 class="fn"><a name="dragMoveEvent" />QTextEdit.dragMoveEvent (<i>self</i>, <a href="qdragmoveevent.html">QDragMoveEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#dragMoveEvent">QWidget.dragMoveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/dropEvent" />
<h3 class="fn"><a name="dropEvent" />QTextEdit.dropEvent (<i>self</i>, <a href="qdropevent.html">QDropEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#dropEvent">QWidget.dropEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/ensureCursorVisible" />
<h3 class="fn"><a name="ensureCursorVisible" />QTextEdit.ensureCursorVisible (<i>self</i>)</h3><p>Ensures that the cursor is visible by scrolling the text edit if necessary.</p>
<a name="//apple_ref/cpp/instm/QTextEdit/extraSelections" />
<h3 class="fn"><a name="event" />bool QTextEdit.event (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><h3 class="fn"><a name="extraSelections" />list-of-QTextEdit.ExtraSelection QTextEdit.extraSelections (<i>self</i>)</h3><p>Returns previously set extra selections.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtextedit.html#setExtraSelections">setExtraSelections</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/find" />
<h3 class="fn"><a name="find" />bool QTextEdit.find (<i>self</i>, QString, <a href="qtextdocument-findflags.html">QTextDocument.FindFlags</a>&#160;<i>options</i>&#160;=&#160;0)</h3><p>Finds the next occurrence of the string, <i>exp</i>, using the given <i>options</i>. Returns true if <i>exp</i> was found and changes the cursor to select the match; otherwise returns false.</p>
<a name="//apple_ref/cpp/instm/QTextEdit/focusInEvent" />
<h3 class="fn"><a name="focusInEvent" />QTextEdit.focusInEvent (<i>self</i>, <a href="qfocusevent.html">QFocusEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#focusInEvent">QWidget.focusInEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/focusNextPrevChild" />
<h3 class="fn"><a name="focusNextPrevChild" />bool QTextEdit.focusNextPrevChild (<i>self</i>, bool)</h3><p>Reimplemented from <a href="qwidget.html#focusNextPrevChild">QWidget.focusNextPrevChild</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/focusOutEvent" />
<h3 class="fn"><a name="focusOutEvent" />QTextEdit.focusOutEvent (<i>self</i>, <a href="qfocusevent.html">QFocusEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#focusOutEvent">QWidget.focusOutEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/fontFamily" />
<h3 class="fn"><a name="fontFamily" />QString QTextEdit.fontFamily (<i>self</i>)</h3><p>Returns the font family of the current format.</p>
<p>See also <a href="qtextedit.html#setFontFamily">setFontFamily</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/fontItalic" />
<h3 class="fn"><a name="fontItalic" />bool QTextEdit.fontItalic (<i>self</i>)</h3><p>Returns true if the font of the current format is italic; otherwise returns false.</p>
<p>See also <a href="qtextedit.html#setFontItalic">setFontItalic</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/fontPointSize" />
<h3 class="fn"><a name="fontPointSize" />float QTextEdit.fontPointSize (<i>self</i>)</h3><p>Returns the point size of the font of the current format.</p>
<p>See also <a href="qtextedit.html#setFontFamily">setFontFamily</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/fontUnderline" />
<h3 class="fn"><a name="fontUnderline" />bool QTextEdit.fontUnderline (<i>self</i>)</h3><p>Returns true if the font of the current format is underlined; otherwise returns false.</p>
<p>See also <a href="qtextedit.html#setFontUnderline">setFontUnderline</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/fontWeight" />
<h3 class="fn"><a name="fontWeight" />int QTextEdit.fontWeight (<i>self</i>)</h3><p>Returns the font weight of the current format.</p>
<p>See also <a href="qtextedit.html#setFontWeight">setFontWeight</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>(), and <a href="qfont.html#Weight-enum">QFont.Weight</a>.</p>
<a name="//apple_ref/cpp/instm/QTextEdit/inputMethodEvent" />
<h3 class="fn"><a name="inputMethodEvent" />QTextEdit.inputMethodEvent (<i>self</i>, <a href="qinputmethodevent.html">QInputMethodEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#inputMethodEvent">QWidget.inputMethodEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/inputMethodQuery" />
<h3 class="fn"><a name="inputMethodQuery" />QVariant QTextEdit.inputMethodQuery (<i>self</i>, <a href="qt.html#InputMethodQuery-enum">Qt.InputMethodQuery</a>)</h3><p>Reimplemented from <a href="qwidget.html#inputMethodQuery">QWidget.inputMethodQuery</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/insertFromMimeData" />
<h3 class="fn"><a name="insertFromMimeData" />QTextEdit.insertFromMimeData (<i>self</i>, <a href="qmimedata.html">QMimeData</a>)</h3><p>This function inserts the contents of the MIME data object, specified by <i>source</i>, into the text edit at the current cursor position. It is called whenever text is inserted as the result of a clipboard paste operation, or when the text edit accepts data from a drag and drop operation.</p>
<p>Reimplement this function to enable drag and drop support for additional MIME types.</p>
<a name="//apple_ref/cpp/instm/QTextEdit/insertHtml" />
<h3 class="fn"><a name="insertHtml" />QTextEdit.insertHtml (<i>self</i>, QString)</h3><p>This method is also a Qt slot with the C++ signature <tt>void insertHtml(const QString&amp;)</tt>.</p><p>Convenience slot that inserts <i>text</i> which is assumed to be of html formatting at the current cursor position.</p>
<p>It is equivalent to:</p>
<pre> edit-&gt;textCursor().insertHtml(fragment);</pre>
<p><b>Note:</b> When using this function with a style sheet, the style sheet will only apply to the current block in the document. In order to apply a style sheet throughout a document, use <a href="qtextdocument.html#defaultStyleSheet-prop">QTextDocument.setDefaultStyleSheet</a>() instead.</p>
<a name="//apple_ref/cpp/instm/QTextEdit/insertPlainText" />
<h3 class="fn"><a name="insertPlainText" />QTextEdit.insertPlainText (<i>self</i>, QString)</h3><p>This method is also a Qt slot with the C++ signature <tt>void insertPlainText(const QString&amp;)</tt>.</p><p>Convenience slot that inserts <i>text</i> at the current cursor position.</p>
<p>It is equivalent to</p>
<pre> edit-&gt;textCursor().insertText(text);</pre>
<a name="//apple_ref/cpp/instm/QTextEdit/keyPressEvent" />
<h3 class="fn"><a name="isReadOnly" />bool QTextEdit.isReadOnly (<i>self</i>)</h3><h3 class="fn"><a name="isUndoRedoEnabled" />bool QTextEdit.isUndoRedoEnabled (<i>self</i>)</h3><h3 class="fn"><a name="keyPressEvent" />QTextEdit.keyPressEvent (<i>self</i>, <a href="qkeyevent.html">QKeyEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget.keyPressEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/keyReleaseEvent" />
<h3 class="fn"><a name="keyReleaseEvent" />QTextEdit.keyReleaseEvent (<i>self</i>, <a href="qkeyevent.html">QKeyEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#keyReleaseEvent">QWidget.keyReleaseEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/loadResource" />
<h3 class="fn"><a name="lineWrapColumnOrWidth" />int QTextEdit.lineWrapColumnOrWidth (<i>self</i>)</h3><h3 class="fn"><a name="lineWrapMode" /><a href="qtextedit.html#LineWrapMode-enum">LineWrapMode</a> QTextEdit.lineWrapMode (<i>self</i>)</h3><h3 class="fn"><a name="loadResource" />QVariant QTextEdit.loadResource (<i>self</i>, int, <a href="qurl.html">QUrl</a>)</h3><p>Loads the resource specified by the given <i>type</i> and <i>name</i>.</p>
<p>This function is an extension of <a href="qtextdocument.html#loadResource">QTextDocument.loadResource</a>().</p>
<p>See also <a href="qtextdocument.html#loadResource">QTextDocument.loadResource</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/mergeCurrentCharFormat" />
<h3 class="fn"><a name="mergeCurrentCharFormat" />QTextEdit.mergeCurrentCharFormat (<i>self</i>, <a href="qtextcharformat.html">QTextCharFormat</a>)</h3><p>Merges the properties specified in <i>modifier</i> into the current character format by calling QTextCursor.mergeCharFormat on the editor's cursor. If the editor has a selection then the properties of <i>modifier</i> are directly applied to the selection.</p>
<p>See also <a href="qtextcursor.html#mergeCharFormat">QTextCursor.mergeCharFormat</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/mouseDoubleClickEvent" />
<h3 class="fn"><a name="mouseDoubleClickEvent" />QTextEdit.mouseDoubleClickEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#mouseDoubleClickEvent">QWidget.mouseDoubleClickEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/mouseMoveEvent" />
<h3 class="fn"><a name="mouseMoveEvent" />QTextEdit.mouseMoveEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#mouseMoveEvent">QWidget.mouseMoveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/mousePressEvent" />
<h3 class="fn"><a name="mousePressEvent" />QTextEdit.mousePressEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget.mousePressEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/mouseReleaseEvent" />
<h3 class="fn"><a name="mouseReleaseEvent" />QTextEdit.mouseReleaseEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#mouseReleaseEvent">QWidget.mouseReleaseEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/moveCursor" />
<h3 class="fn"><a name="moveCursor" />QTextEdit.moveCursor (<i>self</i>, <a href="qtextcursor.html#MoveOperation-enum">QTextCursor.MoveOperation</a>, <a href="qtextcursor.html#MoveMode-enum">QTextCursor.MoveMode</a>&#160;<i>mode</i>&#160;=&#160;QTextCursor.MoveAnchor)</h3><p>Moves the cursor by performing the given <i>operation</i>.</p>
<p>If <i>mode</i> is <a href="qtextcursor.html#MoveMode-enum">QTextCursor.KeepAnchor</a>, the cursor selects the text it moves over. This is the same effect that the user achieves when they hold down the Shift key and move the cursor with the cursor keys.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtextcursor.html#movePosition">QTextCursor.movePosition</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/paintEvent" />
<h3 class="fn"><a name="overwriteMode" />bool QTextEdit.overwriteMode (<i>self</i>)</h3><h3 class="fn"><a name="paintEvent" />QTextEdit.paintEvent (<i>self</i>, <a href="qpaintevent.html">QPaintEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget.paintEvent</a>().</p>
<p>This event handler can be reimplemented in a subclass to receive paint events passed in <i>event</i>. It is usually unnecessary to reimplement this function in a subclass of <a href="qtextedit.html">QTextEdit</a>.</p>
<p><b>Warning:</b> The underlying text document must not be modified from within a reimplementation of this function.</p>
<a name="//apple_ref/cpp/instm/QTextEdit/paste" />
<h3 class="fn"><a name="paste" />QTextEdit.paste (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void paste()</tt>.</p><p>Pastes the text from the clipboard into the text edit at the current cursor position.</p>
<p>If there is no text in the clipboard nothing happens.</p>
<p>To change the behavior of this function, i.e. to modify what <a href="qtextedit.html">QTextEdit</a> can paste and how it is being pasted, reimplement the virtual <a href="qtextedit.html#canInsertFromMimeData">canInsertFromMimeData</a>() and <a href="qtextedit.html#insertFromMimeData">insertFromMimeData</a>() functions.</p>
<p>See also <a href="qtextedit.html#cut">cut</a>() and <a href="qtextedit.html#copy">copy</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/print" />
<h3 class="fn"><a name="print" />QTextEdit.print (<i>self</i>, <a href="qprinter.html">QPrinter</a>&#160;<i>printer</i>)</h3><p>Convenience function to print the text edit's document to the given <i>printer</i>. This is equivalent to calling the print method on the document directly except that this function also supports <a href="qprinter.html#PrintRange-enum">QPrinter.Selection</a> as print range.</p>
<p>This function was introduced in Qt 4.3.</p>
<p>See also <a href="qtextdocument.html#print">QTextDocument.print</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/redo" />
<h3 class="fn"><a name="print" />QTextEdit.print_ (<i>self</i>, <a href="qprinter.html">QPrinter</a>)</h3><p>Convenience function to print the text edit's document to the given <i>printer</i>. This is equivalent to calling the print method on the document directly except that this function also supports <a href="qprinter.html#PrintRange-enum">QPrinter.Selection</a> as print range.</p>
<p>This function was introduced in Qt 4.3.</p>
<p>See also <a href="qtextdocument.html#print">QTextDocument.print</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/redo" />
<h3 class="fn"><a name="redo" />QTextEdit.redo (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void redo()</tt>.</p><p>Redoes the last operation.</p>
<p>If there is no operation to redo, i.e. there is no redo step in the undo/redo history, nothing happens.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtextedit.html#undo">undo</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/redoAvailable" />
<h3 class="fn"><a name="resizeEvent" />QTextEdit.resizeEvent (<i>self</i>, <a href="qresizeevent.html">QResizeEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget.resizeEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/scrollContentsBy" />
<h3 class="fn"><a name="scrollContentsBy" />QTextEdit.scrollContentsBy (<i>self</i>, int, int)</h3><p>Reimplemented from <a href="qabstractscrollarea.html#scrollContentsBy">QAbstractScrollArea.scrollContentsBy</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/scrollToAnchor" />
<h3 class="fn"><a name="scrollToAnchor" />QTextEdit.scrollToAnchor (<i>self</i>, QString)</h3><p>This method is also a Qt slot with the C++ signature <tt>void scrollToAnchor(const QString&amp;)</tt>.</p><p>Scrolls the text edit so that the anchor with the given <i>name</i> is visible; does nothing if the <i>name</i> is empty, or is already visible, or isn't found.</p>
<a name="//apple_ref/cpp/instm/QTextEdit/selectAll" />
<h3 class="fn"><a name="selectAll" />QTextEdit.selectAll (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void selectAll()</tt>.</p><p>Selects all text.</p>
<p>See also <a href="qtextedit.html#copy">copy</a>(), <a href="qtextedit.html#cut">cut</a>(), and <a href="qtextedit.html#textCursor">textCursor</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/selectionChanged" />
<h3 class="fn"><a name="setAcceptRichText" />QTextEdit.setAcceptRichText (<i>self</i>, bool)</h3><h3 class="fn"><a name="setAlignment" />QTextEdit.setAlignment (<i>self</i>, <a href="qt-alignment.html">Qt.Alignment</a>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setAlignment(Qt::Alignment)</tt>.</p><p>Sets the alignment of the current paragraph to <i>a</i>. Valid alignments are <a href="qt.html#AlignmentFlag-enum">Qt.AlignLeft</a>, <a href="qt.html#AlignmentFlag-enum">Qt.AlignRight</a>, <a href="qt.html#AlignmentFlag-enum">Qt.AlignJustify</a> and <a href="qt.html#AlignmentFlag-enum">Qt.AlignCenter</a> (which centers horizontally).</p>
<p>See also <a href="qtextedit.html#alignment">alignment</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/setCurrentCharFormat" />
<h3 class="fn"><a name="setAutoFormatting" />QTextEdit.setAutoFormatting (<i>self</i>, <a href="qtextedit-autoformatting.html">AutoFormatting</a>)</h3><h3 class="fn"><a name="setCurrentCharFormat" />QTextEdit.setCurrentCharFormat (<i>self</i>, <a href="qtextcharformat.html">QTextCharFormat</a>)</h3><p>Sets the char format that is be used when inserting new text to <i>format</i> by calling <a href="qtextcursor.html#setCharFormat">QTextCursor.setCharFormat</a>() on the editor's cursor. If the editor has a selection then the char format is directly applied to the selection.</p>
<p>See also <a href="qtextedit.html#currentCharFormat">currentCharFormat</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/setCurrentFont" />
<h3 class="fn"><a name="setCurrentFont" />QTextEdit.setCurrentFont (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setCurrentFont(const QFont&amp;)</tt>.</p><p>Sets the font of the current format to <i>f</i>.</p>
<p>See also <a href="qtextedit.html#currentFont">currentFont</a>(), <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>(), and <a href="qtextedit.html#setFontFamily">setFontFamily</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/setDocument" />
<h3 class="fn"><a name="setCursorWidth" />QTextEdit.setCursorWidth (<i>self</i>, int)</h3><h3 class="fn"><a name="setDocument" />QTextEdit.setDocument (<i>self</i>, <a href="qtextdocument.html">QTextDocument</a>)</h3><p>Makes <i>document</i> the new document of the text editor.</p>
<p><b>Note:</b> The editor <i>does not take ownership of the document</i> unless it is the document's parent object. The parent object of the provided document remains the owner of the object.</p>
<p>If the current document is a child of the text editor, then it is deleted.</p>
<p>See also <a href="qtextedit.html#document">document</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/setExtraSelections" />
<h3 class="fn"><a name="setDocumentTitle" />QTextEdit.setDocumentTitle (<i>self</i>, QString)</h3><h3 class="fn"><a name="setExtraSelections" />QTextEdit.setExtraSelections (<i>self</i>, list-of-QTextEdit.ExtraSelection)</h3><p>This function allows temporarily marking certain regions in the document with a given color, specified as <i>selections</i>. This can be useful for example in a programming editor to mark a whole line of text with a given background color to indicate the existence of a breakpoint.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtextedit-extraselection.html">QTextEdit.ExtraSelection</a> and <a href="qtextedit.html#extraSelections">extraSelections</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/setFontFamily" />
<h3 class="fn"><a name="setFontFamily" />QTextEdit.setFontFamily (<i>self</i>, QString)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setFontFamily(const QString&amp;)</tt>.</p><p>Sets the font family of the current format to <i>fontFamily</i>.</p>
<p>See also <a href="qtextedit.html#fontFamily">fontFamily</a>() and <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/setFontItalic" />
<h3 class="fn"><a name="setFontItalic" />QTextEdit.setFontItalic (<i>self</i>, bool)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setFontItalic(bool)</tt>.</p><p>If <i>italic</i> is true, sets the current format to italic; otherwise sets the current format to non-italic.</p>
<p>See also <a href="qtextedit.html#fontItalic">fontItalic</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/setFontPointSize" />
<h3 class="fn"><a name="setFontPointSize" />QTextEdit.setFontPointSize (<i>self</i>, float)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setFontPointSize(qreal)</tt>.</p><p>Sets the point size of the current format to <i>s</i>.</p>
<p>Note that if <i>s</i> is zero or negative, the behavior of this function is not defined.</p>
<p>See also <a href="qtextedit.html#fontPointSize">fontPointSize</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="qtextedit.html#setFontFamily">setFontFamily</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/setFontUnderline" />
<h3 class="fn"><a name="setFontUnderline" />QTextEdit.setFontUnderline (<i>self</i>, bool)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setFontUnderline(bool)</tt>.</p><p>If <i>underline</i> is true, sets the current format to underline; otherwise sets the current format to non-underline.</p>
<p>See also <a href="qtextedit.html#fontUnderline">fontUnderline</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/setFontWeight" />
<h3 class="fn"><a name="setFontWeight" />QTextEdit.setFontWeight (<i>self</i>, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setFontWeight(int)</tt>.</p><p>Sets the font weight of the current format to the given <i>weight</i>, where the value used is in the range defined by the <a href="qfont.html#Weight-enum">QFont.Weight</a> enum.</p>
<p>See also <a href="qtextedit.html#fontWeight">fontWeight</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="qtextedit.html#setFontFamily">setFontFamily</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/setText" />
<h3 class="fn"><a name="setHtml" />QTextEdit.setHtml (<i>self</i>, QString)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setHtml(const QString&amp;)</tt>.</p><h3 class="fn"><a name="setLineWrapColumnOrWidth" />QTextEdit.setLineWrapColumnOrWidth (<i>self</i>, int)</h3><h3 class="fn"><a name="setLineWrapMode" />QTextEdit.setLineWrapMode (<i>self</i>, <a href="qtextedit.html#LineWrapMode-enum">LineWrapMode</a>)</h3><h3 class="fn"><a name="setOverwriteMode" />QTextEdit.setOverwriteMode (<i>self</i>, bool)</h3><h3 class="fn"><a name="setPlainText" />QTextEdit.setPlainText (<i>self</i>, QString)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setPlainText(const QString&amp;)</tt>.</p><h3 class="fn"><a name="setReadOnly" />QTextEdit.setReadOnly (<i>self</i>, bool)</h3><h3 class="fn"><a name="setTabChangesFocus" />QTextEdit.setTabChangesFocus (<i>self</i>, bool)</h3><h3 class="fn"><a name="setTabStopWidth" />QTextEdit.setTabStopWidth (<i>self</i>, int)</h3><h3 class="fn"><a name="setText" />QTextEdit.setText (<i>self</i>, QString)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setText(const QString&amp;)</tt>.</p><p>Sets the text edit's <i>text</i>. The text can be plain text or HTML and the text edit will try to guess the right format.</p>
<p>Use <a href="qtextedit.html#html-prop">setHtml</a>() or <a href="qtextedit.html#plainText-prop">setPlainText</a>() directly to avoid text edit's guessing.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a class="compat" href="qtextedit-qt3.html#text">text</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/setTextBackgroundColor" />
<h3 class="fn"><a name="setTextBackgroundColor" />QTextEdit.setTextBackgroundColor (<i>self</i>, <a href="qcolor.html">QColor</a>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setTextBackgroundColor(const QColor&amp;)</tt>.</p><p>Sets the text background color of the current format to <i>c</i>.</p>
<p>This function was introduced in Qt 4.4.</p>
<p>See also <a href="qtextedit.html#textBackgroundColor">textBackgroundColor</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/setTextColor" />
<h3 class="fn"><a name="setTextColor" />QTextEdit.setTextColor (<i>self</i>, <a href="qcolor.html">QColor</a>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setTextColor(const QColor&amp;)</tt>.</p><p>Sets the text color of the current format to <i>c</i>.</p>
<p>See also <a href="qtextedit.html#textColor">textColor</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/setTextCursor" />
<h3 class="fn"><a name="setTextCursor" />QTextEdit.setTextCursor (<i>self</i>, <a href="qtextcursor.html">QTextCursor</a>)</h3><p>Sets the visible <i>cursor</i>.</p>
<p>See also <a href="qtextedit.html#textCursor">textCursor</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/showEvent" />
<h3 class="fn"><a name="setTextInteractionFlags" />QTextEdit.setTextInteractionFlags (<i>self</i>, <a href="qt-textinteractionflags.html">Qt.TextInteractionFlags</a>)</h3><h3 class="fn"><a name="setUndoRedoEnabled" />QTextEdit.setUndoRedoEnabled (<i>self</i>, bool)</h3><h3 class="fn"><a name="setWordWrapMode" />QTextEdit.setWordWrapMode (<i>self</i>, <a href="qtextoption.html#WrapMode-enum">QTextOption.WrapMode</a>)</h3><h3 class="fn"><a name="showEvent" />QTextEdit.showEvent (<i>self</i>, <a href="qshowevent.html">QShowEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#showEvent">QWidget.showEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/textBackgroundColor" />
<h3 class="fn"><a name="tabChangesFocus" />bool QTextEdit.tabChangesFocus (<i>self</i>)</h3><h3 class="fn"><a name="tabStopWidth" />int QTextEdit.tabStopWidth (<i>self</i>)</h3><h3 class="fn"><a name="textBackgroundColor" /><a href="qcolor.html">QColor</a> QTextEdit.textBackgroundColor (<i>self</i>)</h3><p>Returns the text background color of the current format.</p>
<p>This function was introduced in Qt 4.4.</p>
<p>See also <a href="qtextedit.html#setTextBackgroundColor">setTextBackgroundColor</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/textChanged" />
<h3 class="fn"><a name="textColor" /><a href="qcolor.html">QColor</a> QTextEdit.textColor (<i>self</i>)</h3><p>Returns the text color of the current format.</p>
<p>See also <a href="qtextedit.html#setTextColor">setTextColor</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/textCursor" />
<h3 class="fn"><a name="textCursor" /><a href="qtextcursor.html">QTextCursor</a> QTextEdit.textCursor (<i>self</i>)</h3><p>Returns a copy of the <a href="qtextcursor.html">QTextCursor</a> that represents the currently visible cursor. Note that changes on the returned cursor do not affect <a href="qtextedit.html">QTextEdit</a>'s cursor; use <a href="qtextedit.html#setTextCursor">setTextCursor</a>() to update the visible cursor.</p>
<p>See also <a href="qtextedit.html#setTextCursor">setTextCursor</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/undo" />
<h3 class="fn"><a name="textInteractionFlags" /><a href="qt-textinteractionflags.html">Qt.TextInteractionFlags</a> QTextEdit.textInteractionFlags (<i>self</i>)</h3><h3 class="fn"><a name="timerEvent" />QTextEdit.timerEvent (<i>self</i>, <a href="qtimerevent.html">QTimerEvent</a>)</h3><h3 class="fn"><a name="toHtml" />QString QTextEdit.toHtml (<i>self</i>)</h3><h3 class="fn"><a name="toPlainText" />QString QTextEdit.toPlainText (<i>self</i>)</h3><h3 class="fn"><a name="undo" />QTextEdit.undo (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void undo()</tt>.</p><p>Undoes the last operation.</p>
<p>If there is no operation to undo, i.e. there is no undo step in the undo/redo history, nothing happens.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtextedit.html#redo">redo</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/undoAvailable" />
<h3 class="fn"><a name="wheelEvent" />QTextEdit.wheelEvent (<i>self</i>, <a href="qwheelevent.html">QWheelEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#wheelEvent">QWidget.wheelEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/zoomIn" />
<h3 class="fn"><a name="wordWrapMode" /><a href="qtextoption.html#WrapMode-enum">QTextOption.WrapMode</a> QTextEdit.wordWrapMode (<i>self</i>)</h3><h3 class="fn"><a name="zoomIn" />QTextEdit.zoomIn (<i>self</i>, int&#160;<i>range</i>&#160;=&#160;1)</h3><p>This method is also a Qt slot with the C++ signature <tt>void zoomIn(int = 1)</tt>.</p><p>Zooms in on the text by making the base font size <i>range</i> points larger and recalculating all font sizes to be the new size. This does not change the size of any images.</p>
<p>See also <a href="qtextedit.html#zoomOut">zoomOut</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/zoomOut" />
<h3 class="fn"><a name="zoomOut" />QTextEdit.zoomOut (<i>self</i>, int&#160;<i>range</i>&#160;=&#160;1)</h3><p>This method is also a Qt slot with the C++ signature <tt>void zoomOut(int = 1)</tt>.</p><p>This is an overloaded function.</p>
<p>Zooms out on the text by making the base font size <i>range</i> points smaller and recalculating all font sizes to be the new size. This does not change the size of any images.</p>
<p>See also <a href="qtextedit.html#zoomIn">zoomIn</a>().</p>
<p /><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="copyAvailable" />void copyAvailable (bool)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when text is selected or de-selected in the text edit.</p>
<p>When text is selected this signal will be emitted with <i>yes</i> set to true. If no text has been selected or if the selected text is de-selected this signal is emitted with <i>yes</i> set to false.</p>
<p>If <i>yes</i> is true then <a href="qtextedit.html#copy">copy</a>() can be used to copy the selection to the clipboard. If <i>yes</i> is false then <a href="qtextedit.html#copy">copy</a>() does nothing.</p>
<p>See also <a href="qtextedit.html#selectionChanged">selectionChanged</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/createMimeDataFromSelection" />
<h3 class="fn"><a name="currentCharFormatChanged" />void currentCharFormatChanged (const QTextCharFormat&amp;)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted if the current character format has changed, for example caused by a change of the cursor position.</p>
<p>The new format is <i>f</i>.</p>
<p>See also <a href="qtextedit.html#setCurrentCharFormat">setCurrentCharFormat</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/currentFont" />
<h3 class="fn"><a name="cursorPositionChanged" />void cursorPositionChanged ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the position of the cursor changed.</p>
<a name="//apple_ref/cpp/instm/QTextEdit/cursorRect" />
<h3 class="fn"><a name="redoAvailable" />void redoAvailable (bool)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever redo operations become available (<i>available</i> is true) or unavailable (<i>available</i> is false).</p>
<a name="//apple_ref/cpp/instm/QTextEdit/resizeEvent" />
<h3 class="fn"><a name="selectionChanged" />void selectionChanged ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the selection changes.</p>
<p>See also <a href="qtextedit.html#copyAvailable">copyAvailable</a>().</p>
<a name="//apple_ref/cpp/instm/QTextEdit/setAlignment" />
<h3 class="fn"><a name="textChanged" />void textChanged ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the document's content changes; for example, when text is inserted or deleted, or when formatting is applied.</p>
<a name="//apple_ref/cpp/instm/QTextEdit/textColor" />
<h3 class="fn"><a name="undoAvailable" />void undoAvailable (bool)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever undo operations become available (<i>available</i> is true) or unavailable (<i>available</i> is false).</p>
<a name="//apple_ref/cpp/instm/QTextEdit/wheelEvent" />
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.2</td></tr></table></div></address></body></html>