File: qtextedit.html

package info (click to toggle)
qt4-x11 4%3A4.8.2%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 701,696 kB
  • sloc: cpp: 2,686,179; ansic: 375,485; python: 25,859; sh: 19,349; xml: 17,091; perl: 14,765; yacc: 5,383; asm: 5,038; makefile: 1,259; lex: 555; ruby: 526; objc: 347; cs: 112; pascal: 112; php: 54; sed: 34
file content (1034 lines) | stat: -rw-r--r-- 114,633 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
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qtextedit.cpp -->
  <title>Qt 4.8: QTextEdit Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QTextEdit</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#introduction-and-concepts">Introduction and Concepts</a></li>
<li class="level2"><a href="#using-qtextedit-as-a-display-widget">Using QTextEdit as a Display Widget</a></li>
<li class="level3"><a href="#read-only-key-bindings">Read-only Key Bindings</a></li>
<li class="level2"><a href="#using-qtextedit-as-an-editor">Using QTextEdit as an Editor</a></li>
<li class="level3"><a href="#drag-and-drop">Drag and Drop</a></li>
<li class="level3"><a href="#editing-key-bindings">Editing Key Bindings</a></li>
</ul>
</div>
<h1 class="title">QTextEdit Class Reference</h1>
<!-- $$$QTextEdit-brief -->
<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>
<!-- @@@QTextEdit -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QTextEdit&gt;</span></pre><p><b>Inherits: </b><a href="qabstractscrollarea.html">QAbstractScrollArea</a>.</p>
<p><b>Inherited by: </b><a href="qtextbrowser.html">QTextBrowser</a>.</p>
<ul>
<li><a href="qtextedit-members.html">List of all members, including inherited members</a></li>
<li><a href="qtextedit-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> class </td><td class="memItemRight bottomAlign"><b><a href="qtextedit-extraselection.html">ExtraSelection</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#AutoFormattingFlag-enum">AutoFormatting</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#AutoFormattingFlag-enum">AutoFormattingFlag</a></b> { AutoNone, AutoBulletList, AutoAll }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#LineWrapMode-enum">LineWrapMode</a></b> { NoWrap, WidgetWidth, FixedPixelWidth, FixedColumnWidth }</td></tr>
</table>
<a name="properties"></a>
<h2>Properties</h2>
<table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qtextedit.html#acceptRichText-prop">acceptRichText</a></b> : bool</li>
<li class="fn"><b><a href="qtextedit.html#autoFormatting-prop">autoFormatting</a></b> : AutoFormatting</li>
<li class="fn"><b><a href="qtextedit.html#cursorWidth-prop">cursorWidth</a></b> : int</li>
<li class="fn"><b><a href="qtextedit.html#documentTitle-prop">documentTitle</a></b> : QString</li>
<li class="fn"><b><a href="qtextedit.html#html-prop">html</a></b> : QString</li>
<li class="fn"><b><a href="qtextedit.html#lineWrapColumnOrWidth-prop">lineWrapColumnOrWidth</a></b> : int</li>
<li class="fn"><b><a href="qtextedit.html#lineWrapMode-prop">lineWrapMode</a></b> : LineWrapMode</li>
<li class="fn"><b><a href="qtextedit.html#overwriteMode-prop">overwriteMode</a></b> : bool</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qtextedit.html#plainText-prop">plainText</a></b> : QString</li>
<li class="fn"><b><a href="qtextedit.html#readOnly-prop">readOnly</a></b> : bool</li>
<li class="fn"><b><a href="qtextedit.html#tabChangesFocus-prop">tabChangesFocus</a></b> : bool</li>
<li class="fn"><b><a href="qtextedit.html#tabStopWidth-prop">tabStopWidth</a></b> : int</li>
<li class="fn"><b><a href="qtextedit.html#textInteractionFlags-prop">textInteractionFlags</a></b> : Qt::TextInteractionFlags</li>
<li class="fn"><b><a href="qtextedit.html#undoRedoEnabled-prop">undoRedoEnabled</a></b> : bool</li>
<li class="fn"><b><a href="qtextedit.html#wordWrapMode-prop">wordWrapMode</a></b> : QTextOption::WrapMode</li>
</ul>
</td></tr>
</table>
<ul>
<li class="fn">2 properties inherited from <a href="qabstractscrollarea.html#properties">QAbstractScrollArea</a></li>
<li class="fn">6 properties inherited from <a href="qframe.html#properties">QFrame</a></li>
<li class="fn">58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#QTextEdit">QTextEdit</a></b> ( QWidget * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#QTextEdit-2">QTextEdit</a></b> ( const QString &amp; <i>text</i>, QWidget * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#dtor.QTextEdit">~QTextEdit</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#acceptRichText-prop">acceptRichText</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::Alignment </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#alignment">alignment</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#anchorAt">anchorAt</a></b> ( const QPoint &amp; <i>pos</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> AutoFormatting </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#autoFormatting-prop">autoFormatting</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#canPaste">canPaste</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMenu * </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#createStandardContextMenu">createStandardContextMenu</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMenu * </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#createStandardContextMenu-2">createStandardContextMenu</a></b> ( const QPoint &amp; <i>position</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextCharFormat </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#currentCharFormat">currentCharFormat</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#currentFont">currentFont</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextCursor </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#cursorForPosition">cursorForPosition</a></b> ( const QPoint &amp; <i>pos</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#cursorRect">cursorRect</a></b> ( const QTextCursor &amp; <i>cursor</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#cursorRect-2">cursorRect</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#cursorWidth-prop">cursorWidth</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextDocument * </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#document">document</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#documentTitle-prop">documentTitle</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#ensureCursorVisible">ensureCursorVisible</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;ExtraSelection&gt; </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#extraSelections">extraSelections</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#find">find</a></b> ( const QString &amp; <i>exp</i>, QTextDocument::FindFlags <i>options</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#fontFamily">fontFamily</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#fontItalic">fontItalic</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#fontPointSize">fontPointSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#fontUnderline">fontUnderline</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#fontWeight">fontWeight</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#readOnly-prop">isReadOnly</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#undoRedoEnabled-prop">isUndoRedoEnabled</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#lineWrapColumnOrWidth-prop">lineWrapColumnOrWidth</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> LineWrapMode </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#lineWrapMode-prop">lineWrapMode</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#loadResource">loadResource</a></b> ( int <i>type</i>, const QUrl &amp; <i>name</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#mergeCurrentCharFormat">mergeCurrentCharFormat</a></b> ( const QTextCharFormat &amp; <i>modifier</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#moveCursor">moveCursor</a></b> ( QTextCursor::MoveOperation <i>operation</i>, QTextCursor::MoveMode <i>mode</i> = QTextCursor::MoveAnchor )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#overwriteMode-prop">overwriteMode</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#print">print</a></b> ( QPrinter * <i>printer</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#acceptRichText-prop">setAcceptRichText</a></b> ( bool <i>accept</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#autoFormatting-prop">setAutoFormatting</a></b> ( AutoFormatting <i>features</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setCurrentCharFormat">setCurrentCharFormat</a></b> ( const QTextCharFormat &amp; <i>format</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#cursorWidth-prop">setCursorWidth</a></b> ( int <i>width</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setDocument">setDocument</a></b> ( QTextDocument * <i>document</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#documentTitle-prop">setDocumentTitle</a></b> ( const QString &amp; <i>title</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setExtraSelections">setExtraSelections</a></b> ( const QList&lt;ExtraSelection&gt; &amp; <i>selections</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#lineWrapColumnOrWidth-prop">setLineWrapColumnOrWidth</a></b> ( int <i>w</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#lineWrapMode-prop">setLineWrapMode</a></b> ( LineWrapMode <i>mode</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#overwriteMode-prop">setOverwriteMode</a></b> ( bool <i>overwrite</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#readOnly-prop">setReadOnly</a></b> ( bool <i>ro</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#tabChangesFocus-prop">setTabChangesFocus</a></b> ( bool <i>b</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#tabStopWidth-prop">setTabStopWidth</a></b> ( int <i>width</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setTextCursor">setTextCursor</a></b> ( const QTextCursor &amp; <i>cursor</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#textInteractionFlags-prop">setTextInteractionFlags</a></b> ( Qt::TextInteractionFlags <i>flags</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#undoRedoEnabled-prop">setUndoRedoEnabled</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#wordWrapMode-prop">setWordWrapMode</a></b> ( QTextOption::WrapMode <i>policy</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#tabChangesFocus-prop">tabChangesFocus</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#tabStopWidth-prop">tabStopWidth</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#textBackgroundColor">textBackgroundColor</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#textColor">textColor</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextCursor </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#textCursor">textCursor</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::TextInteractionFlags </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#textInteractionFlags-prop">textInteractionFlags</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#html-prop">toHtml</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#plainText-prop">toPlainText</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextOption::WrapMode </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#wordWrapMode-prop">wordWrapMode</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">17 public functions inherited from <a href="qabstractscrollarea.html#public-functions">QAbstractScrollArea</a></li>
<li class="fn">14 public functions inherited from <a href="qframe.html#public-functions">QFrame</a></li>
<li class="fn">221 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li class="fn">13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#append">append</a></b> ( const QString &amp; <i>text</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#copy">copy</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#cut">cut</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#insertHtml">insertHtml</a></b> ( const QString &amp; <i>text</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#insertPlainText">insertPlainText</a></b> ( const QString &amp; <i>text</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#paste">paste</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#redo">redo</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#scrollToAnchor">scrollToAnchor</a></b> ( const QString &amp; <i>name</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#selectAll">selectAll</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setAlignment">setAlignment</a></b> ( Qt::Alignment <i>a</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setCurrentFont">setCurrentFont</a></b> ( const QFont &amp; <i>f</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setFontFamily">setFontFamily</a></b> ( const QString &amp; <i>fontFamily</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setFontItalic">setFontItalic</a></b> ( bool <i>italic</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setFontPointSize">setFontPointSize</a></b> ( qreal <i>s</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setFontUnderline">setFontUnderline</a></b> ( bool <i>underline</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setFontWeight">setFontWeight</a></b> ( int <i>weight</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#html-prop">setHtml</a></b> ( const QString &amp; <i>text</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#plainText-prop">setPlainText</a></b> ( const QString &amp; <i>text</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setText">setText</a></b> ( const QString &amp; <i>text</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setTextBackgroundColor">setTextBackgroundColor</a></b> ( const QColor &amp; <i>c</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#setTextColor">setTextColor</a></b> ( const QColor &amp; <i>c</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#undo">undo</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#zoomIn">zoomIn</a></b> ( int <i>range</i> = 1 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#zoomOut">zoomOut</a></b> ( int <i>range</i> = 1 )</td></tr>
</table>
<ul>
<li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#copyAvailable">copyAvailable</a></b> ( bool <i>yes</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#currentCharFormatChanged">currentCharFormatChanged</a></b> ( const QTextCharFormat &amp; <i>f</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#cursorPositionChanged">cursorPositionChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#redoAvailable">redoAvailable</a></b> ( bool <i>available</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#selectionChanged">selectionChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#textChanged">textChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#undoAvailable">undoAvailable</a></b> ( bool <i>available</i> )</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#canInsertFromMimeData">canInsertFromMimeData</a></b> ( const QMimeData * <i>source</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QMimeData * </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#createMimeDataFromSelection">createMimeDataFromSelection</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#insertFromMimeData">insertFromMimeData</a></b> ( const QMimeData * <i>source</i> )</td></tr>
</table>
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#changeEvent">changeEvent</a></b> ( QEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#contextMenuEvent">contextMenuEvent</a></b> ( QContextMenuEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#dragEnterEvent">dragEnterEvent</a></b> ( QDragEnterEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#dragLeaveEvent">dragLeaveEvent</a></b> ( QDragLeaveEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#dragMoveEvent">dragMoveEvent</a></b> ( QDragMoveEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#dropEvent">dropEvent</a></b> ( QDropEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#focusInEvent">focusInEvent</a></b> ( QFocusEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#focusNextPrevChild">focusNextPrevChild</a></b> ( bool <i>next</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#focusOutEvent">focusOutEvent</a></b> ( QFocusEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#inputMethodEvent">inputMethodEvent</a></b> ( QInputMethodEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#inputMethodQuery">inputMethodQuery</a></b> ( Qt::InputMethodQuery <i>property</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#keyPressEvent">keyPressEvent</a></b> ( QKeyEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#keyReleaseEvent">keyReleaseEvent</a></b> ( QKeyEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#mouseMoveEvent">mouseMoveEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#mousePressEvent">mousePressEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#mouseReleaseEvent">mouseReleaseEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#paintEvent">paintEvent</a></b> ( QPaintEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#resizeEvent">resizeEvent</a></b> ( QResizeEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#scrollContentsBy">scrollContentsBy</a></b> ( int <i>dx</i>, int <i>dy</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#showEvent">showEvent</a></b> ( QShowEvent * )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextedit.html#wheelEvent">wheelEvent</a></b> ( QWheelEvent * <i>e</i> )</td></tr>
</table>
<ul>
<li class="fn">18 protected functions inherited from <a href="qabstractscrollarea.html#protected-functions">QAbstractScrollArea</a></li>
<li class="fn">3 protected functions inherited from <a href="qframe.html#protected-functions">QFrame</a></li>
<li class="fn">37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li class="fn">1 protected slot inherited from <a href="qabstractscrollarea.html#protected-slots">QAbstractScrollArea</a></li>
<li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<!-- $$$QTextEdit-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QTextEdit class provides a widget that is used to edit and display both plain and rich text.</p>
<a name="introduction-and-concepts"></a>
<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"></a>
<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&#x2e; 80 column) <a href="qtextedit.html#LineWrapMode-enum">FixedColumnWidth</a> with the pixels or columns specified with <a href="qtextedit.html#lineWrapColumnOrWidth-prop">setLineWrapColumnOrWidth</a>(). If you use word wrap to the widget's width <a href="qtextedit.html#LineWrapMode-enum">WidgetWidth</a>, you can specify whether to break on whitespace or anywhere with <a href="qtextedit.html#wordWrapMode-prop">setWordWrapMode</a>().</p>
<p>The <a href="qtextedit.html#find">find</a>() function can be used to find and select a given string within the text.</p>
<p>If you want to limit the total number of paragraphs in a QTextEdit, as for example it is often 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"></a>
<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>
<table class="generic">
<thead><tr class="qt-style"><th >Keypresses</th><th >Action</th></tr></thead>
<tr valign="top" class="odd"><td >Up</td><td >Moves one line up.</td></tr>
<tr valign="top" class="even"><td >Down</td><td >Moves one line down.</td></tr>
<tr valign="top" class="odd"><td >Left</td><td >Moves one character to the left.</td></tr>
<tr valign="top" class="even"><td >Right</td><td >Moves one character to the right.</td></tr>
<tr valign="top" class="odd"><td >PageUp</td><td >Moves one (viewport) page up.</td></tr>
<tr valign="top" class="even"><td >PageDown</td><td >Moves one (viewport) page down.</td></tr>
<tr valign="top" class="odd"><td >Home</td><td >Moves to the beginning of the text.</td></tr>
<tr valign="top" class="even"><td >End</td><td >Moves to the end of the text.</td></tr>
<tr valign="top" class="odd"><td >Alt+Wheel</td><td >Scrolls the page horizontally (the Wheel is the mouse wheel).</td></tr>
<tr valign="top" class="even"><td >Ctrl+Wheel</td><td >Zooms the text.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+A</td><td >Selects all text.</td></tr>
</table>
<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"></a>
<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 href="qtextedit-qt3.html#isModified" class="compat">isModified</a>() function which will return true if the text has been modified since it was either loaded or since the last call to setModified with false as argument. In addition it provides methods for undo and redo.</p>
<a name="drag-and-drop"></a>
<h4>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 class="cpp"> <span class="type">bool</span> TextEdit<span class="operator">::</span><a href="qtextedit.html#canInsertFromMimeData">canInsertFromMimeData</a>( <span class="keyword">const</span> <span class="type"><a href="qmimedata.html">QMimeData</a></span> <span class="operator">*</span>source ) <span class="keyword">const</span>
 {
     <span class="keyword">if</span> (source<span class="operator">-</span><span class="operator">&gt;</span>hasImage())
         <span class="keyword">return</span> <span class="keyword">true</span>;
     <span class="keyword">else</span>
         <span class="keyword">return</span> <span class="type">QTextEdit</span><span class="operator">::</span>canInsertFromMimeData(source);
 }</pre>
<p>We add support for image MIME types by returning true. For all other MIME types, we use the default implementation.</p>
<pre class="cpp"> <span class="type">void</span> TextEdit<span class="operator">::</span><a href="qtextedit.html#insertFromMimeData">insertFromMimeData</a>( <span class="keyword">const</span> <span class="type"><a href="qmimedata.html">QMimeData</a></span> <span class="operator">*</span>source )
 {
     <span class="keyword">if</span> (source<span class="operator">-</span><span class="operator">&gt;</span>hasImage())
     {
         <span class="type"><a href="qimage.html">QImage</a></span> image <span class="operator">=</span> qvariant_cast<span class="operator">&lt;</span><span class="type"><a href="qimage.html">QImage</a></span><span class="operator">&gt;</span>(source<span class="operator">-</span><span class="operator">&gt;</span>imageData());
         <span class="type"><a href="qtextcursor.html">QTextCursor</a></span> cursor <span class="operator">=</span> <span class="keyword">this</span><span class="operator">-</span><span class="operator">&gt;</span>textCursor();
         <span class="type"><a href="qtextdocument.html">QTextDocument</a></span> <span class="operator">*</span>document <span class="operator">=</span> <span class="keyword">this</span><span class="operator">-</span><span class="operator">&gt;</span>document();
         document<span class="operator">-</span><span class="operator">&gt;</span>addResource(<span class="type"><a href="qtextdocument.html">QTextDocument</a></span><span class="operator">::</span>ImageResource<span class="operator">,</span> <span class="type"><a href="qurl.html">QUrl</a></span>(<span class="string">&quot;image&quot;</span>)<span class="operator">,</span> image);
         cursor<span class="operator">.</span>insertImage(<span class="string">&quot;image&quot;</span>);
     }
 }</pre>
<p>We unpack the image from the <a href="qvariant.html">QVariant</a> held by the MIME source and insert it into the document as a resource.</p>
<a name="editing-key-bindings"></a>
<h4>Editing Key Bindings</h4>
<p>The list of key bindings which are implemented for editing:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Keypresses</th><th >Action</th></tr></thead>
<tr valign="top" class="odd"><td >Backspace</td><td >Deletes the character to the left of the cursor.</td></tr>
<tr valign="top" class="even"><td >Delete</td><td >Deletes the character to the right of the cursor.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+C</td><td >Copy the selected text to the clipboard.</td></tr>
<tr valign="top" class="even"><td >Ctrl+Insert</td><td >Copy the selected text to the clipboard.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+K</td><td >Deletes to the end of the line.</td></tr>
<tr valign="top" class="even"><td >Ctrl+V</td><td >Pastes the clipboard text into text edit.</td></tr>
<tr valign="top" class="odd"><td >Shift+Insert</td><td >Pastes the clipboard text into text edit.</td></tr>
<tr valign="top" class="even"><td >Ctrl+X</td><td >Deletes the selected text and copies it to the clipboard.</td></tr>
<tr valign="top" class="odd"><td >Shift+Delete</td><td >Deletes the selected text and copies it to the clipboard.</td></tr>
<tr valign="top" class="even"><td >Ctrl+Z</td><td >Undoes the last operation.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+Y</td><td >Redoes the last operation.</td></tr>
<tr valign="top" class="even"><td >Left</td><td >Moves the cursor one character to the left.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+Left</td><td >Moves the cursor one word to the left.</td></tr>
<tr valign="top" class="even"><td >Right</td><td >Moves the cursor one character to the right.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+Right</td><td >Moves the cursor one word to the right.</td></tr>
<tr valign="top" class="even"><td >Up</td><td >Moves the cursor one line up.</td></tr>
<tr valign="top" class="odd"><td >Down</td><td >Moves the cursor one line down.</td></tr>
<tr valign="top" class="even"><td >PageUp</td><td >Moves the cursor one page up.</td></tr>
<tr valign="top" class="odd"><td >PageDown</td><td >Moves the cursor one page down.</td></tr>
<tr valign="top" class="even"><td >Home</td><td >Moves the cursor to the beginning of the line.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+Home</td><td >Moves the cursor to the beginning of the text.</td></tr>
<tr valign="top" class="even"><td >End</td><td >Moves the cursor to the end of the line.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+End</td><td >Moves the cursor to the end of the text.</td></tr>
<tr valign="top" class="even"><td >Alt+Wheel</td><td >Scrolls the page horizontally (the Wheel is the mouse wheel).</td></tr>
</table>
<p>To select (mark) text hold down the Shift key whilst pressing one of the movement keystrokes, for example, <i>Shift+Right</i> will select the character to the right, and <i>Shift+Ctrl+Right</i> will select the word to the right, etc.</p>
</div>
<p><b>See also </b><a href="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>
<!-- @@@QTextEdit -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$AutoFormattingFlag$$$AutoNone$$$AutoBulletList$$$AutoAll -->
<h3 class="flags"><a name="AutoFormattingFlag-enum"></a>enum QTextEdit::<span class="name">AutoFormattingFlag</span><br/>flags QTextEdit::<span class="name">AutoFormatting</span></h3>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QTextEdit::AutoNone</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">Don't do any automatic formatting.</td></tr>
<tr><td class="topAlign"><tt>QTextEdit::AutoBulletList</tt></td><td class="topAlign"><tt>0x00000001</tt></td><td class="topAlign">Automatically create bullet lists (e.g&#x2e; when the user enters an asterisk ('*') in the left most column, or presses Enter in an existing list item.</td></tr>
<tr><td class="topAlign"><tt>QTextEdit::AutoAll</tt></td><td class="topAlign"><tt>0xffffffff</tt></td><td class="topAlign">Apply all automatic formatting. Currently only automatic bullet lists are supported.</td></tr>
</table>
<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>
<!-- @@@AutoFormattingFlag -->
<!-- $$$LineWrapMode$$$NoWrap$$$WidgetWidth$$$FixedPixelWidth$$$FixedColumnWidth -->
<h3 class="fn"><a name="LineWrapMode-enum"></a>enum QTextEdit::<span class="name">LineWrapMode</span></h3>
<table class="valuelist"><tr><th class="tblConst">Constant</th><th class="tblVal">Value</th></tr>
<tr><td class="topAlign"><tt>QTextEdit::NoWrap</tt></td><td class="topAlign"><tt>0</tt></td></tr>
<tr><td class="topAlign"><tt>QTextEdit::WidgetWidth</tt></td><td class="topAlign"><tt>1</tt></td></tr>
<tr><td class="topAlign"><tt>QTextEdit::FixedPixelWidth</tt></td><td class="topAlign"><tt>2</tt></td></tr>
<tr><td class="topAlign"><tt>QTextEdit::FixedColumnWidth</tt></td><td class="topAlign"><tt>3</tt></td></tr>
</table>
<!-- @@@LineWrapMode -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$acceptRichText-prop$$$acceptRichText$$$setAcceptRichTextbool -->
<h3 class="fn"><a name="acceptRichText-prop"></a><span class="name">acceptRichText</span> : <span class="type">bool</span></h3>
<p>This property holds whether the text edit accepts rich text insertions by the user.</p>
<p>When this propery is set to false text edit will accept only plain text input from the user. For example through clipboard or drag and drop.</p>
<p>This property's default is true.</p>
<p>This property was introduced in Qt 4.1.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>acceptRichText</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAcceptRichText</b></span> ( bool <i>accept</i> )</td></tr>
</table>
<!-- @@@acceptRichText -->
<!-- $$$autoFormatting-prop$$$autoFormatting$$$setAutoFormattingAutoFormatting -->
<h3 class="fn"><a name="autoFormatting-prop"></a><span class="name">autoFormatting</span> : <span class="type"><a href="qtextedit.html#AutoFormattingFlag-enum">AutoFormatting</a></span></h3>
<p>This property holds the enabled set of auto formatting features.</p>
<p>The value can be any combination of the values in the <a href="qtextedit.html#AutoFormattingFlag-enum">AutoFormattingFlag</a> enum. The default is <a href="qtextedit.html#AutoFormattingFlag-enum">AutoNone</a>. Choose <a href="qtextedit.html#AutoFormattingFlag-enum">AutoAll</a> to enable all automatic formatting.</p>
<p>Currently, the only automatic formatting feature provided is <a href="qtextedit.html#AutoFormattingFlag-enum">AutoBulletList</a>; future versions of Qt may offer more.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> AutoFormatting </td><td class="memItemRight bottomAlign"><span class="name"><b>autoFormatting</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAutoFormatting</b></span> ( AutoFormatting <i>features</i> )</td></tr>
</table>
<!-- @@@autoFormatting -->
<!-- $$$cursorWidth-prop$$$cursorWidth$$$setCursorWidthint -->
<h3 class="fn"><a name="cursorWidth-prop"></a><span class="name">cursorWidth</span> : <span class="type">int</span></h3>
<p>This property specifies the width of the cursor in pixels. The default value is 1.</p>
<p>This property was introduced in Qt 4.2.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>cursorWidth</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setCursorWidth</b></span> ( int <i>width</i> )</td></tr>
</table>
<!-- @@@cursorWidth -->
<!-- $$$documentTitle-prop$$$documentTitle$$$setDocumentTitleconstQString& -->
<h3 class="fn"><a name="documentTitle-prop"></a><span class="name">documentTitle</span> : <span class="type"><a href="qstring.html">QString</a></span></h3>
<p>This property holds the title of the document parsed from the text.</p>
<p>By default, for a newly-created, empty document, this property contains an empty string.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>documentTitle</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDocumentTitle</b></span> ( const QString &amp; <i>title</i> )</td></tr>
</table>
<!-- @@@documentTitle -->
<!-- $$$html-prop$$$toHtml$$$setHtmlconstQString&$$$textChanged -->
<h3 class="fn"><a name="html-prop"></a><span class="name">html</span> : <span class="type"><a href="qstring.html">QString</a></span></h3>
<p>This property provides an HTML interface to the text of the text edit.</p>
<p>toHtml() returns the text of the text edit as html.</p>
<p>setHtml() changes the text of the text edit. Any previous text is removed and the undo/redo history is cleared. The input text is interpreted as rich text in html format.</p>
<p><b>Note:</b> It is the responsibility of the caller to make sure that the text is correctly decoded when a <a href="qstring.html">QString</a> containing HTML is created and passed to setHtml().</p>
<p>By default, for a newly-created, empty document, this property contains text to describe an HTML 4.0 document with no body text.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>toHtml</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setHtml</b></span> ( const QString &amp; <i>text</i> )</td></tr>
</table>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qtextedit.html#textChanged">textChanged</a></b></span> ()</td></tr>
</table>
<p><b>See also </b><a href="richtext-html-subset.html">Supported HTML Subset</a> and <a href="qtextedit.html#plainText-prop">plainText</a>.</p>
<!-- @@@html -->
<!-- $$$lineWrapColumnOrWidth-prop$$$lineWrapColumnOrWidth$$$setLineWrapColumnOrWidthint -->
<h3 class="fn"><a name="lineWrapColumnOrWidth-prop"></a><span class="name">lineWrapColumnOrWidth</span> : <span class="type">int</span></h3>
<p>This property holds the position (in pixels or columns depending on the wrap mode) where text will be wrapped.</p>
<p>If the wrap mode is <a href="qtextedit.html#LineWrapMode-enum">FixedPixelWidth</a>, the value is the number of pixels from the left edge of the text edit at which text should be wrapped. If the wrap mode is <a href="qtextedit.html#LineWrapMode-enum">FixedColumnWidth</a>, the value is the column number (in character columns) from the left edge of the text edit at which text should be wrapped.</p>
<p>By default, this property contains a value of 0.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>lineWrapColumnOrWidth</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setLineWrapColumnOrWidth</b></span> ( int <i>w</i> )</td></tr>
</table>
<p><b>See also </b><a href="qtextedit.html#lineWrapMode-prop">lineWrapMode</a>.</p>
<!-- @@@lineWrapColumnOrWidth -->
<!-- $$$lineWrapMode-prop$$$lineWrapMode$$$setLineWrapModeLineWrapMode -->
<h3 class="fn"><a name="lineWrapMode-prop"></a><span class="name">lineWrapMode</span> : <span class="type"><a href="qtextedit.html#LineWrapMode-enum">LineWrapMode</a></span></h3>
<p>This property holds the line wrap mode.</p>
<p>The default mode is <a href="qtextedit.html#LineWrapMode-enum">WidgetWidth</a> which causes words to be wrapped at the right edge of the text edit. Wrapping occurs at whitespace, keeping whole words intact. If you want wrapping to occur within words use <a href="qtextedit.html#wordWrapMode-prop">setWordWrapMode</a>(). If you set a wrap mode of <a href="qtextedit.html#LineWrapMode-enum">FixedPixelWidth</a> or <a href="qtextedit.html#LineWrapMode-enum">FixedColumnWidth</a> you should also call <a href="qtextedit.html#lineWrapColumnOrWidth-prop">setLineWrapColumnOrWidth</a>() with the width you want.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> LineWrapMode </td><td class="memItemRight bottomAlign"><span class="name"><b>lineWrapMode</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setLineWrapMode</b></span> ( LineWrapMode <i>mode</i> )</td></tr>
</table>
<p><b>See also </b><a href="qtextedit.html#lineWrapColumnOrWidth-prop">lineWrapColumnOrWidth</a>.</p>
<!-- @@@lineWrapMode -->
<!-- $$$overwriteMode-prop$$$overwriteMode$$$setOverwriteModebool -->
<h3 class="fn"><a name="overwriteMode-prop"></a><span class="name">overwriteMode</span> : <span class="type">bool</span></h3>
<p>This property holds whether text entered by the user will overwrite existing text.</p>
<p>As with many text editors, the text editor widget can be configured to insert or overwrite existing text with new text entered by the user.</p>
<p>If this property is true, existing text is overwritten, character-for-character by new text; otherwise, text is inserted at the cursor position, displacing existing text.</p>
<p>By default, this property is false (new text does not overwrite existing text).</p>
<p>This property was introduced in Qt 4.1.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>overwriteMode</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setOverwriteMode</b></span> ( bool <i>overwrite</i> )</td></tr>
</table>
<!-- @@@overwriteMode -->
<!-- $$$plainText-prop$$$toPlainText$$$setPlainTextconstQString& -->
<h3 class="fn"><a name="plainText-prop"></a><span class="name">plainText</span> : <span class="type"><a href="qstring.html">QString</a></span></h3>
<p>This property gets and sets the text editor's contents as plain text. Previous contents are removed and undo/redo history is reset when the property is set.</p>
<p>If the text edit has another content type, it will not be replaced by plain text if you call toPlainText(). The only exception to this is the non-break space, <i>nbsp;</i>, that will be converted into standard space.</p>
<p>By default, for an editor with no contents, this property contains an empty string.</p>
<p>This property was introduced in Qt 4.3.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>toPlainText</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setPlainText</b></span> ( const QString &amp; <i>text</i> )</td></tr>
</table>
<p><b>See also </b><a href="qtextedit.html#html-prop">html</a>.</p>
<!-- @@@plainText -->
<!-- $$$readOnly-prop$$$isReadOnly$$$setReadOnlybool -->
<h3 class="fn"><a name="readOnly-prop"></a><span class="name">readOnly</span> : <span class="type">bool</span></h3>
<p>This property holds whether the text edit is read-only.</p>
<p>In a read-only text edit the user can only navigate through the text and select text; modifying the text is not possible.</p>
<p>This property's default is false.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isReadOnly</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setReadOnly</b></span> ( bool <i>ro</i> )</td></tr>
</table>
<!-- @@@readOnly -->
<!-- $$$tabChangesFocus-prop$$$tabChangesFocus$$$setTabChangesFocusbool -->
<h3 class="fn"><a name="tabChangesFocus-prop"></a><span class="name">tabChangesFocus</span> : <span class="type">bool</span></h3>
<p>This property holds whether Tab changes focus or is accepted as input.</p>
<p>In some occasions text edits should not allow the user to input tabulators or change indentation using the <b>Tab</b> key, as this breaks the focus chain. The default is false.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>tabChangesFocus</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setTabChangesFocus</b></span> ( bool <i>b</i> )</td></tr>
</table>
<!-- @@@tabChangesFocus -->
<!-- $$$tabStopWidth-prop$$$tabStopWidth$$$setTabStopWidthint -->
<h3 class="fn"><a name="tabStopWidth-prop"></a><span class="name">tabStopWidth</span> : <span class="type">int</span></h3>
<p>This property holds the tab stop width in pixels.</p>
<p>By default, this property contains a value of 80 pixels.</p>
<p>This property was introduced in Qt 4.1.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>tabStopWidth</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setTabStopWidth</b></span> ( int <i>width</i> )</td></tr>
</table>
<!-- @@@tabStopWidth -->
<!-- $$$textInteractionFlags-prop$$$textInteractionFlags$$$setTextInteractionFlagsQt::TextInteractionFlags -->
<h3 class="fn"><a name="textInteractionFlags-prop"></a><span class="name">textInteractionFlags</span> : <span class="type"><a href="qt.html#TextInteractionFlag-enum">Qt::TextInteractionFlags</a></span></h3>
<p>Specifies how the widget should interact with user input.</p>
<p>The default value depends on whether the <a href="qtextedit.html">QTextEdit</a> is read-only or editable, and whether it is a <a href="qtextbrowser.html">QTextBrowser</a> or not.</p>
<p>This property was introduced in Qt 4.2.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::TextInteractionFlags </td><td class="memItemRight bottomAlign"><span class="name"><b>textInteractionFlags</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setTextInteractionFlags</b></span> ( Qt::TextInteractionFlags <i>flags</i> )</td></tr>
</table>
<!-- @@@textInteractionFlags -->
<!-- $$$undoRedoEnabled-prop$$$isUndoRedoEnabled$$$setUndoRedoEnabledbool -->
<h3 class="fn"><a name="undoRedoEnabled-prop"></a><span class="name">undoRedoEnabled</span> : <span class="type">bool</span></h3>
<p>This property holds whether undo and redo are enabled.</p>
<p>Users are only able to undo or redo actions if this property is true, and if there is an action that can be undone (or redone).</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isUndoRedoEnabled</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setUndoRedoEnabled</b></span> ( bool <i>enable</i> )</td></tr>
</table>
<!-- @@@undoRedoEnabled -->
<!-- $$$wordWrapMode-prop$$$wordWrapMode$$$setWordWrapModeQTextOption::WrapMode -->
<h3 class="fn"><a name="wordWrapMode-prop"></a><span class="name">wordWrapMode</span> : <span class="type"><a href="qtextoption.html#WrapMode-enum">QTextOption::WrapMode</a></span></h3>
<p>This property holds the mode QTextEdit will use when wrapping text by words.</p>
<p>By default, this property is set to <a href="qtextoption.html#WrapMode-enum">QTextOption::WrapAtWordBoundaryOrAnywhere</a>.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QTextOption::WrapMode </td><td class="memItemRight bottomAlign"><span class="name"><b>wordWrapMode</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setWordWrapMode</b></span> ( QTextOption::WrapMode <i>policy</i> )</td></tr>
</table>
<p><b>See also </b><a href="qtextoption.html#WrapMode-enum">QTextOption::WrapMode</a>.</p>
<!-- @@@wordWrapMode -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QTextEdit[overload1]$$$QTextEditQWidget* -->
<h3 class="fn"><a name="QTextEdit"></a>QTextEdit::<span class="name">QTextEdit</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs an empty <a href="qtextedit.html">QTextEdit</a> with parent <i>parent</i>.</p>
<!-- @@@QTextEdit -->
<!-- $$$QTextEdit$$$QTextEditconstQString&QWidget* -->
<h3 class="fn"><a name="QTextEdit-2"></a>QTextEdit::<span class="name">QTextEdit</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i>, <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a <a href="qtextedit.html">QTextEdit</a> with parent <i>parent</i>. The text edit will display the text <i>text</i>. The text is interpreted as html.</p>
<!-- @@@QTextEdit -->
<!-- $$$~QTextEdit[overload1]$$$~QTextEdit -->
<h3 class="fn"><a name="dtor.QTextEdit"></a>QTextEdit::<span class="name">~QTextEdit</span> ()<tt> [virtual]</tt></h3>
<p>Destructor.</p>
<!-- @@@~QTextEdit -->
<!-- $$$alignment[overload1]$$$alignment -->
<h3 class="fn"><a name="alignment"></a><span class="type"><a href="qt.html#AlignmentFlag-enum">Qt::Alignment</a></span> QTextEdit::<span class="name">alignment</span> () const</h3>
<p>Returns the alignment of the current paragraph.</p>
<p><b>See also </b><a href="qtextedit.html#setAlignment">setAlignment</a>().</p>
<!-- @@@alignment -->
<!-- $$$anchorAt[overload1]$$$anchorAtconstQPoint& -->
<h3 class="fn"><a name="anchorAt"></a><span class="type"><a href="qstring.html">QString</a></span> QTextEdit::<span class="name">anchorAt</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>pos</i> ) const</h3>
<p>Returns the reference of the anchor at position <i>pos</i>, or an empty string if no anchor exists at that point.</p>
<!-- @@@anchorAt -->
<!-- $$$append[overload1]$$$appendconstQString& -->
<h3 class="fn"><a name="append"></a><span class="type">void</span> QTextEdit::<span class="name">append</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )<tt> [slot]</tt></h3>
<p>Appends a new paragraph with <i>text</i> to the end of the text edit.</p>
<p><b>Note:</b> The new paragraph appended will have the same character format and block format as the current paragraph, determined by the position of the cursor.</p>
<p><b>See also </b><a href="qtextedit.html#currentCharFormat">currentCharFormat</a>() and <a href="qtextcursor.html#blockFormat">QTextCursor::blockFormat</a>().</p>
<!-- @@@append -->
<!-- $$$canInsertFromMimeData[overload1]$$$canInsertFromMimeDataconstQMimeData* -->
<h3 class="fn"><a name="canInsertFromMimeData"></a><span class="type">bool</span> QTextEdit::<span class="name">canInsertFromMimeData</span> ( const <span class="type"><a href="qmimedata.html">QMimeData</a></span> * <i>source</i> ) const<tt> [virtual protected]</tt></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>
<!-- @@@canInsertFromMimeData -->
<!-- $$$canPaste[overload1]$$$canPaste -->
<h3 class="fn"><a name="canPaste"></a><span class="type">bool</span> QTextEdit::<span class="name">canPaste</span> () const</h3>
<p>Returns whether text can be pasted from the clipboard into the textedit.</p>
<p>This function was introduced in Qt 4.2.</p>
<!-- @@@canPaste -->
<!-- $$$changeEvent[overload1]$$$changeEventQEvent* -->
<h3 class="fn"><a name="changeEvent"></a><span class="type">void</span> QTextEdit::<span class="name">changeEvent</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget::changeEvent</a>().</p>
<!-- @@@changeEvent -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn"><a name="clear"></a><span class="type">void</span> QTextEdit::<span class="name">clear</span> ()<tt> [slot]</tt></h3>
<p>Deletes all the text in the text edit.</p>
<p>Note that the undo/redo history is cleared by this function.</p>
<p><b>See also </b><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>
<!-- @@@clear -->
<!-- $$$contextMenuEvent[overload1]$$$contextMenuEventQContextMenuEvent* -->
<h3 class="fn"><a name="contextMenuEvent"></a><span class="type">void</span> QTextEdit::<span class="name">contextMenuEvent</span> ( <span class="type"><a href="qcontextmenuevent.html">QContextMenuEvent</a></span> * <i>event</i> )<tt> [virtual protected]</tt></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 class="cpp"> <span class="type">void</span> MyTextEdit<span class="operator">::</span>contextMenuEvent(<span class="type"><a href="qcontextmenuevent.html">QContextMenuEvent</a></span> <span class="operator">*</span>event)
 {
     <span class="type"><a href="qmenu.html">QMenu</a></span> <span class="operator">*</span>menu <span class="operator">=</span> createStandardContextMenu();
     menu<span class="operator">-</span><span class="operator">&gt;</span>addAction(tr(<span class="string">&quot;My Menu Item&quot;</span>));
     <span class="comment">//...</span>
     menu<span class="operator">-</span><span class="operator">&gt;</span>exec(event<span class="operator">-</span><span class="operator">&gt;</span>globalPos());
     <span class="keyword">delete</span> menu;
 }</pre>
<!-- @@@contextMenuEvent -->
<!-- $$$copy[overload1]$$$copy -->
<h3 class="fn"><a name="copy"></a><span class="type">void</span> QTextEdit::<span class="name">copy</span> ()<tt> [slot]</tt></h3>
<p>Copies any selected text to the clipboard.</p>
<p><b>See also </b><a href="qtextedit.html#copyAvailable">copyAvailable</a>().</p>
<!-- @@@copy -->
<!-- $$$copyAvailable[overload1]$$$copyAvailablebool -->
<h3 class="fn"><a name="copyAvailable"></a><span class="type">void</span> QTextEdit::<span class="name">copyAvailable</span> ( <span class="type">bool</span> <i>yes</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when text is selected or de-selected in the text edit.</p>
<p>When text is selected this signal will be emitted with <i>yes</i> set to true. If no text has been selected or if the selected text is de-selected this signal is emitted with <i>yes</i> set to false.</p>
<p>If <i>yes</i> is true then <a href="qtextedit.html#copy">copy</a>() can be used to copy the selection to the clipboard. If <i>yes</i> is false then <a href="qtextedit.html#copy">copy</a>() does nothing.</p>
<p><b>See also </b><a href="qtextedit.html#selectionChanged">selectionChanged</a>().</p>
<!-- @@@copyAvailable -->
<!-- $$$createMimeDataFromSelection[overload1]$$$createMimeDataFromSelection -->
<h3 class="fn"><a name="createMimeDataFromSelection"></a><span class="type"><a href="qmimedata.html">QMimeData</a></span> * QTextEdit::<span class="name">createMimeDataFromSelection</span> () const<tt> [virtual protected]</tt></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>
<!-- @@@createMimeDataFromSelection -->
<!-- $$$createStandardContextMenu[overload1]$$$createStandardContextMenu -->
<h3 class="fn"><a name="createStandardContextMenu"></a><span class="type"><a href="qmenu.html">QMenu</a></span> * QTextEdit::<span class="name">createStandardContextMenu</span> ()</h3>
<p>This function creates the standard context menu which is shown when the user clicks on the text edit with the right mouse button. It is called from the default <a href="qtextedit.html#contextMenuEvent">contextMenuEvent</a>() handler. The popup menu's ownership is transferred to the caller.</p>
<p>We recommend that you use the createStandardContextMenu(<a href="qpoint.html">QPoint</a>) version instead which will enable the actions that are sensitive to where the user clicked.</p>
<!-- @@@createStandardContextMenu -->
<!-- $$$createStandardContextMenu$$$createStandardContextMenuconstQPoint& -->
<h3 class="fn"><a name="createStandardContextMenu-2"></a><span class="type"><a href="qmenu.html">QMenu</a></span> * QTextEdit::<span class="name">createStandardContextMenu</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>position</i> )</h3>
<p>This function creates the standard context menu which is shown when the user clicks on the text edit with the right mouse button. It is called from the default <a href="qtextedit.html#contextMenuEvent">contextMenuEvent</a>() handler and it takes the <i>position</i> 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>
<!-- @@@createStandardContextMenu -->
<!-- $$$currentCharFormat[overload1]$$$currentCharFormat -->
<h3 class="fn"><a name="currentCharFormat"></a><span class="type"><a href="qtextcharformat.html">QTextCharFormat</a></span> QTextEdit::<span class="name">currentCharFormat</span> () const</h3>
<p>Returns the char format that is used when inserting new text.</p>
<p><b>See also </b><a href="qtextedit.html#setCurrentCharFormat">setCurrentCharFormat</a>().</p>
<!-- @@@currentCharFormat -->
<!-- $$$currentCharFormatChanged[overload1]$$$currentCharFormatChangedconstQTextCharFormat& -->
<h3 class="fn"><a name="currentCharFormatChanged"></a><span class="type">void</span> QTextEdit::<span class="name">currentCharFormatChanged</span> ( const <span class="type"><a href="qtextcharformat.html">QTextCharFormat</a></span> &amp; <i>f</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted if the current character format has changed, for example caused by a change of the cursor position.</p>
<p>The new format is <i>f</i>.</p>
<p><b>See also </b><a href="qtextedit.html#setCurrentCharFormat">setCurrentCharFormat</a>().</p>
<!-- @@@currentCharFormatChanged -->
<!-- $$$currentFont[overload1]$$$currentFont -->
<h3 class="fn"><a name="currentFont"></a><span class="type"><a href="qfont.html">QFont</a></span> QTextEdit::<span class="name">currentFont</span> () const</h3>
<p>Returns the font of the current format.</p>
<p><b>See also </b><a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), <a href="qtextedit.html#setFontFamily">setFontFamily</a>(), and <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>().</p>
<!-- @@@currentFont -->
<!-- $$$cursorForPosition[overload1]$$$cursorForPositionconstQPoint& -->
<h3 class="fn"><a name="cursorForPosition"></a><span class="type"><a href="qtextcursor.html">QTextCursor</a></span> QTextEdit::<span class="name">cursorForPosition</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>pos</i> ) const</h3>
<p>returns a <a href="qtextcursor.html">QTextCursor</a> at position <i>pos</i> (in viewport coordinates).</p>
<!-- @@@cursorForPosition -->
<!-- $$$cursorPositionChanged[overload1]$$$cursorPositionChanged -->
<h3 class="fn"><a name="cursorPositionChanged"></a><span class="type">void</span> QTextEdit::<span class="name">cursorPositionChanged</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted whenever the position of the cursor changed.</p>
<!-- @@@cursorPositionChanged -->
<!-- $$$cursorRect[overload1]$$$cursorRectconstQTextCursor& -->
<h3 class="fn"><a name="cursorRect"></a><span class="type"><a href="qrect.html">QRect</a></span> QTextEdit::<span class="name">cursorRect</span> ( const <span class="type"><a href="qtextcursor.html">QTextCursor</a></span> &amp; <i>cursor</i> ) const</h3>
<p>returns a rectangle (in viewport coordinates) that includes the <i>cursor</i>.</p>
<!-- @@@cursorRect -->
<!-- $$$cursorRect$$$cursorRect -->
<h3 class="fn"><a name="cursorRect-2"></a><span class="type"><a href="qrect.html">QRect</a></span> QTextEdit::<span class="name">cursorRect</span> () const</h3>
<p>returns a rectangle (in viewport coordinates) that includes the cursor of the text edit.</p>
<!-- @@@cursorRect -->
<!-- $$$cut[overload1]$$$cut -->
<h3 class="fn"><a name="cut"></a><span class="type">void</span> QTextEdit::<span class="name">cut</span> ()<tt> [slot]</tt></h3>
<p>Copies the selected text to the clipboard and deletes it from the text edit.</p>
<p>If there is no selected text nothing happens.</p>
<p><b>See also </b><a href="qtextedit.html#copy">copy</a>() and <a href="qtextedit.html#paste">paste</a>().</p>
<!-- @@@cut -->
<!-- $$$document[overload1]$$$document -->
<h3 class="fn"><a name="document"></a><span class="type"><a href="qtextdocument.html">QTextDocument</a></span> * QTextEdit::<span class="name">document</span> () const</h3>
<p>Returns a pointer to the underlying document.</p>
<p><b>See also </b><a href="qtextedit.html#setDocument">setDocument</a>().</p>
<!-- @@@document -->
<!-- $$$dragEnterEvent[overload1]$$$dragEnterEventQDragEnterEvent* -->
<h3 class="fn"><a name="dragEnterEvent"></a><span class="type">void</span> QTextEdit::<span class="name">dragEnterEvent</span> ( <span class="type"><a href="qdragenterevent.html">QDragEnterEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#dragEnterEvent">QWidget::dragEnterEvent</a>().</p>
<!-- @@@dragEnterEvent -->
<!-- $$$dragLeaveEvent[overload1]$$$dragLeaveEventQDragLeaveEvent* -->
<h3 class="fn"><a name="dragLeaveEvent"></a><span class="type">void</span> QTextEdit::<span class="name">dragLeaveEvent</span> ( <span class="type"><a href="qdragleaveevent.html">QDragLeaveEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#dragLeaveEvent">QWidget::dragLeaveEvent</a>().</p>
<!-- @@@dragLeaveEvent -->
<!-- $$$dragMoveEvent[overload1]$$$dragMoveEventQDragMoveEvent* -->
<h3 class="fn"><a name="dragMoveEvent"></a><span class="type">void</span> QTextEdit::<span class="name">dragMoveEvent</span> ( <span class="type"><a href="qdragmoveevent.html">QDragMoveEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#dragMoveEvent">QWidget::dragMoveEvent</a>().</p>
<!-- @@@dragMoveEvent -->
<!-- $$$dropEvent[overload1]$$$dropEventQDropEvent* -->
<h3 class="fn"><a name="dropEvent"></a><span class="type">void</span> QTextEdit::<span class="name">dropEvent</span> ( <span class="type"><a href="qdropevent.html">QDropEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#dropEvent">QWidget::dropEvent</a>().</p>
<!-- @@@dropEvent -->
<!-- $$$ensureCursorVisible[overload1]$$$ensureCursorVisible -->
<h3 class="fn"><a name="ensureCursorVisible"></a><span class="type">void</span> QTextEdit::<span class="name">ensureCursorVisible</span> ()</h3>
<p>Ensures that the cursor is visible by scrolling the text edit if necessary.</p>
<!-- @@@ensureCursorVisible -->
<!-- $$$extraSelections[overload1]$$$extraSelections -->
<h3 class="fn"><a name="extraSelections"></a><span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type"><a href="qtextedit-extraselection.html">ExtraSelection</a></span>&gt; QTextEdit::<span class="name">extraSelections</span> () const</h3>
<p>Returns previously set extra selections.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qtextedit.html#setExtraSelections">setExtraSelections</a>().</p>
<!-- @@@extraSelections -->
<!-- $$$find[overload1]$$$findconstQString&QTextDocument::FindFlags -->
<h3 class="fn"><a name="find"></a><span class="type">bool</span> QTextEdit::<span class="name">find</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>exp</i>, <span class="type"><a href="qtextdocument.html#FindFlag-enum">QTextDocument::FindFlags</a></span> <i>options</i> = 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>
<!-- @@@find -->
<!-- $$$focusInEvent[overload1]$$$focusInEventQFocusEvent* -->
<h3 class="fn"><a name="focusInEvent"></a><span class="type">void</span> QTextEdit::<span class="name">focusInEvent</span> ( <span class="type"><a href="qfocusevent.html">QFocusEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#focusInEvent">QWidget::focusInEvent</a>().</p>
<!-- @@@focusInEvent -->
<!-- $$$focusNextPrevChild[overload1]$$$focusNextPrevChildbool -->
<h3 class="fn"><a name="focusNextPrevChild"></a><span class="type">bool</span> QTextEdit::<span class="name">focusNextPrevChild</span> ( <span class="type">bool</span> <i>next</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#focusNextPrevChild">QWidget::focusNextPrevChild</a>().</p>
<!-- @@@focusNextPrevChild -->
<!-- $$$focusOutEvent[overload1]$$$focusOutEventQFocusEvent* -->
<h3 class="fn"><a name="focusOutEvent"></a><span class="type">void</span> QTextEdit::<span class="name">focusOutEvent</span> ( <span class="type"><a href="qfocusevent.html">QFocusEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#focusOutEvent">QWidget::focusOutEvent</a>().</p>
<!-- @@@focusOutEvent -->
<!-- $$$fontFamily[overload1]$$$fontFamily -->
<h3 class="fn"><a name="fontFamily"></a><span class="type"><a href="qstring.html">QString</a></span> QTextEdit::<span class="name">fontFamily</span> () const</h3>
<p>Returns the font family of the current format.</p>
<p><b>See also </b><a href="qtextedit.html#setFontFamily">setFontFamily</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>().</p>
<!-- @@@fontFamily -->
<!-- $$$fontItalic[overload1]$$$fontItalic -->
<h3 class="fn"><a name="fontItalic"></a><span class="type">bool</span> QTextEdit::<span class="name">fontItalic</span> () const</h3>
<p>Returns true if the font of the current format is italic; otherwise returns false.</p>
<p><b>See also </b><a href="qtextedit.html#setFontItalic">setFontItalic</a>().</p>
<!-- @@@fontItalic -->
<!-- $$$fontPointSize[overload1]$$$fontPointSize -->
<h3 class="fn"><a name="fontPointSize"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QTextEdit::<span class="name">fontPointSize</span> () const</h3>
<p>Returns the point size of the font of the current format.</p>
<p><b>See also </b><a href="qtextedit.html#setFontFamily">setFontFamily</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>().</p>
<!-- @@@fontPointSize -->
<!-- $$$fontUnderline[overload1]$$$fontUnderline -->
<h3 class="fn"><a name="fontUnderline"></a><span class="type">bool</span> QTextEdit::<span class="name">fontUnderline</span> () const</h3>
<p>Returns true if the font of the current format is underlined; otherwise returns false.</p>
<p><b>See also </b><a href="qtextedit.html#setFontUnderline">setFontUnderline</a>().</p>
<!-- @@@fontUnderline -->
<!-- $$$fontWeight[overload1]$$$fontWeight -->
<h3 class="fn"><a name="fontWeight"></a><span class="type">int</span> QTextEdit::<span class="name">fontWeight</span> () const</h3>
<p>Returns the font weight of the current format.</p>
<p><b>See also </b><a href="qtextedit.html#setFontWeight">setFontWeight</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>(), and <a href="qfont.html#Weight-enum">QFont::Weight</a>.</p>
<!-- @@@fontWeight -->
<!-- $$$inputMethodEvent[overload1]$$$inputMethodEventQInputMethodEvent* -->
<h3 class="fn"><a name="inputMethodEvent"></a><span class="type">void</span> QTextEdit::<span class="name">inputMethodEvent</span> ( <span class="type"><a href="qinputmethodevent.html">QInputMethodEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#inputMethodEvent">QWidget::inputMethodEvent</a>().</p>
<!-- @@@inputMethodEvent -->
<!-- $$$inputMethodQuery[overload1]$$$inputMethodQueryQt::InputMethodQuery -->
<h3 class="fn"><a name="inputMethodQuery"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QTextEdit::<span class="name">inputMethodQuery</span> ( <span class="type"><a href="qt.html#InputMethodQuery-enum">Qt::InputMethodQuery</a></span> <i>property</i> ) const<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#inputMethodQuery">QWidget::inputMethodQuery</a>().</p>
<!-- @@@inputMethodQuery -->
<!-- $$$insertFromMimeData[overload1]$$$insertFromMimeDataconstQMimeData* -->
<h3 class="fn"><a name="insertFromMimeData"></a><span class="type">void</span> QTextEdit::<span class="name">insertFromMimeData</span> ( const <span class="type"><a href="qmimedata.html">QMimeData</a></span> * <i>source</i> )<tt> [virtual protected]</tt></h3>
<p>This function inserts the contents of the MIME data object, specified by <i>source</i>, into the text edit at the current cursor position. It is called whenever text is inserted as the result of a clipboard paste operation, or when the text edit accepts data from a drag and drop operation.</p>
<p>Reimplement this function to enable drag and drop support for additional MIME types.</p>
<!-- @@@insertFromMimeData -->
<!-- $$$insertHtml[overload1]$$$insertHtmlconstQString& -->
<h3 class="fn"><a name="insertHtml"></a><span class="type">void</span> QTextEdit::<span class="name">insertHtml</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )<tt> [slot]</tt></h3>
<p>Convenience slot that inserts <i>text</i> which is assumed to be of html formatting at the current cursor position.</p>
<p>It is equivalent to:</p>
<pre class="cpp"> edit<span class="operator">-</span><span class="operator">&gt;</span><a href="qtextedit.html#textCursor">textCursor</a>()<span class="operator">.</span>insertHtml(fragment);</pre>
<p><b>Note:</b> When using this function with a style sheet, the style sheet will only apply to the current block in the document. In order to apply a style sheet throughout a document, use <a href="qtextdocument.html#defaultStyleSheet-prop">QTextDocument::setDefaultStyleSheet</a>() instead.</p>
<!-- @@@insertHtml -->
<!-- $$$insertPlainText[overload1]$$$insertPlainTextconstQString& -->
<h3 class="fn"><a name="insertPlainText"></a><span class="type">void</span> QTextEdit::<span class="name">insertPlainText</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )<tt> [slot]</tt></h3>
<p>Convenience slot that inserts <i>text</i> at the current cursor position.</p>
<p>It is equivalent to</p>
<pre class="cpp"> edit<span class="operator">-</span><span class="operator">&gt;</span><a href="qtextedit.html#textCursor">textCursor</a>()<span class="operator">.</span>insertText(text);</pre>
<!-- @@@insertPlainText -->
<!-- $$$keyPressEvent[overload1]$$$keyPressEventQKeyEvent* -->
<h3 class="fn"><a name="keyPressEvent"></a><span class="type">void</span> QTextEdit::<span class="name">keyPressEvent</span> ( <span class="type"><a href="qkeyevent.html">QKeyEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget::keyPressEvent</a>().</p>
<!-- @@@keyPressEvent -->
<!-- $$$keyReleaseEvent[overload1]$$$keyReleaseEventQKeyEvent* -->
<h3 class="fn"><a name="keyReleaseEvent"></a><span class="type">void</span> QTextEdit::<span class="name">keyReleaseEvent</span> ( <span class="type"><a href="qkeyevent.html">QKeyEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#keyReleaseEvent">QWidget::keyReleaseEvent</a>().</p>
<!-- @@@keyReleaseEvent -->
<!-- $$$loadResource[overload1]$$$loadResourceintconstQUrl& -->
<h3 class="fn"><a name="loadResource"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QTextEdit::<span class="name">loadResource</span> ( <span class="type">int</span> <i>type</i>, const <span class="type"><a href="qurl.html">QUrl</a></span> &amp; <i>name</i> )<tt> [virtual]</tt></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><b>See also </b><a href="qtextdocument.html#loadResource">QTextDocument::loadResource</a>().</p>
<!-- @@@loadResource -->
<!-- $$$mergeCurrentCharFormat[overload1]$$$mergeCurrentCharFormatconstQTextCharFormat& -->
<h3 class="fn"><a name="mergeCurrentCharFormat"></a><span class="type">void</span> QTextEdit::<span class="name">mergeCurrentCharFormat</span> ( const <span class="type"><a href="qtextcharformat.html">QTextCharFormat</a></span> &amp; <i>modifier</i> )</h3>
<p>Merges the properties specified in <i>modifier</i> into the current character format by calling 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><b>See also </b><a href="qtextcursor.html#mergeCharFormat">QTextCursor::mergeCharFormat</a>().</p>
<!-- @@@mergeCurrentCharFormat -->
<!-- $$$mouseDoubleClickEvent[overload1]$$$mouseDoubleClickEventQMouseEvent* -->
<h3 class="fn"><a name="mouseDoubleClickEvent"></a><span class="type">void</span> QTextEdit::<span class="name">mouseDoubleClickEvent</span> ( <span class="type"><a href="qmouseevent.html">QMouseEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mouseDoubleClickEvent">QWidget::mouseDoubleClickEvent</a>().</p>
<!-- @@@mouseDoubleClickEvent -->
<!-- $$$mouseMoveEvent[overload1]$$$mouseMoveEventQMouseEvent* -->
<h3 class="fn"><a name="mouseMoveEvent"></a><span class="type">void</span> QTextEdit::<span class="name">mouseMoveEvent</span> ( <span class="type"><a href="qmouseevent.html">QMouseEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mouseMoveEvent">QWidget::mouseMoveEvent</a>().</p>
<!-- @@@mouseMoveEvent -->
<!-- $$$mousePressEvent[overload1]$$$mousePressEventQMouseEvent* -->
<h3 class="fn"><a name="mousePressEvent"></a><span class="type">void</span> QTextEdit::<span class="name">mousePressEvent</span> ( <span class="type"><a href="qmouseevent.html">QMouseEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget::mousePressEvent</a>().</p>
<!-- @@@mousePressEvent -->
<!-- $$$mouseReleaseEvent[overload1]$$$mouseReleaseEventQMouseEvent* -->
<h3 class="fn"><a name="mouseReleaseEvent"></a><span class="type">void</span> QTextEdit::<span class="name">mouseReleaseEvent</span> ( <span class="type"><a href="qmouseevent.html">QMouseEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mouseReleaseEvent">QWidget::mouseReleaseEvent</a>().</p>
<!-- @@@mouseReleaseEvent -->
<!-- $$$moveCursor[overload1]$$$moveCursorQTextCursor::MoveOperationQTextCursor::MoveMode -->
<h3 class="fn"><a name="moveCursor"></a><span class="type">void</span> QTextEdit::<span class="name">moveCursor</span> ( <span class="type"><a href="qtextcursor.html#MoveOperation-enum">QTextCursor::MoveOperation</a></span> <i>operation</i>, <span class="type"><a href="qtextcursor.html#MoveMode-enum">QTextCursor::MoveMode</a></span> <i>mode</i> = QTextCursor::MoveAnchor )</h3>
<p>Moves the cursor by performing the given <i>operation</i>.</p>
<p>If <i>mode</i> is <a href="qtextcursor.html#MoveMode-enum">QTextCursor::KeepAnchor</a>, the cursor selects the text it moves over. This is the same effect that the user achieves when they hold down the Shift key and move the cursor with the cursor keys.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qtextcursor.html#movePosition">QTextCursor::movePosition</a>().</p>
<!-- @@@moveCursor -->
<!-- $$$paintEvent[overload1]$$$paintEventQPaintEvent* -->
<h3 class="fn"><a name="paintEvent"></a><span class="type">void</span> QTextEdit::<span class="name">paintEvent</span> ( <span class="type"><a href="qpaintevent.html">QPaintEvent</a></span> * <i>event</i> )<tt> [virtual protected]</tt></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>
<!-- @@@paintEvent -->
<!-- $$$paste[overload1]$$$paste -->
<h3 class="fn"><a name="paste"></a><span class="type">void</span> QTextEdit::<span class="name">paste</span> ()<tt> [slot]</tt></h3>
<p>Pastes the text from the clipboard into the text edit at the current cursor position.</p>
<p>If there is no text in the clipboard nothing happens.</p>
<p>To change the behavior of this function, i.e&#x2e; to modify what <a href="qtextedit.html">QTextEdit</a> can paste and how it is being pasted, reimplement the virtual <a href="qtextedit.html#canInsertFromMimeData">canInsertFromMimeData</a>() and <a href="qtextedit.html#insertFromMimeData">insertFromMimeData</a>() functions.</p>
<p><b>See also </b><a href="qtextedit.html#cut">cut</a>() and <a href="qtextedit.html#copy">copy</a>().</p>
<!-- @@@paste -->
<!-- $$$print[overload1]$$$printQPrinter* -->
<h3 class="fn"><a name="print"></a><span class="type">void</span> QTextEdit::<span class="name">print</span> ( <span class="type"><a href="qprinter.html">QPrinter</a></span> * <i>printer</i> ) const</h3>
<p>Convenience function to print the text edit's document to the given <i>printer</i>. This is equivalent to calling the print method on the document directly except that this function also supports <a href="qprinter.html#PrintRange-enum">QPrinter::Selection</a> as print range.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also </b><a href="qtextdocument.html#print">QTextDocument::print</a>().</p>
<!-- @@@print -->
<!-- $$$redo[overload1]$$$redo -->
<h3 class="fn"><a name="redo"></a><span class="type">void</span> QTextEdit::<span class="name">redo</span> ()<tt> [slot]</tt></h3>
<p>Redoes the last operation.</p>
<p>If there is no operation to redo, i.e&#x2e; there is no redo step in the undo/redo history, nothing happens.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qtextedit.html#undo">undo</a>().</p>
<!-- @@@redo -->
<!-- $$$redoAvailable[overload1]$$$redoAvailablebool -->
<h3 class="fn"><a name="redoAvailable"></a><span class="type">void</span> QTextEdit::<span class="name">redoAvailable</span> ( <span class="type">bool</span> <i>available</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted whenever redo operations become available (<i>available</i> is true) or unavailable (<i>available</i> is false).</p>
<!-- @@@redoAvailable -->
<!-- $$$resizeEvent[overload1]$$$resizeEventQResizeEvent* -->
<h3 class="fn"><a name="resizeEvent"></a><span class="type">void</span> QTextEdit::<span class="name">resizeEvent</span> ( <span class="type"><a href="qresizeevent.html">QResizeEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget::resizeEvent</a>().</p>
<!-- @@@resizeEvent -->
<!-- $$$scrollContentsBy[overload1]$$$scrollContentsByintint -->
<h3 class="fn"><a name="scrollContentsBy"></a><span class="type">void</span> QTextEdit::<span class="name">scrollContentsBy</span> ( <span class="type">int</span> <i>dx</i>, <span class="type">int</span> <i>dy</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#scrollContentsBy">QAbstractScrollArea::scrollContentsBy</a>().</p>
<!-- @@@scrollContentsBy -->
<!-- $$$scrollToAnchor[overload1]$$$scrollToAnchorconstQString& -->
<h3 class="fn"><a name="scrollToAnchor"></a><span class="type">void</span> QTextEdit::<span class="name">scrollToAnchor</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>name</i> )<tt> [slot]</tt></h3>
<p>Scrolls the text edit so that the anchor with the given <i>name</i> is visible; does nothing if the <i>name</i> is empty, or is already visible, or isn't found.</p>
<!-- @@@scrollToAnchor -->
<!-- $$$selectAll[overload1]$$$selectAll -->
<h3 class="fn"><a name="selectAll"></a><span class="type">void</span> QTextEdit::<span class="name">selectAll</span> ()<tt> [slot]</tt></h3>
<p>Selects all text.</p>
<p><b>See also </b><a href="qtextedit.html#copy">copy</a>(), <a href="qtextedit.html#cut">cut</a>(), and <a href="qtextedit.html#textCursor">textCursor</a>().</p>
<!-- @@@selectAll -->
<!-- $$$selectionChanged[overload1]$$$selectionChanged -->
<h3 class="fn"><a name="selectionChanged"></a><span class="type">void</span> QTextEdit::<span class="name">selectionChanged</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted whenever the selection changes.</p>
<p><b>See also </b><a href="qtextedit.html#copyAvailable">copyAvailable</a>().</p>
<!-- @@@selectionChanged -->
<!-- $$$setAlignment[overload1]$$$setAlignmentQt::Alignment -->
<h3 class="fn"><a name="setAlignment"></a><span class="type">void</span> QTextEdit::<span class="name">setAlignment</span> ( <span class="type"><a href="qt.html#AlignmentFlag-enum">Qt::Alignment</a></span> <i>a</i> )<tt> [slot]</tt></h3>
<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><b>See also </b><a href="qtextedit.html#alignment">alignment</a>().</p>
<!-- @@@setAlignment -->
<!-- $$$setCurrentCharFormat[overload1]$$$setCurrentCharFormatconstQTextCharFormat& -->
<h3 class="fn"><a name="setCurrentCharFormat"></a><span class="type">void</span> QTextEdit::<span class="name">setCurrentCharFormat</span> ( const <span class="type"><a href="qtextcharformat.html">QTextCharFormat</a></span> &amp; <i>format</i> )</h3>
<p>Sets the char format that is be used when inserting new text to <i>format</i> by calling <a href="qtextcursor.html#setCharFormat">QTextCursor::setCharFormat</a>() on the editor's cursor. If the editor has a selection then the char format is directly applied to the selection.</p>
<p><b>See also </b><a href="qtextedit.html#currentCharFormat">currentCharFormat</a>().</p>
<!-- @@@setCurrentCharFormat -->
<!-- $$$setCurrentFont[overload1]$$$setCurrentFontconstQFont& -->
<h3 class="fn"><a name="setCurrentFont"></a><span class="type">void</span> QTextEdit::<span class="name">setCurrentFont</span> ( const <span class="type"><a href="qfont.html">QFont</a></span> &amp; <i>f</i> )<tt> [slot]</tt></h3>
<p>Sets the font of the current format to <i>f</i>.</p>
<p><b>See also </b><a href="qtextedit.html#currentFont">currentFont</a>(), <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>(), and <a href="qtextedit.html#setFontFamily">setFontFamily</a>().</p>
<!-- @@@setCurrentFont -->
<!-- $$$setDocument[overload1]$$$setDocumentQTextDocument* -->
<h3 class="fn"><a name="setDocument"></a><span class="type">void</span> QTextEdit::<span class="name">setDocument</span> ( <span class="type"><a href="qtextdocument.html">QTextDocument</a></span> * <i>document</i> )</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>The editor does not delete the current document, even if it is a child of the editor.</p>
<p><b>See also </b><a href="qtextedit.html#document">document</a>().</p>
<!-- @@@setDocument -->
<!-- $$$setExtraSelections[overload1]$$$setExtraSelectionsconstQList<ExtraSelection>& -->
<h3 class="fn"><a name="setExtraSelections"></a><span class="type">void</span> QTextEdit::<span class="name">setExtraSelections</span> ( const <span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type"><a href="qtextedit-extraselection.html">ExtraSelection</a></span>&gt; &amp; <i>selections</i> )</h3>
<p>This function allows temporarily marking certain regions in the document with a given color, specified as <i>selections</i>. This can be useful for example in a programming editor to mark a whole line of text with a given background color to indicate the existence of a breakpoint.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qtextedit-extraselection.html">QTextEdit::ExtraSelection</a> and <a href="qtextedit.html#extraSelections">extraSelections</a>().</p>
<!-- @@@setExtraSelections -->
<!-- $$$setFontFamily[overload1]$$$setFontFamilyconstQString& -->
<h3 class="fn"><a name="setFontFamily"></a><span class="type">void</span> QTextEdit::<span class="name">setFontFamily</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>fontFamily</i> )<tt> [slot]</tt></h3>
<p>Sets the font family of the current format to <i>fontFamily</i>.</p>
<p><b>See also </b><a href="qtextedit.html#fontFamily">fontFamily</a>() and <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>().</p>
<!-- @@@setFontFamily -->
<!-- $$$setFontItalic[overload1]$$$setFontItalicbool -->
<h3 class="fn"><a name="setFontItalic"></a><span class="type">void</span> QTextEdit::<span class="name">setFontItalic</span> ( <span class="type">bool</span> <i>italic</i> )<tt> [slot]</tt></h3>
<p>If <i>italic</i> is true, sets the current format to italic; otherwise sets the current format to non-italic.</p>
<p><b>See also </b><a href="qtextedit.html#fontItalic">fontItalic</a>().</p>
<!-- @@@setFontItalic -->
<!-- $$$setFontPointSize[overload1]$$$setFontPointSizeqreal -->
<h3 class="fn"><a name="setFontPointSize"></a><span class="type">void</span> QTextEdit::<span class="name">setFontPointSize</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>s</i> )<tt> [slot]</tt></h3>
<p>Sets the point size of the current format to <i>s</i>.</p>
<p>Note that if <i>s</i> is zero or negative, the behavior of this function is not defined.</p>
<p><b>See also </b><a href="qtextedit.html#fontPointSize">fontPointSize</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="qtextedit.html#setFontFamily">setFontFamily</a>().</p>
<!-- @@@setFontPointSize -->
<!-- $$$setFontUnderline[overload1]$$$setFontUnderlinebool -->
<h3 class="fn"><a name="setFontUnderline"></a><span class="type">void</span> QTextEdit::<span class="name">setFontUnderline</span> ( <span class="type">bool</span> <i>underline</i> )<tt> [slot]</tt></h3>
<p>If <i>underline</i> is true, sets the current format to underline; otherwise sets the current format to non-underline.</p>
<p><b>See also </b><a href="qtextedit.html#fontUnderline">fontUnderline</a>().</p>
<!-- @@@setFontUnderline -->
<!-- $$$setFontWeight[overload1]$$$setFontWeightint -->
<h3 class="fn"><a name="setFontWeight"></a><span class="type">void</span> QTextEdit::<span class="name">setFontWeight</span> ( <span class="type">int</span> <i>weight</i> )<tt> [slot]</tt></h3>
<p>Sets the font weight of the current format to the given <i>weight</i>, where the value used is in the range defined by the <a href="qfont.html#Weight-enum">QFont::Weight</a> enum.</p>
<p><b>See also </b><a href="qtextedit.html#fontWeight">fontWeight</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="qtextedit.html#setFontFamily">setFontFamily</a>().</p>
<!-- @@@setFontWeight -->
<!-- $$$setText[overload1]$$$setTextconstQString& -->
<h3 class="fn"><a name="setText"></a><span class="type">void</span> QTextEdit::<span class="name">setText</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )<tt> [slot]</tt></h3>
<p>Sets the text edit's <i>text</i>. The text can be plain text or HTML and the text edit will try to guess the right format.</p>
<p>Use <a href="qtextedit.html#html-prop">setHtml</a>() or <a href="qtextedit.html#plainText-prop">setPlainText</a>() directly to avoid text edit's guessing.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qtextedit-qt3.html#text" class="compat">text</a>(), <a href="qtextedit.html#plainText-prop">toPlainText</a>(), and <a href="qtextedit.html#html-prop">toHtml</a>().</p>
<!-- @@@setText -->
<!-- $$$setTextBackgroundColor[overload1]$$$setTextBackgroundColorconstQColor& -->
<h3 class="fn"><a name="setTextBackgroundColor"></a><span class="type">void</span> QTextEdit::<span class="name">setTextBackgroundColor</span> ( const <span class="type"><a href="qcolor.html">QColor</a></span> &amp; <i>c</i> )<tt> [slot]</tt></h3>
<p>Sets the text background color of the current format to <i>c</i>.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qtextedit.html#textBackgroundColor">textBackgroundColor</a>().</p>
<!-- @@@setTextBackgroundColor -->
<!-- $$$setTextColor[overload1]$$$setTextColorconstQColor& -->
<h3 class="fn"><a name="setTextColor"></a><span class="type">void</span> QTextEdit::<span class="name">setTextColor</span> ( const <span class="type"><a href="qcolor.html">QColor</a></span> &amp; <i>c</i> )<tt> [slot]</tt></h3>
<p>Sets the text color of the current format to <i>c</i>.</p>
<p><b>See also </b><a href="qtextedit.html#textColor">textColor</a>().</p>
<!-- @@@setTextColor -->
<!-- $$$setTextCursor[overload1]$$$setTextCursorconstQTextCursor& -->
<h3 class="fn"><a name="setTextCursor"></a><span class="type">void</span> QTextEdit::<span class="name">setTextCursor</span> ( const <span class="type"><a href="qtextcursor.html">QTextCursor</a></span> &amp; <i>cursor</i> )</h3>
<p>Sets the visible <i>cursor</i>.</p>
<p><b>See also </b><a href="qtextedit.html#textCursor">textCursor</a>().</p>
<!-- @@@setTextCursor -->
<!-- $$$showEvent[overload1]$$$showEventQShowEvent* -->
<h3 class="fn"><a name="showEvent"></a><span class="type">void</span> QTextEdit::<span class="name">showEvent</span> ( <span class="type"><a href="qshowevent.html">QShowEvent</a></span> * )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#showEvent">QWidget::showEvent</a>().</p>
<!-- @@@showEvent -->
<!-- $$$textBackgroundColor[overload1]$$$textBackgroundColor -->
<h3 class="fn"><a name="textBackgroundColor"></a><span class="type"><a href="qcolor.html">QColor</a></span> QTextEdit::<span class="name">textBackgroundColor</span> () const</h3>
<p>Returns the text background color of the current format.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qtextedit.html#setTextBackgroundColor">setTextBackgroundColor</a>().</p>
<!-- @@@textBackgroundColor -->
<!-- $$$textChanged[overload1]$$$textChanged -->
<h3 class="fn"><a name="textChanged"></a><span class="type">void</span> QTextEdit::<span class="name">textChanged</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted whenever the document's content changes; for example, when text is inserted or deleted, or when formatting is applied.</p>
<!-- @@@textChanged -->
<!-- $$$textColor[overload1]$$$textColor -->
<h3 class="fn"><a name="textColor"></a><span class="type"><a href="qcolor.html">QColor</a></span> QTextEdit::<span class="name">textColor</span> () const</h3>
<p>Returns the text color of the current format.</p>
<p><b>See also </b><a href="qtextedit.html#setTextColor">setTextColor</a>().</p>
<!-- @@@textColor -->
<!-- $$$textCursor[overload1]$$$textCursor -->
<h3 class="fn"><a name="textCursor"></a><span class="type"><a href="qtextcursor.html">QTextCursor</a></span> QTextEdit::<span class="name">textCursor</span> () const</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><b>See also </b><a href="qtextedit.html#setTextCursor">setTextCursor</a>().</p>
<!-- @@@textCursor -->
<!-- $$$undo[overload1]$$$undo -->
<h3 class="fn"><a name="undo"></a><span class="type">void</span> QTextEdit::<span class="name">undo</span> ()<tt> [slot]</tt></h3>
<p>Undoes the last operation.</p>
<p>If there is no operation to undo, i.e&#x2e; there is no undo step in the undo/redo history, nothing happens.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qtextedit.html#redo">redo</a>().</p>
<!-- @@@undo -->
<!-- $$$undoAvailable[overload1]$$$undoAvailablebool -->
<h3 class="fn"><a name="undoAvailable"></a><span class="type">void</span> QTextEdit::<span class="name">undoAvailable</span> ( <span class="type">bool</span> <i>available</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted whenever undo operations become available (<i>available</i> is true) or unavailable (<i>available</i> is false).</p>
<!-- @@@undoAvailable -->
<!-- $$$wheelEvent[overload1]$$$wheelEventQWheelEvent* -->
<h3 class="fn"><a name="wheelEvent"></a><span class="type">void</span> QTextEdit::<span class="name">wheelEvent</span> ( <span class="type"><a href="qwheelevent.html">QWheelEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#wheelEvent">QWidget::wheelEvent</a>().</p>
<!-- @@@wheelEvent -->
<!-- $$$zoomIn[overload1]$$$zoomInint -->
<h3 class="fn"><a name="zoomIn"></a><span class="type">void</span> QTextEdit::<span class="name">zoomIn</span> ( <span class="type">int</span> <i>range</i> = 1 )<tt> [slot]</tt></h3>
<p>Zooms in on the text by making the base font size <i>range</i> points larger and recalculating all font sizes to be the new size. This does not change the size of any images.</p>
<p><b>See also </b><a href="qtextedit.html#zoomOut">zoomOut</a>().</p>
<!-- @@@zoomIn -->
<!-- $$$zoomOut[overload1]$$$zoomOutint -->
<h3 class="fn"><a name="zoomOut"></a><span class="type">void</span> QTextEdit::<span class="name">zoomOut</span> ( <span class="type">int</span> <i>range</i> = 1 )<tt> [slot]</tt></h3>
<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><b>See also </b><a href="qtextedit.html#zoomIn">zoomIn</a>().</p>
<!-- @@@zoomOut -->
</div>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2012 Nokia Corporation and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>