<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qtextedit.cpp:205 --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>TQTextEdit Class</title> <style type="text/css"><!-- fn { margin-left: 1cm; text-indent: -1cm; } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } body { background: #ffffff; color: black; } --></style> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr bgcolor="#E5E5E5"> <td valign=center> <a href="index.html"> <font color="#004faf">Home</font></a> | <a href="classes.html"> <font color="#004faf">All Classes</font></a> | <a href="mainclasses.html"> <font color="#004faf">Main Classes</font></a> | <a href="annotated.html"> <font color="#004faf">Annotated</font></a> | <a href="groups.html"> <font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"> <font color="#004faf">Functions</font></a> </td> <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQTextEdit Class Reference</h1> <p>The TQTextEdit widget provides a powerful single-page rich text editor. <a href="#details">More...</a> <p><tt>#include <<a href="qtextedit-h.html">ntqtextedit.h</a>></tt> <p>Inherits <a href="ntqscrollview.html">TQScrollView</a>. <p>Inherited by <a href="ntqmultilineedit.html">TQMultiLineEdit</a>, <a href="ntqtextbrowser.html">TQTextBrowser</a>, and <a href="ntqtextview.html">TQTextView</a>. <p><a href="qtextedit-members.html">List of all member functions.</a> <h2>Public Members</h2> <ul> <li class=fn>enum <a href="#WordWrap-enum"><b>WordWrap</b></a> { NoWrap, WidgetWidth, FixedPixelWidth, FixedColumnWidth }</li> <li class=fn>enum <a href="#WrapPolicy-enum"><b>WrapPolicy</b></a> { AtWordBoundary, AtWhiteSpace = AtWordBoundary, Anywhere, AtWordOrDocumentBoundary }</li> <li class=fn>enum <a href="#AutoFormatting-enum"><b>AutoFormatting</b></a> { AutoNone = 0, AutoBulletList = 0x00000001, AutoAll = 0xffffffff }</li> <li class=fn>enum <a href="#KeyboardAction-enum"><b>KeyboardAction</b></a> { ActionBackspace, ActionDelete, ActionReturn, ActionKill, ActionWordBackspace, ActionWordDelete }</li> <li class=fn>enum <a href="#CursorAction-enum"><b>CursorAction</b></a> { MoveBackward, MoveForward, MoveWordBackward, MoveWordForward, MoveUp, MoveDown, MoveLineStart, MoveLineEnd, MoveHome, MoveEnd, MovePgUp, MovePgDown }</li> <li class=fn>enum <a href="#VerticalAlignment-enum"><b>VerticalAlignment</b></a> { AlignNormal, AlignSuperScript, AlignSubScript }</li> <li class=fn><a href="#TQTextEdit"><b>TQTextEdit</b></a> ( const TQString & text, const TQString & context = TQString::null, TQWidget * parent = 0, const char * name = 0 )</li> <li class=fn><a href="#TQTextEdit-2"><b>TQTextEdit</b></a> ( TQWidget * parent = 0, const char * name = 0 )</li> <li class=fn>TQString <a href="#text"><b>text</b></a> () const</li> <li class=fn>TQString <a href="#text-2"><b>text</b></a> ( int para ) const</li> <li class=fn>TextFormat <a href="#textFormat"><b>textFormat</b></a> () const</li> <li class=fn>TQString <a href="#context"><b>context</b></a> () const</li> <li class=fn>TQString <a href="#documentTitle"><b>documentTitle</b></a> () const</li> <li class=fn>void <a href="#getSelection"><b>getSelection</b></a> ( int * paraFrom, int * indexFrom, int * paraTo, int * indexTo, int selNum = 0 ) const</li> <li class=fn>virtual bool <a href="#find"><b>find</b></a> ( const TQString & expr, bool cs, bool wo, bool forward = TRUE, int * para = 0, int * index = 0 )</li> <li class=fn>int <a href="#paragraphs"><b>paragraphs</b></a> () const</li> <li class=fn>int <a href="#lines"><b>lines</b></a> () const</li> <li class=fn>int <a href="#linesOfParagraph"><b>linesOfParagraph</b></a> ( int para ) const</li> <li class=fn>int <a href="#lineOfChar"><b>lineOfChar</b></a> ( int para, int index )</li> <li class=fn>int <a href="#length"><b>length</b></a> () const</li> <li class=fn>TQRect <a href="#paragraphRect"><b>paragraphRect</b></a> ( int para ) const</li> <li class=fn>int <a href="#paragraphAt"><b>paragraphAt</b></a> ( const TQPoint & pos ) const</li> <li class=fn>int <a href="#charAt"><b>charAt</b></a> ( const TQPoint & pos, int * para ) const</li> <li class=fn>int <a href="#paragraphLength"><b>paragraphLength</b></a> ( int para ) const</li> <li class=fn>TQStyleSheet * <a href="#styleSheet"><b>styleSheet</b></a> () const</li> <li class=fn>TQMimeSourceFactory * <a href="#mimeSourceFactory"><b>mimeSourceFactory</b></a> () const</li> <li class=fn>TQBrush <a href="#paper"><b>paper</b></a> () const</li> <li class=fn>bool <a href="#linkUnderline"><b>linkUnderline</b></a> () const</li> <li class=fn>virtual int <a href="#heightForWidth"><b>heightForWidth</b></a> ( int w ) const</li> <li class=fn>bool <a href="#hasSelectedText"><b>hasSelectedText</b></a> () const</li> <li class=fn>TQString <a href="#selectedText"><b>selectedText</b></a> () const</li> <li class=fn>bool <a href="#isUndoAvailable"><b>isUndoAvailable</b></a> () const</li> <li class=fn>bool <a href="#isRedoAvailable"><b>isRedoAvailable</b></a> () const</li> <li class=fn>WordWrap <a href="#wordWrap"><b>wordWrap</b></a> () const</li> <li class=fn>int <a href="#wrapColumnOrWidth"><b>wrapColumnOrWidth</b></a> () const</li> <li class=fn>WrapPolicy <a href="#wrapPolicy"><b>wrapPolicy</b></a> () const</li> <li class=fn>int <a href="#tabStopWidth"><b>tabStopWidth</b></a> () const</li> <li class=fn>TQString <a href="#anchorAt-2"><b>anchorAt</b></a> ( const TQPoint & pos )</li> <li class=fn>TQString <a href="#anchorAt"><b>anchorAt</b></a> ( const TQPoint & pos, AnchorAttribute attr )</li> <li class=fn>bool <a href="#isReadOnly"><b>isReadOnly</b></a> () const</li> <li class=fn>void <a href="#getCursorPosition"><b>getCursorPosition</b></a> ( int * para, int * index ) const</li> <li class=fn>bool <a href="#isModified"><b>isModified</b></a> () const</li> <li class=fn>bool <a href="#italic"><b>italic</b></a> () const</li> <li class=fn>bool <a href="#bold"><b>bold</b></a> () const</li> <li class=fn>bool <a href="#underline"><b>underline</b></a> () const</li> <li class=fn>TQString <a href="#family"><b>family</b></a> () const</li> <li class=fn>int <a href="#pointSize"><b>pointSize</b></a> () const</li> <li class=fn>TQColor <a href="#color"><b>color</b></a> () const</li> <li class=fn>TQFont font () const <em>(obsolete)</em></li> <li class=fn>TQFont <a href="#currentFont"><b>currentFont</b></a> () const</li> <li class=fn>int <a href="#alignment"><b>alignment</b></a> () const</li> <li class=fn>int <a href="#undoDepth"><b>undoDepth</b></a> () const</li> <li class=fn>bool <a href="#isOverwriteMode"><b>isOverwriteMode</b></a> () const</li> <li class=fn>TQColor <a href="#paragraphBackgroundColor"><b>paragraphBackgroundColor</b></a> ( int para ) const</li> <li class=fn>bool <a href="#isUndoRedoEnabled"><b>isUndoRedoEnabled</b></a> () const</li> <li class=fn>bool <a href="#tabChangesFocus"><b>tabChangesFocus</b></a> () const</li> <li class=fn>void <a href="#setAutoFormatting"><b>setAutoFormatting</b></a> ( uint features )</li> <li class=fn>uint <a href="#autoFormatting"><b>autoFormatting</b></a> () const</li> <li class=fn>TQSyntaxHighlighter * <a href="#syntaxHighlighter"><b>syntaxHighlighter</b></a> () const</li> </ul> <h2>Public Slots</h2> <ul> <li class=fn>virtual void <a href="#setMimeSourceFactory"><b>setMimeSourceFactory</b></a> ( TQMimeSourceFactory * factory )</li> <li class=fn>virtual void <a href="#setStyleSheet"><b>setStyleSheet</b></a> ( TQStyleSheet * styleSheet )</li> <li class=fn>virtual void <a href="#scrollToAnchor"><b>scrollToAnchor</b></a> ( const TQString & name )</li> <li class=fn>virtual void <a href="#setPaper"><b>setPaper</b></a> ( const TQBrush & pap )</li> <li class=fn>virtual void <a href="#setLinkUnderline"><b>setLinkUnderline</b></a> ( bool )</li> <li class=fn>virtual void <a href="#setWordWrap"><b>setWordWrap</b></a> ( WordWrap mode )</li> <li class=fn>virtual void <a href="#setWrapColumnOrWidth"><b>setWrapColumnOrWidth</b></a> ( int )</li> <li class=fn>virtual void <a href="#setWrapPolicy"><b>setWrapPolicy</b></a> ( WrapPolicy policy )</li> <li class=fn>virtual void <a href="#copy"><b>copy</b></a> ()</li> <li class=fn>virtual void <a href="#append"><b>append</b></a> ( const TQString & text )</li> <li class=fn>void <a href="#setText"><b>setText</b></a> ( const TQString & txt )</li> <li class=fn>virtual void <a href="#setText-2"><b>setText</b></a> ( const TQString & text, const TQString & context )</li> <li class=fn>virtual void <a href="#setTextFormat"><b>setTextFormat</b></a> ( TextFormat f )</li> <li class=fn>virtual void <a href="#selectAll"><b>selectAll</b></a> ( bool select = TRUE )</li> <li class=fn>virtual void <a href="#setTabStopWidth"><b>setTabStopWidth</b></a> ( int ts )</li> <li class=fn>virtual void <a href="#zoomIn"><b>zoomIn</b></a> ( int range )</li> <li class=fn>virtual void <a href="#zoomIn-2"><b>zoomIn</b></a> ()</li> <li class=fn>virtual void <a href="#zoomOut"><b>zoomOut</b></a> ( int range )</li> <li class=fn>virtual void <a href="#zoomOut-2"><b>zoomOut</b></a> ()</li> <li class=fn>virtual void <a href="#zoomTo"><b>zoomTo</b></a> ( int size )</li> <li class=fn>virtual void <a href="#sync"><b>sync</b></a> ()</li> <li class=fn>virtual void <a href="#setReadOnly"><b>setReadOnly</b></a> ( bool b )</li> <li class=fn>virtual void <a href="#undo"><b>undo</b></a> ()</li> <li class=fn>virtual void <a href="#redo"><b>redo</b></a> ()</li> <li class=fn>virtual void <a href="#cut"><b>cut</b></a> ()</li> <li class=fn>virtual void <a href="#paste"><b>paste</b></a> ()</li> <li class=fn>virtual void <a href="#pasteSubType"><b>pasteSubType</b></a> ( const TQCString & subtype )</li> <li class=fn>virtual void <a href="#clear"><b>clear</b></a> ()</li> <li class=fn>virtual void <a href="#del"><b>del</b></a> ()</li> <li class=fn>virtual void <a href="#setItalic"><b>setItalic</b></a> ( bool b )</li> <li class=fn>virtual void <a href="#setBold"><b>setBold</b></a> ( bool b )</li> <li class=fn>virtual void <a href="#setUnderline"><b>setUnderline</b></a> ( bool b )</li> <li class=fn>virtual void <a href="#setFamily"><b>setFamily</b></a> ( const TQString & fontFamily )</li> <li class=fn>virtual void <a href="#setPointSize"><b>setPointSize</b></a> ( int s )</li> <li class=fn>virtual void <a href="#setColor"><b>setColor</b></a> ( const TQColor & c )</li> <li class=fn>virtual void <a href="#setVerticalAlignment"><b>setVerticalAlignment</b></a> ( VerticalAlignment a )</li> <li class=fn>virtual void <a href="#setAlignment"><b>setAlignment</b></a> ( int a )</li> <li class=fn>virtual void <a href="#setCursorPosition"><b>setCursorPosition</b></a> ( int para, int index )</li> <li class=fn>virtual void <a href="#setSelection"><b>setSelection</b></a> ( int paraFrom, int indexFrom, int paraTo, int indexTo, int selNum = 0 )</li> <li class=fn>virtual void <a href="#setSelectionAttributes"><b>setSelectionAttributes</b></a> ( int selNum, const TQColor & back, bool invertText )</li> <li class=fn>virtual void <a href="#setModified"><b>setModified</b></a> ( bool m )</li> <li class=fn>virtual void <a href="#setUndoDepth"><b>setUndoDepth</b></a> ( int d )</li> <li class=fn>virtual void <a href="#ensureCursorVisible"><b>ensureCursorVisible</b></a> ()</li> <li class=fn>virtual void <a href="#placeCursor"><b>placeCursor</b></a> ( const TQPoint & pos, TQTextCursor * c = 0 )</li> <li class=fn>virtual void <a href="#moveCursor"><b>moveCursor</b></a> ( CursorAction action, bool select )</li> <li class=fn>virtual void <a href="#doKeyboardAction"><b>doKeyboardAction</b></a> ( KeyboardAction action )</li> <li class=fn>virtual void <a href="#removeSelectedText"><b>removeSelectedText</b></a> ( int selNum = 0 )</li> <li class=fn>virtual void <a href="#removeSelection"><b>removeSelection</b></a> ( int selNum = 0 )</li> <li class=fn>virtual void <a href="#setCurrentFont"><b>setCurrentFont</b></a> ( const TQFont & f )</li> <li class=fn>virtual void <a href="#setOverwriteMode"><b>setOverwriteMode</b></a> ( bool b )</li> <li class=fn>virtual void <a href="#scrollToBottom"><b>scrollToBottom</b></a> ()</li> <li class=fn>void <a href="#insert"><b>insert</b></a> ( const TQString & text, uint insertionFlags = CheckNewLines | RemoveSelected )</li> <li class=fn>virtual void insert ( const TQString & text, bool indent, bool checkNewLine = TRUE, bool removeSelected = TRUE ) <em>(obsolete)</em></li> <li class=fn>virtual void <a href="#insertAt"><b>insertAt</b></a> ( const TQString & text, int para, int index )</li> <li class=fn>virtual void <a href="#removeParagraph"><b>removeParagraph</b></a> ( int para )</li> <li class=fn>virtual void <a href="#insertParagraph"><b>insertParagraph</b></a> ( const TQString & text, int para )</li> <li class=fn>virtual void <a href="#setParagraphBackgroundColor"><b>setParagraphBackgroundColor</b></a> ( int para, const TQColor & bg )</li> <li class=fn>virtual void <a href="#clearParagraphBackground"><b>clearParagraphBackground</b></a> ( int para )</li> <li class=fn>virtual void <a href="#setUndoRedoEnabled"><b>setUndoRedoEnabled</b></a> ( bool b )</li> <li class=fn>void <a href="#setTabChangesFocus"><b>setTabChangesFocus</b></a> ( bool b )</li> <li class=fn>void <a href="#setMaxLogLines"><b>setMaxLogLines</b></a> ( int limit )</li> <li class=fn>int <a href="#maxLogLines"><b>maxLogLines</b></a> ()</li> </ul> <h2>Signals</h2> <ul> <li class=fn>void <a href="#textChanged"><b>textChanged</b></a> ()</li> <li class=fn>void <a href="#selectionChanged"><b>selectionChanged</b></a> ()</li> <li class=fn>void <a href="#copyAvailable"><b>copyAvailable</b></a> ( bool yes )</li> <li class=fn>void <a href="#undoAvailable"><b>undoAvailable</b></a> ( bool yes )</li> <li class=fn>void <a href="#redoAvailable"><b>redoAvailable</b></a> ( bool yes )</li> <li class=fn>void <a href="#currentFontChanged"><b>currentFontChanged</b></a> ( const TQFont & f )</li> <li class=fn>void <a href="#currentColorChanged"><b>currentColorChanged</b></a> ( const TQColor & c )</li> <li class=fn>void <a href="#currentAlignmentChanged"><b>currentAlignmentChanged</b></a> ( int a )</li> <li class=fn>void <a href="#currentVerticalAlignmentChanged"><b>currentVerticalAlignmentChanged</b></a> ( VerticalAlignment a )</li> <li class=fn>void <a href="#cursorPositionChanged"><b>cursorPositionChanged</b></a> ( int para, int pos )</li> <li class=fn>void <a href="#returnPressed"><b>returnPressed</b></a> ()</li> <li class=fn>void <a href="#modificationChanged"><b>modificationChanged</b></a> ( bool m )</li> <li class=fn>void <a href="#clicked"><b>clicked</b></a> ( int para, int pos )</li> <li class=fn>void <a href="#doubleClicked"><b>doubleClicked</b></a> ( int para, int pos )</li> </ul> <h2>Properties</h2> <ul> <li class=fn>AutoFormatting <a href="#autoFormatting-prop"><b>autoFormatting</b></a> - the enabled set of auto formatting features</li> <li class=fn>TQString <a href="#documentTitle-prop"><b>documentTitle</b></a> - the title of the document parsed from the text <em>(read only)</em></li> <li class=fn>bool <a href="#hasSelectedText-prop"><b>hasSelectedText</b></a> - whether some text is selected in selection 0 <em>(read only)</em></li> <li class=fn>int <a href="#length-prop"><b>length</b></a> - the number of characters in the text <em>(read only)</em></li> <li class=fn>bool <a href="#linkUnderline-prop"><b>linkUnderline</b></a> - whether hypertext links will be underlined</li> <li class=fn>bool <a href="#modified-prop"><b>modified</b></a> - whether the document has been modified by the user</li> <li class=fn>bool <a href="#overwriteMode-prop"><b>overwriteMode</b></a> - the text edit's overwrite mode</li> <li class=fn>TQBrush <a href="#paper-prop"><b>paper</b></a> - the background (paper) brush</li> <li class=fn>bool <a href="#readOnly-prop"><b>readOnly</b></a> - whether the text edit is read-only</li> <li class=fn>TQString <a href="#selectedText-prop"><b>selectedText</b></a> - the selected text (from selection 0) or an empty string if there is no currently selected text (in selection 0) <em>(read only)</em></li> <li class=fn>bool <a href="#tabChangesFocus-prop"><b>tabChangesFocus</b></a> - whether TAB changes focus or is accepted as input</li> <li class=fn>int <a href="#tabStopWidth-prop"><b>tabStopWidth</b></a> - the tab stop width in pixels</li> <li class=fn>TQString <a href="#text-prop"><b>text</b></a> - the text edit's text</li> <li class=fn>TextFormat <a href="#textFormat-prop"><b>textFormat</b></a> - the text format: rich text, plain text, log text or auto text</li> <li class=fn>int <a href="#undoDepth-prop"><b>undoDepth</b></a> - the depth of the undo history</li> <li class=fn>bool <a href="#undoRedoEnabled-prop"><b>undoRedoEnabled</b></a> - whether undo/redo is enabled</li> <li class=fn>WordWrap <a href="#wordWrap-prop"><b>wordWrap</b></a> - the word wrap mode</li> <li class=fn>int <a href="#wrapColumnOrWidth-prop"><b>wrapColumnOrWidth</b></a> - the position (in pixels or columns depending on the wrap mode) where text will be wrapped</li> <li class=fn>WrapPolicy <a href="#wrapPolicy-prop"><b>wrapPolicy</b></a> - the word wrap policy, at whitespace or anywhere</li> </ul> <h2>Protected Members</h2> <ul> <li class=fn>void <a href="#repaintChanged"><b>repaintChanged</b></a> ()</li> <li class=fn>virtual void <a href="#keyPressEvent"><b>keyPressEvent</b></a> ( TQKeyEvent * e )</li> <li class=fn>virtual bool <a href="#focusNextPrevChild"><b>focusNextPrevChild</b></a> ( bool n )</li> <li class=fn>TQTextCursor * <a href="#textCursor"><b>textCursor</b></a> () const</li> <li class=fn>virtual TQPopupMenu * <a href="#createPopupMenu"><b>createPopupMenu</b></a> ( const TQPoint & pos )</li> <li class=fn>virtual TQPopupMenu * createPopupMenu () <em>(obsolete)</em></li> </ul> <hr><a name="details"></a><h2>Detailed Description</h2> The TQTextEdit widget provides a powerful single-page rich text editor. <p> <p> <!-- toc --> <ul> <li><a href="#1"> Introduction and Concepts </a> <li><a href="#1-1"> Using TQTextEdit as a Display Widget </a> <ul> <li><a href="#1-1-1"> Read-only key bindings </a> <li><a href="#1-1-2"> Using TQTextEdit in LogText Mode </a> </ul> <li><a href="#1-2"> Using TQTextEdit as an Editor </a> <ul> <li><a href="#1-2-1"> Editing key bindings </a> </ul> </ul> <!-- endtoc --> <p> <h3> Introduction and Concepts </h3> <a name="1"></a><p> TQTextEdit 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> TQTextEdit has four modes of operation: <center><table cellpadding="4" cellspacing="2" border="0"> <tr bgcolor="#a2c511"> <th valign="top">Mode <th valign="top">Command <th valign="top">Notes <tr bgcolor="#f0f0f0"> <td valign="top">Plain Text Editor <td valign="top">setTextFormat(PlainText) <td valign="top">Set text with <a href="#setText">setText</a>(); <a href="#text">text</a>() returns plain text. Text attributes (e.g. colors) can be set, but plain text is always returned. <tr bgcolor="#d0d0d0"> <td valign="top">Rich Text Editor <td valign="top">setTextFormat(RichText) <td valign="top">Set text with setText(); text() returns rich text. Rich text editing is fairly limited. You can't set margins or insert images for example (although you can read and correctly display files that have margins set and that include images). This mode is mostly useful for editing small amounts of rich text. <sup>1.</sup> <tr bgcolor="#f0f0f0"> <td valign="top">Text Viewer <td valign="top">setReadOnly(TRUE) <td valign="top">Set text with setText() or <a href="#append">append</a>() (which has no undo history so is faster and uses less memory); text() returns plain or rich text depending on the <a href="#textFormat">textFormat</a>(). This mode can correctly display a large subset of HTML tags. <tr bgcolor="#d0d0d0"> <td valign="top">Log Viewer <td valign="top">setTextFormat(LogText) <td valign="top">Append text using append(). The widget is set to be read only and rich text support is disabled although a few HTML tags (for color, bold, italic and underline) may be used. (See <a href="#logtextmode">LogText mode</a> for details.) </table></center> <p> <sup>1.</sup><small>A more complete API that supports setting margins, images, etc., is planned for a later TQt release.</small> <p> TQTextEdit can be used as a syntax highlighting editor when used in conjunction with <a href="ntqsyntaxhighlighter.html">TQSyntaxHighlighter</a>. <p> We recommend that you always call <a href="#setTextFormat">setTextFormat</a>() to set the mode you want to use. If you use <a href="ntqt.html#TextFormat-enum">AutoText</a> then <a href="#setText">setText</a>() and <a href="#append">append</a>() will try to determine whether the text they are given is plain text or rich text. If you use <a href="ntqt.html#TextFormat-enum">RichText</a> then setText() and append() will assume that the text they are given is rich text. <a href="#insert">insert</a>() simply inserts the text it is given. <p> TQTextEdit works on paragraphs and characters. A paragraph is a formatted string which is word-wrapped to fit into the width of the widget. By default when reading plain text, one newline signify a paragraph. A document consists of zero or more paragraphs, indexed from 0. Characters are indexed on a per-paragraph basis, also indexed from 0. The words in the paragraph are aligned in accordance with the paragraph's <a href="#alignment">alignment</a>(). Paragraphs are separated by hard line breaks. Each character within a paragraph has its own attributes, for example, font and color. <p> The text edit documentation uses the following concepts: <ul> <li> <em>current format</em> -- this is the format at the current cursor position, <em>and</em> it is the format of the selected text if any. <li> <em>current paragraph</em> -- the paragraph which contains the cursor. </ul> <p> TQTextEdit can display images (using <a href="qmimesourcefactory.html">TQMimeSourceFactory</a>), lists and tables. If the text is too large to view within the text edit's viewport, scrollbars will appear. The text edit can load both plain text and HTML files (a subset of HTML 3.2 and 4). The rendering style and the set of valid tags are defined by a <a href="#styleSheet">styleSheet</a>(). Custom tags can be created and placed in a custom style sheet. Change the style sheet with <a href="#setStyleSheet">setStyleSheet</a>(); see <a href="ntqstylesheet.html">TQStyleSheet</a> for details. The images identified by image tags are displayed if they can be interpreted using the text edit's <a href="qmimesourcefactory.html">TQMimeSourceFactory</a>; see <a href="#setMimeSourceFactory">setMimeSourceFactory</a>(). <p> If you want a text browser with more navigation use <a href="ntqtextbrowser.html">TQTextBrowser</a>. If you just need to display a small piece of rich text use <a href="ntqlabel.html">TQLabel</a> or <a href="ntqsimplerichtext.html">TQSimpleRichText</a>. <p> If you create a new TQTextEdit, and want to allow the user to edit rich text, call <a href="#setTextFormat">setTextFormat</a>(TQt::RichText) to ensure that the text is treated as rich text. (Rich text uses HTML tags to set text formatting attributes. See TQStyleSheet for information on the HTML tags that are supported.). If you don't call setTextFormat() explicitly the text edit will guess from the text itself whether it is rich text or plain text. This means that if the text looks like HTML or XML it will probably be interpreted as rich text, so you should call setTextFormat(TQt::PlainText) to preserve such text. <p> Note that we do not intend to add a full-featured web browser widget to TQt (because that would easily double TQt's size and only a few applications would benefit from it). The rich text support in TQt is designed to provide a fast, portable and efficient way to add reasonable online help facilities to applications, and to provide a basis for rich text editors. <p> <h3> Using TQTextEdit as a Display Widget </h3> <a name="1-1"></a><p> TQTextEdit can display a large HTML subset, including tables and images. <p> The text is set or replaced using <a href="#setText">setText</a>() which deletes any existing text and replaces it with the text passed in the setText() call. If you call setText() with legacy HTML (with <a href="#setTextFormat">setTextFormat</a>(RichText) in force), and then call <a href="#text">text</a>(), the text that is returned may have different markup, but will render the same. Text can be inserted with <a href="#insert">insert</a>(), <a href="#paste">paste</a>(), <a href="#pasteSubType">pasteSubType</a>() and <a href="#append">append</a>(). Text that is appended does not go into the undo history; this makes append() faster and consumes less memory. Text can also be <a href="#cut">cut</a>(). The entire text is deleted with <a href="#clear">clear</a>() and the selected text is deleted with <a href="#removeSelectedText">removeSelectedText</a>(). Selected (marked) text can also be deleted with <a href="#del">del</a>() (which will delete the character to the right of the cursor if no text is selected). <p> Loading and saving text is achieved using <a href="#setText">setText</a>() and text(), for example: <pre> <a href="ntqfile.html">TQFile</a> file( fileName ); // Read the text from a file if ( file.<a href="ntqfile.html#open">open</a>( <a href="ntqfile.html#open">IO_ReadOnly</a> ) ) { <a href="ntqtextstream.html">TQTextStream</a> stream( &file ); textEdit->setText( stream.<a href="ntqtextstream.html#read">read</a>() ); } <a href="ntqfile.html">TQFile</a> file( fileName ); // Write the text to a file if ( file.<a href="ntqfile.html#open">open</a>( <a href="ntqfile.html#open">IO_WriteOnly</a> ) ) { <a href="ntqtextstream.html">TQTextStream</a> stream( &file ); stream << textEdit->text(); textEdit->setModified( FALSE ); } </pre> <p> By default the text edit wraps words at whitespace to fit within the text edit widget. The <a href="#setWordWrap">setWordWrap</a>() function is used to specify the kind of word wrap you want, or <a href="#WordWrap-enum">NoWrap</a> if you don't want any wrapping. Call setWordWrap() to set a fixed pixel width <a href="#WordWrap-enum">FixedPixelWidth</a>, or character column (e.g. 80 column) <a href="#WordWrap-enum">FixedColumnWidth</a> with the pixels or columns specified with <a href="#setWrapColumnOrWidth">setWrapColumnOrWidth</a>(). If you use word wrap to the widget's width <a href="#WordWrap-enum">WidgetWidth</a>, you can specify whether to break on whitespace or anywhere with <a href="#setWrapPolicy">setWrapPolicy</a>(). <p> The background color is set differently than other widgets, using <a href="#setPaper">setPaper</a>(). You specify a brush style which could be a plain color or a complex pixmap. <p> Hypertext links are automatically underlined; this can be changed with <a href="#setLinkUnderline">setLinkUnderline</a>(). The tab stop width is set with <a href="#setTabStopWidth">setTabStopWidth</a>(). <p> The <a href="#zoomIn">zoomIn</a>() and <a href="#zoomOut">zoomOut</a>() functions can be used to resize the text by increasing (decreasing for zoomOut()) the point size used. Images are not affected by the zoom functions. <p> The <a href="#lines">lines</a>() function returns the number of lines in the text and <a href="#paragraphs">paragraphs</a>() returns the number of paragraphs. The number of lines within a particular paragraph is returned by <a href="#linesOfParagraph">linesOfParagraph</a>(). The length of the entire text in characters is returned by <a href="#length">length</a>(). <p> You can scroll to an anchor in the text, e.g. <tt><a name="anchor"></tt> with <a href="#scrollToAnchor">scrollToAnchor</a>(). The <a href="#find">find</a>() function can be used to find and select a given string within the text. <p> A read-only TQTextEdit provides the same functionality as the (obsolete) TQTextView. (TQTextView is still supplied for compatibility with old code.) <p> <h4> Read-only key bindings </h4> <a name="1-1-1"></a><p> When TQTextEdit is used read-only the key-bindings are limited to navigation, and text may only be selected with the mouse: <center><table cellpadding="4" cellspacing="2" border="0"> <tr bgcolor="#a2c511"> <th valign="top">Keypresses <th valign="top">Action <tr bgcolor="#f0f0f0"> <td valign="top">UpArrow <td valign="top">Move one line up <tr bgcolor="#d0d0d0"> <td valign="top">DownArrow <td valign="top">Move one line down <tr bgcolor="#f0f0f0"> <td valign="top">LeftArrow <td valign="top">Move one character left <tr bgcolor="#d0d0d0"> <td valign="top">RightArrow <td valign="top">Move one character right <tr bgcolor="#f0f0f0"> <td valign="top">PageUp <td valign="top">Move one (viewport) page up <tr bgcolor="#d0d0d0"> <td valign="top">PageDown <td valign="top">Move one (viewport) page down <tr bgcolor="#f0f0f0"> <td valign="top">Home <td valign="top">Move to the beginning of the text <tr bgcolor="#d0d0d0"> <td valign="top">End <td valign="top">Move to the end of the text <tr bgcolor="#f0f0f0"> <td valign="top">Shift+Wheel <td valign="top">Scroll the page horizontally (the Wheel is the mouse wheel) <tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+Wheel <td valign="top">Zoom the text </table></center> <p> The text edit may be able to provide some meta-information. For example, the <a href="#documentTitle">documentTitle</a>() function will return the text from within HTML <tt><title></tt> tags. <p> The text displayed in a text edit has a <em>context</em>. The context is a path which the text edit's <a href="qmimesourcefactory.html">TQMimeSourceFactory</a> uses to resolve the locations of files and images. It is passed to the <a href="#mimeSourceFactory">mimeSourceFactory</a>() when quering data. (See TQTextEdit() and <a href="#context">context</a>().) <p> <a name="logtextmode"></a> <h4> Using TQTextEdit in LogText Mode </h4> <a name="1-1-2"></a><p> Setting the text format to <a href="ntqt.html#TextFormat-enum">LogText</a> puts the widget in a special mode which is optimized for very large texts. Editing, word wrap, and rich text support are disabled in this mode (the widget is explicitly made read-only). This allows the text to be stored in a different, more memory efficient manner. However, a certain degree of text formatting is supported through the use of formatting tags. A tag is delimited by <tt><</tt> and <tt>></tt>. The characters <tt><</tt>, <tt>></tt> and <tt>&</tt> are escaped by using <tt>&lt;</tt>, <tt>&gt;</tt> and <tt>&amp;</tt>. A tag pair consists of a left and a right tag (or open/close tags). Left-tags mark the starting point for formatting, while right-tags mark the ending point. A right-tag always start with a <tt>/</tt> before the tag keyword. For example <tt><b></tt> and <tt></b></tt> are a tag pair. Tags can be nested, but they have to be closed in the same order as they are opened. For example, <tt><b><u></u></b></tt> is valid, while <tt><b><u></b></u></tt> will output an error message. <p> By using tags it is possible to change the color, bold, italic and underline settings for a piece of text. A color can be specified by using the HTML font tag <tt><font color=colorname></tt>. The color name can be one of the color names from the X11 color database, or a RGB hex value (e.g <tt>#00ff00</tt>). Example of valid color tags: <tt><font color=red></tt>, <tt><font color="light blue"></tt>, <tt><font color="#223344"></tt>. Bold, italic and underline settings can be specified by the tags <tt><b></tt>, <tt><i></tt> and <tt><u></tt>. Note that a tag does not necessarily have to be closed. A valid example: <pre> This is <font color=red>red</font> while <b>this</b> is <font color=blue>blue</font>. <font color=green><font color=yellow>Yellow,</font> and <u>green</u>. </pre> <p> Stylesheets can also be used in LogText mode. To create and use a custom tag, you could do the following: <pre> TQTextEdit * log = new TQTextEdit( this ); log-><a href="#setTextFormat">setTextFormat</a>( TQt::<a href="ntqt.html#TextFormat-enum">LogText</a> ); <a href="qstylesheetitem.html">TQStyleSheetItem</a> * item = new <a href="qstylesheetitem.html">TQStyleSheetItem</a>( log-><a href="#styleSheet">styleSheet</a>(), "mytag" ); item-><a href="qstylesheetitem.html#setColor">setColor</a>( "red" ); item-><a href="qstylesheetitem.html#setFontWeight">setFontWeight</a>( TQFont::Bold ); item-><a href="qstylesheetitem.html#setFontUnderline">setFontUnderline</a>( TRUE ); log-><a href="#append">append</a>( "This is a <mytag>custom tag</mytag>!" ); </pre> Note that only the color, bold, underline and italic attributes of a <a href="qstylesheetitem.html">TQStyleSheetItem</a> is used in LogText mode. <p> Note that you can use <a href="#setMaxLogLines">setMaxLogLines</a>() to limit the number of lines the widget can hold in LogText mode. <p> There are a few things that you need to be aware of when the widget is in this mode: <ul> <li> Functions that deal with rich text formatting and cursor movement will not work or return anything valid. <li> Lines are equivalent to paragraphs. </ul> <p> <h3> Using TQTextEdit as an Editor </h3> <a name="1-2"></a><p> All the information about using TQTextEdit as a display widget also applies here. <p> The current format's attributes are set with <a href="#setItalic">setItalic</a>(), <a href="#setBold">setBold</a>(), <a href="#setUnderline">setUnderline</a>(), <a href="#setFamily">setFamily</a>() (font family), <a href="#setPointSize">setPointSize</a>(), <a href="#setColor">setColor</a>() and <a href="#setCurrentFont">setCurrentFont</a>(). The current paragraph's alignment is set with <a href="#setAlignment">setAlignment</a>(). <p> Use <a href="#setSelection">setSelection</a>() to select text. The <a href="#setSelectionAttributes">setSelectionAttributes</a>() function is used to indicate how selected text should be displayed. Use <a href="#hasSelectedText">hasSelectedText</a>() to find out if any text is selected. The currently selected text's position is available using <a href="#getSelection">getSelection</a>() and the selected text itself is returned by <a href="#selectedText">selectedText</a>(). The selection can be copied to the clipboard with <a href="#copy">copy</a>(), or cut to the clipboard with <a href="#cut">cut</a>(). It can be deleted with <a href="#removeSelectedText">removeSelectedText</a>(). The entire text can be selected (or unselected) using <a href="#selectAll">selectAll</a>(). TQTextEdit supports multiple selections. Most of the selection functions operate on the default selection, selection 0. If the user presses a non-selecting key, e.g. a cursor key without also holding down Shift, all selections are cleared. <p> Set and get the position of the cursor with <a href="#setCursorPosition">setCursorPosition</a>() and <a href="#getCursorPosition">getCursorPosition</a>() respectively. When the cursor is moved, the signals <a href="#currentFontChanged">currentFontChanged</a>(), <a href="#currentColorChanged">currentColorChanged</a>() and <a href="#currentAlignmentChanged">currentAlignmentChanged</a>() are emitted to reflect the font, color and alignment at the new cursor position. <p> If the text changes, the <a href="#textChanged">textChanged</a>() signal is emitted, and if the user inserts a new line by pressing Return or Enter, <a href="#returnPressed">returnPressed</a>() is emitted. The <a href="#isModified">isModified</a>() function will return TRUE if the text has been modified. <p> TQTextEdit provides command-based undo and redo. To set the depth of the command history use <a href="#setUndoDepth">setUndoDepth</a>() which defaults to 100 steps. To undo or redo the last operation call <a href="#undo">undo</a>() or <a href="#redo">redo</a>(). The signals <a href="#undoAvailable">undoAvailable</a>() and <a href="#redoAvailable">redoAvailable</a>() indicate whether the undo and redo operations can be executed. <p> The indent() function is used to reindent a paragraph. It is useful for code editors, for example in <a href="designer-manual.html">TQt Designer</a>'s code editor <em>Ctrl+I</em> invokes the indent() function. <p> <h4> Editing key bindings </h4> <a name="1-2-1"></a><p> The list of key-bindings which are implemented for editing: <center><table cellpadding="4" cellspacing="2" border="0"> <tr bgcolor="#a2c511"> <th valign="top">Keypresses <th valign="top">Action <tr bgcolor="#f0f0f0"> <td valign="top">Backspace <td valign="top">Delete the character to the left of the cursor <tr bgcolor="#d0d0d0"> <td valign="top">Delete <td valign="top">Delete the character to the right of the cursor <tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+A <td valign="top">Move the cursor to the beginning of the line <tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+B <td valign="top">Move the cursor one character left <tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+C <td valign="top">Copy the marked text to the clipboard (also Ctrl+Insert under Windows) <tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+D <td valign="top">Delete the character to the right of the cursor <tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+E <td valign="top">Move the cursor to the end of the line <tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+F <td valign="top">Move the cursor one character right <tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+H <td valign="top">Delete the character to the left of the cursor <tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+K <td valign="top">Delete to end of line <tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+N <td valign="top">Move the cursor one line down <tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+P <td valign="top">Move the cursor one line up <tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+V <td valign="top">Paste the clipboard text into line edit (also Shift+Insert under Windows) <tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+X <td valign="top">Cut the marked text, copy to clipboard (also Shift+Delete under Windows) <tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+Z <td valign="top">Undo the last operation <tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+Y <td valign="top">Redo the last operation <tr bgcolor="#f0f0f0"> <td valign="top">LeftArrow <td valign="top">Move the cursor one character left <tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+LeftArrow <td valign="top">Move the cursor one word left <tr bgcolor="#f0f0f0"> <td valign="top">RightArrow <td valign="top">Move the cursor one character right <tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+RightArrow <td valign="top">Move the cursor one word right <tr bgcolor="#f0f0f0"> <td valign="top">UpArrow <td valign="top">Move the cursor one line up <tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+UpArrow <td valign="top">Move the cursor one word up <tr bgcolor="#f0f0f0"> <td valign="top">DownArrow <td valign="top">Move the cursor one line down <tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+Down Arrow <td valign="top">Move the cursor one word down <tr bgcolor="#f0f0f0"> <td valign="top">PageUp <td valign="top">Move the cursor one page up <tr bgcolor="#d0d0d0"> <td valign="top">PageDown <td valign="top">Move the cursor one page down <tr bgcolor="#f0f0f0"> <td valign="top">Home <td valign="top">Move the cursor to the beginning of the line <tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+Home <td valign="top">Move the cursor to the beginning of the text <tr bgcolor="#f0f0f0"> <td valign="top">End <td valign="top">Move the cursor to the end of the line <tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+End <td valign="top">Move the cursor to the end of the text <tr bgcolor="#f0f0f0"> <td valign="top">Shift+Wheel <td valign="top">Scroll the page horizontally (the Wheel is the mouse wheel) <tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+Wheel <td valign="top">Zoom the text </table></center> <p> To select (mark) text hold down the Shift key whilst pressing one of the movement keystrokes, for example, <em>Shift+Right Arrow</em> will select the character to the right, and <em>Shift+Ctrl+Right Arrow</em> will select the word to the right, etc. <p> By default the text edit widget operates in insert mode so all text that the user enters is inserted into the text edit and any text to the right of the cursor is moved out of the way. The mode can be changed to overwrite, where new text overwrites any text to the right of the cursor, using <a href="#setOverwriteMode">setOverwriteMode</a>(). <p>See also <a href="basic.html">Basic Widgets</a> and <a href="text.html">Text Related Classes</a>. <hr><h2>Member Type Documentation</h2> <h3 class=fn><a name="AutoFormatting-enum"></a>TQTextEdit::AutoFormatting</h3> <ul> <li><tt>TQTextEdit::AutoNone</tt> - Do not perform any automatic formatting <li><tt>TQTextEdit::AutoBulletList</tt> - Only automatically format bulletted lists <li><tt>TQTextEdit::AutoAll</tt> - Apply all available autoformatting </ul> <h3 class=fn><a name="CursorAction-enum"></a>TQTextEdit::CursorAction</h3> <p> This enum is used by <a href="#moveCursor">moveCursor</a>() to specify in which direction the cursor should be moved: <ul> <li><tt>TQTextEdit::MoveBackward</tt> - Moves the cursor one character backward <li><tt>TQTextEdit::MoveWordBackward</tt> - Moves the cursor one word backward <li><tt>TQTextEdit::MoveForward</tt> - Moves the cursor one character forward <li><tt>TQTextEdit::MoveWordForward</tt> - Moves the cursor one word forward <li><tt>TQTextEdit::MoveUp</tt> - Moves the cursor up one line <li><tt>TQTextEdit::MoveDown</tt> - Moves the cursor down one line <li><tt>TQTextEdit::MoveLineStart</tt> - Moves the cursor to the beginning of the line <li><tt>TQTextEdit::MoveLineEnd</tt> - Moves the cursor to the end of the line <li><tt>TQTextEdit::MoveHome</tt> - Moves the cursor to the beginning of the document <li><tt>TQTextEdit::MoveEnd</tt> - Moves the cursor to the end of the document <li><tt>TQTextEdit::MovePgUp</tt> - Moves the cursor one viewport page up <li><tt>TQTextEdit::MovePgDown</tt> - Moves the cursor one viewport page down </ul> <h3 class=fn><a name="KeyboardAction-enum"></a>TQTextEdit::KeyboardAction</h3> <p> This enum is used by <a href="#doKeyboardAction">doKeyboardAction</a>() to specify which action should be executed: <ul> <li><tt>TQTextEdit::ActionBackspace</tt> - Delete the character to the left of the cursor. <li><tt>TQTextEdit::ActionDelete</tt> - Delete the character to the right of the cursor. <li><tt>TQTextEdit::ActionReturn</tt> - Split the paragraph at the cursor position. <li><tt>TQTextEdit::ActionKill</tt> - If the cursor is not at the end of the paragraph, delete the text from the cursor position until the end of the paragraph. If the cursor is at the end of the paragraph, delete the hard line break at the end of the paragraph: this will cause this paragraph to be joined with the following paragraph. <li><tt>TQTextEdit::ActionWordBackspace</tt> - Delete the word to the left of the cursor position. <li><tt>TQTextEdit::ActionWordDelete</tt> - Delete the word to the right of the cursor position </ul><p> <h3 class=fn><a name="VerticalAlignment-enum"></a>TQTextEdit::VerticalAlignment</h3> <p> This enum is used to set the vertical alignment of the text. <ul> <li><tt>TQTextEdit::AlignNormal</tt> - Normal alignment <li><tt>TQTextEdit::AlignSuperScript</tt> - Superscript <li><tt>TQTextEdit::AlignSubScript</tt> - Subscript </ul> <h3 class=fn><a name="WordWrap-enum"></a>TQTextEdit::WordWrap</h3> <p> This enum defines the TQTextEdit's word wrap modes. <ul> <li><tt>TQTextEdit::NoWrap</tt> - Do not wrap the text. <li><tt>TQTextEdit::WidgetWidth</tt> - Wrap the text at the current width of the widget (this is the default). Wrapping is at whitespace by default; this can be changed with <a href="#setWrapPolicy">setWrapPolicy</a>(). <li><tt>TQTextEdit::FixedPixelWidth</tt> - Wrap the text at a fixed number of pixels from the widget's left side. The number of pixels is set with <a href="#wrapColumnOrWidth">wrapColumnOrWidth</a>(). <li><tt>TQTextEdit::FixedColumnWidth</tt> - Wrap the text at a fixed number of character columns from the widget's left side. The number of characters is set with wrapColumnOrWidth(). This is useful if you need formatted text that can also be displayed gracefully on devices with monospaced fonts, for example a standard VT100 terminal, where you might set wrapColumnOrWidth() to 80. </ul><p> <p>See also <a href="#wordWrap-prop">wordWrap</a> and <a href="#wordWrap-prop">wordWrap</a>. <h3 class=fn><a name="WrapPolicy-enum"></a>TQTextEdit::WrapPolicy</h3> <p> This enum defines where text can be wrapped in word wrap mode. <ul> <li><tt>TQTextEdit::AtWhiteSpace</tt> - Don't use this deprecated value (it is a synonym for <a href="#WrapPolicy-enum">AtWordBoundary</a> which you should use instead). <li><tt>TQTextEdit::Anywhere</tt> - Break anywhere, including within words. <li><tt>TQTextEdit::AtWordBoundary</tt> - Break lines at word boundaries, e.g. spaces or newlines <li><tt>TQTextEdit::AtWordOrDocumentBoundary</tt> - Break lines at whitespace, e.g. spaces or newlines if possible. Break it anywhere otherwise. </ul><p> <p>See also <a href="#wrapPolicy-prop">wrapPolicy</a>. <hr><h2>Member Function Documentation</h2> <h3 class=fn><a name="TQTextEdit"></a>TQTextEdit::TQTextEdit ( const <a href="ntqstring.html">TQString</a> & text, const <a href="ntqstring.html">TQString</a> & context = TQString::null, <a href="ntqwidget.html">TQWidget</a> * parent = 0, const char * name = 0 ) </h3> Constructs a TQTextEdit called <em>name</em>, with parent <em>parent</em>. The text edit will display the text <em>text</em> using context <em>context</em>. <p> The <em>context</em> is a path which the text edit's <a href="qmimesourcefactory.html">TQMimeSourceFactory</a> uses to resolve the locations of files and images. It is passed to the <a href="#mimeSourceFactory">mimeSourceFactory</a>() when quering data. <p> For example if the text contains an image tag, <tt><img src="image.png"></tt>, and the context is "path/to/look/in", the TQMimeSourceFactory will try to load the image from "path/to/look/in/image.png". If the tag was <tt><img src="/image.png"></tt>, the context will not be used (because TQMimeSourceFactory recognizes that we have used an absolute path) and will try to load "/image.png". The context is applied in exactly the same way to <em>hrefs</em>, for example, <tt><a href="target.html">Target</a></tt>, would resolve to "path/to/look/in/target.html". <h3 class=fn><a name="TQTextEdit-2"></a>TQTextEdit::TQTextEdit ( <a href="ntqwidget.html">TQWidget</a> * parent = 0, const char * name = 0 ) </h3> Constructs an empty TQTextEdit called <em>name</em>, with parent <em>parent</em>. <h3 class=fn>int <a name="alignment"></a>TQTextEdit::alignment () const </h3> Returns the alignment of the current paragraph. <p> <p>See also <a href="#setAlignment">setAlignment</a>(). <h3 class=fn><a href="ntqstring.html">TQString</a> <a name="anchorAt"></a>TQTextEdit::anchorAt ( const <a href="ntqpoint.html">TQPoint</a> & pos, <a href="ntqt.html#AnchorAttribute-enum">AnchorAttribute</a> attr ) </h3> If there is an anchor at position <em>pos</em> (in contents coordinates), the text for attribute <em>attr</em> is returned, otherwise <a href="ntqstring.html#TQString-null">TQString::null</a> is returned. <h3 class=fn><a href="ntqstring.html">TQString</a> <a name="anchorAt-2"></a>TQTextEdit::anchorAt ( const <a href="ntqpoint.html">TQPoint</a> & pos ) </h3> This is an overloaded member function, provided for convenience. It behaves essentially like the above function. <p> If there is an anchor at position <em>pos</em> (in contents coordinates), its <tt>href</tt> is returned, otherwise <a href="ntqstring.html#TQString-null">TQString::null</a> is returned. <h3 class=fn>void <a name="append"></a>TQTextEdit::append ( const <a href="ntqstring.html">TQString</a> & text )<tt> [virtual slot]</tt> </h3> Appends a new paragraph with <em>text</em> to the end of the text edit. Note that the undo/redo history is cleared by this function, and no undo history is kept for appends which makes them faster than <a href="#insert">insert</a>()s. If you want to append text which is added to the undo/redo history as well, use <a href="#insertParagraph">insertParagraph</a>(). <p>Examples: <a href="clientserver-example.html#x805">network/clientserver/client/client.cpp</a>, <a href="clientserver-example.html#x786">network/clientserver/server/server.cpp</a>, <a href="httpd-example.html#x734">network/httpd/httpd.cpp</a>, and <a href="process-example.html#x103">process/process.cpp</a>. <h3 class=fn>uint <a name="autoFormatting"></a>TQTextEdit::autoFormatting () const </h3><p>Returns the enabled set of auto formatting features. See the <a href="ntqtextedit.html#autoFormatting-prop">"autoFormatting"</a> property for details. <h3 class=fn>bool <a name="bold"></a>TQTextEdit::bold () const </h3> Returns TRUE if the current format is bold; otherwise returns FALSE. <p> <p>See also <a href="#setBold">setBold</a>(). <h3 class=fn>int <a name="charAt"></a>TQTextEdit::charAt ( const <a href="ntqpoint.html">TQPoint</a> & pos, int * para ) const </h3> Returns the index of the character (relative to its paragraph) at position <em>pos</em> (in contents coordinates). If <em>para</em> is not 0, <em>*para</em> is set to the character's paragraph. <h3 class=fn>void <a name="clear"></a>TQTextEdit::clear ()<tt> [virtual slot]</tt> </h3> Deletes all the text in the text edit. <p> <p>See also <a href="#cut">cut</a>(), <a href="#removeSelectedText">removeSelectedText</a>(), and <a href="#text-prop">text</a>. <h3 class=fn>void <a name="clearParagraphBackground"></a>TQTextEdit::clearParagraphBackground ( int para )<tt> [virtual slot]</tt> </h3> Clears the background color of the paragraph <em>para</em>, so that the default color is used again. <h3 class=fn>void <a name="clicked"></a>TQTextEdit::clicked ( int para, int pos )<tt> [signal]</tt> </h3> <p> This signal is emitted when the mouse is clicked on the paragraph <em>para</em> at character position <em>pos</em>. <p> <p>See also <a href="#doubleClicked">doubleClicked</a>(). <h3 class=fn><a href="ntqcolor.html">TQColor</a> <a name="color"></a>TQTextEdit::color () const </h3> Returns the color of the current format. <p> <p>See also <a href="#setColor">setColor</a>() and <a href="#paper-prop">paper</a>. <h3 class=fn><a href="ntqstring.html">TQString</a> <a name="context"></a>TQTextEdit::context () const </h3> Returns the context of the text edit. The context is a path which the text edit's <a href="qmimesourcefactory.html">TQMimeSourceFactory</a> uses to resolve the locations of files and images. <p> <p>See also <a href="#text-prop">text</a>. <p>Examples: <a href="qaction-application-example.html#x1164">action/application.cpp</a>, <a href="simple-application-example.html#x1582">application/application.cpp</a>, <a href="helpviewer-example.html#x1028">helpviewer/helpwindow.cpp</a>, <a href="mdi-example.html#x2068">mdi/application.cpp</a>, and <a href="qdir-example.html#x1843">qdir/qdir.cpp</a>. <h3 class=fn>void <a name="copy"></a>TQTextEdit::copy ()<tt> [virtual slot]</tt> </h3> Copies any selected text (from selection 0) to the clipboard. <p> <p>See also <a href="#hasSelectedText-prop">hasSelectedText</a> and <a href="#copyAvailable">copyAvailable</a>(). <h3 class=fn>void <a name="copyAvailable"></a>TQTextEdit::copyAvailable ( bool yes )<tt> [signal]</tt> </h3> <p> This signal is emitted when text is selected or de-selected in the text edit. <p> When text is selected this signal will be emitted with <em>yes</em> set to TRUE. If no text has been selected or if the selected text is de-selected this signal is emitted with <em>yes</em> set to FALSE. <p> If <em>yes</em> is TRUE then <a href="#copy">copy</a>() can be used to copy the selection to the clipboard. If <em>yes</em> is FALSE then copy() does nothing. <p> <p>See also <a href="#selectionChanged">selectionChanged</a>(). <h3 class=fn><a href="ntqpopupmenu.html">TQPopupMenu</a> * <a name="createPopupMenu"></a>TQTextEdit::createPopupMenu ( const <a href="ntqpoint.html">TQPoint</a> & pos )<tt> [virtual protected]</tt> </h3> This function is called to create a right mouse button popup menu at the document position <em>pos</em>. If you want to create a custom popup menu, reimplement this function and return the created popup menu. Ownership of the popup menu is transferred to the caller. <p> <b>Warning:</b> The <a href="ntqpopupmenu.html">TQPopupMenu</a> ID values 0-7 are reserved, and they map to the standard operations. When inserting items into your custom popup menu, be sure to specify ID values larger than 7. <h3 class=fn><a href="ntqpopupmenu.html">TQPopupMenu</a> * <a name="createPopupMenu-2"></a>TQTextEdit::createPopupMenu ()<tt> [virtual protected]</tt> </h3> This is an overloaded member function, provided for convenience. It behaves essentially like the above function. <p> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code. <p> This function is called to create a right mouse button popup menu. If you want to create a custom popup menu, reimplement this function and return the created popup menu. Ownership of the popup menu is transferred to the caller. <p> This function is only called if <a href="#createPopupMenu">createPopupMenu</a>( const <a href="ntqpoint.html">TQPoint</a> & ) returns 0. <h3 class=fn>void <a name="currentAlignmentChanged"></a>TQTextEdit::currentAlignmentChanged ( int a )<tt> [signal]</tt> </h3> <p> This signal is emitted if the alignment of the current paragraph has changed. <p> The new alignment is <em>a</em>. <p> <p>See also <a href="#setAlignment">setAlignment</a>(). <h3 class=fn>void <a name="currentColorChanged"></a>TQTextEdit::currentColorChanged ( const <a href="ntqcolor.html">TQColor</a> & c )<tt> [signal]</tt> </h3> <p> This signal is emitted if the color of the current format has changed. <p> The new color is <em>c</em>. <p> <p>See also <a href="#setColor">setColor</a>(). <h3 class=fn><a href="ntqfont.html">TQFont</a> <a name="currentFont"></a>TQTextEdit::currentFont () const </h3> Returns the font of the current format. <p> <p>See also <a href="#setCurrentFont">setCurrentFont</a>(), <a href="#setFamily">setFamily</a>(), and <a href="#setPointSize">setPointSize</a>(). <h3 class=fn>void <a name="currentFontChanged"></a>TQTextEdit::currentFontChanged ( const <a href="ntqfont.html">TQFont</a> & f )<tt> [signal]</tt> </h3> <p> This signal is emitted if the font of the current format has changed. <p> The new font is <em>f</em>. <p> <p>See also <a href="#setCurrentFont">setCurrentFont</a>(). <h3 class=fn>void <a name="currentVerticalAlignmentChanged"></a>TQTextEdit::currentVerticalAlignmentChanged ( <a href="ntqtextedit.html#VerticalAlignment-enum">VerticalAlignment</a> a )<tt> [signal]</tt> </h3> <p> This signal is emitted if the vertical alignment of the current format has changed. <p> The new vertical alignment is <em>a</em>. <p> <p>See also <a href="#setVerticalAlignment">setVerticalAlignment</a>(). <h3 class=fn>void <a name="cursorPositionChanged"></a>TQTextEdit::cursorPositionChanged ( int para, int pos )<tt> [signal]</tt> </h3> <p> This signal is emitted if the position of the cursor has changed. <em>para</em> contains the paragraph index and <em>pos</em> contains the character position within the paragraph. <p> <p>See also <a href="#setCursorPosition">setCursorPosition</a>(). <h3 class=fn>void <a name="cut"></a>TQTextEdit::cut ()<tt> [virtual slot]</tt> </h3> Copies the selected text (from selection 0) to the clipboard and deletes it from the text edit. <p> If there is no selected text (in selection 0) nothing happens. <p> <p>See also <a href="#copy">TQTextEdit::copy</a>(), <a href="#paste">paste</a>(), and <a href="#pasteSubType">pasteSubType</a>(). <h3 class=fn>void <a name="del"></a>TQTextEdit::del ()<tt> [virtual slot]</tt> </h3> If there is some selected text (in selection 0) it is deleted. If there is no selected text (in selection 0) the character to the right of the text cursor is deleted. <p> <p>See also <a href="#removeSelectedText">removeSelectedText</a>() and <a href="#cut">cut</a>(). <h3 class=fn>void <a name="doKeyboardAction"></a>TQTextEdit::doKeyboardAction ( <a href="ntqtextedit.html#KeyboardAction-enum">KeyboardAction</a> action )<tt> [virtual slot]</tt> </h3> Executes keyboard action <em>action</em>. This is normally called by a key event handler. <h3 class=fn><a href="ntqstring.html">TQString</a> <a name="documentTitle"></a>TQTextEdit::documentTitle () const </h3><p>Returns the title of the document parsed from the text. See the <a href="ntqtextedit.html#documentTitle-prop">"documentTitle"</a> property for details. <h3 class=fn>void <a name="doubleClicked"></a>TQTextEdit::doubleClicked ( int para, int pos )<tt> [signal]</tt> </h3> <p> This signal is emitted when the mouse is double-clicked on the paragraph <em>para</em> at character position <em>pos</em>. <p> <p>See also <a href="#clicked">clicked</a>(). <h3 class=fn>void <a name="ensureCursorVisible"></a>TQTextEdit::ensureCursorVisible ()<tt> [virtual slot]</tt> </h3> Ensures that the cursor is visible by scrolling the text edit if necessary. <p> <p>See also <a href="#setCursorPosition">setCursorPosition</a>(). <h3 class=fn><a href="ntqstring.html">TQString</a> <a name="family"></a>TQTextEdit::family () const </h3> Returns the font family of the current format. <p> <p>See also <a href="#setFamily">setFamily</a>(), <a href="#setCurrentFont">setCurrentFont</a>(), and <a href="#setPointSize">setPointSize</a>(). <h3 class=fn>bool <a name="find"></a>TQTextEdit::find ( const <a href="ntqstring.html">TQString</a> & expr, bool cs, bool wo, bool forward = TRUE, int * para = 0, int * index = 0 )<tt> [virtual]</tt> </h3> Finds the next occurrence of the string, <em>expr</em>. Returns TRUE if <em>expr</em> was found; otherwise returns FALSE. <p> If <em>para</em> and <em>index</em> are both 0 the search begins from the current cursor position. If <em>para</em> and <em>index</em> are both not 0, the search begins from the <em>*index</em> character position in the <em>*para</em> paragraph. <p> If <em>cs</em> is TRUE the search is case sensitive, otherwise it is case insensitive. If <em>wo</em> is TRUE the search looks for whole word matches only; otherwise it searches for any matching text. If <em>forward</em> is TRUE (the default) the search works forward from the starting position to the end of the text, otherwise it works backwards to the beginning of the text. <p> If <em>expr</em> is found the function returns TRUE. If <em>index</em> and <em>para</em> are not 0, the number of the paragraph in which the first character of the match was found is put into <em>*para</em>, and the index position of that character within the paragraph is put into <em>*index</em>. <p> If <em>expr</em> is not found the function returns FALSE. If <em>index</em> and <em>para</em> are not 0 and <em>expr</em> is not found, <em>*index</em> and <em>*para</em> are undefined. <p> Please note that this function will make the next occurrence of the string (if found) the current selection, and will thus modify the cursor position. <p> Using the <em>para</em> and <em>index</em> parameters will not work correctly in case the document contains tables. <h3 class=fn>bool <a name="focusNextPrevChild"></a>TQTextEdit::focusNextPrevChild ( bool n )<tt> [virtual protected]</tt> </h3> Reimplemented to allow tabbing through links. If <em>n</em> is TRUE the tab moves the focus to the next child; if <em>n</em> is FALSE the tab moves the focus to the previous child. Returns TRUE if the focus was moved; otherwise returns FALSE. <h3 class=fn><a href="ntqfont.html">TQFont</a> <a name="font"></a>TQTextEdit::font () const </h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code. <p> Returns <a href="ntqwidget.html#font">TQScrollView::font</a>() <p> <b>Warning:</b> In previous versions this function returned the font of the current format. This lead to confusion. Please use <a href="#currentFont">currentFont</a>() instead. <p>Example: <a href="qwerty-example.html#x396">qwerty/qwerty.cpp</a>. <h3 class=fn>void <a name="getCursorPosition"></a>TQTextEdit::getCursorPosition ( int * para, int * index ) const </h3> This function sets the <em>*para</em> and <em>*index</em> parameters to the current cursor position. <em>para</em> and <em>index</em> must not be 0. <p> <p>See also <a href="#setCursorPosition">setCursorPosition</a>(). <h3 class=fn>void <a name="getSelection"></a>TQTextEdit::getSelection ( int * paraFrom, int * indexFrom, int * paraTo, int * indexTo, int selNum = 0 ) const </h3> If there is a selection, <em>*paraFrom</em> is set to the number of the paragraph in which the selection begins and <em>*paraTo</em> is set to the number of the paragraph in which the selection ends. (They could be the same.) <em>*indexFrom</em> is set to the index at which the selection begins within <em>*paraFrom</em>, and <em>*indexTo</em> is set to the index at which the selection ends within <em>*paraTo</em>. <p> If there is no selection, <em>*paraFrom</em>, <em>*indexFrom</em>, <em>*paraTo</em> and <em>*indexTo</em> are all set to -1. <p> If <em>paraFrom</em>, <em>indexFrom</em>, <em>paraTo</em> or <em>indexTo</em> is 0 this function does nothing. <p> The <em>selNum</em> is the number of the selection (multiple selections are supported). It defaults to 0 (the default selection). <p> <p>See also <a href="#setSelection">setSelection</a>() and <a href="#selectedText-prop">selectedText</a>. <h3 class=fn>bool <a name="hasSelectedText"></a>TQTextEdit::hasSelectedText () const </h3><p>Returns TRUE if some text is selected in selection 0; otherwise returns FALSE. See the <a href="ntqtextedit.html#hasSelectedText-prop">"hasSelectedText"</a> property for details. <h3 class=fn>int <a name="heightForWidth"></a>TQTextEdit::heightForWidth ( int w ) const<tt> [virtual]</tt> </h3> Returns how many pixels high the text edit needs to be to display all the text if the text edit is <em>w</em> pixels wide. <p>Reimplemented from <a href="ntqwidget.html#heightForWidth">TQWidget</a>. <h3 class=fn>void <a name="insert"></a>TQTextEdit::insert ( const <a href="ntqstring.html">TQString</a> & text, uint insertionFlags = CheckNewLines | RemoveSelected )<tt> [slot]</tt> </h3> Inserts <em>text</em> at the current cursor position. <p> The <em>insertionFlags</em> define how the text is inserted. If <a href="#TextInsertionFlags-enum">RedoIndentation</a> is set, the paragraph is re-indented. If <a href="#TextInsertionFlags-enum">CheckNewLines</a> is set, newline characters in <em>text</em> result in hard line breaks (i.e. new paragraphs). If <tt>checkNewLine</tt> is not set, the behaviour of the editor is undefined if the <em>text</em> contains newlines. (It is not possible to change TQTextEdit's newline handling behavior, but you can use <a href="ntqstring.html#replace">TQString::replace</a>() to preprocess text before inserting it.) If <a href="#TextInsertionFlags-enum">RemoveSelected</a> is set, any selected text (in selection 0) is removed before the text is inserted. <p> The default flags are <a href="#TextInsertionFlags-enum">CheckNewLines</a> | <a href="#TextInsertionFlags-enum">RemoveSelected</a>. <p> If the widget is in <a href="ntqt.html#TextFormat-enum">LogText</a> mode this function will do nothing. <p> <p>See also <a href="#paste">paste</a>() and <a href="#pasteSubType">pasteSubType</a>(). <h3 class=fn>void <a name="insert-2"></a>TQTextEdit::insert ( const <a href="ntqstring.html">TQString</a> & text, bool indent, bool checkNewLine = TRUE, bool removeSelected = TRUE )<tt> [virtual slot]</tt> </h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code. <p> <h3 class=fn>void <a name="insertAt"></a>TQTextEdit::insertAt ( const <a href="ntqstring.html">TQString</a> & text, int para, int index )<tt> [virtual slot]</tt> </h3> Inserts <em>text</em> in the paragraph <em>para</em> at position <em>index</em>. <h3 class=fn>void <a name="insertParagraph"></a>TQTextEdit::insertParagraph ( const <a href="ntqstring.html">TQString</a> & text, int para )<tt> [virtual slot]</tt> </h3> Inserts <em>text</em> as a new paragraph at position <em>para</em>. If <em>para</em> is -1, the text is appended. Use <a href="#append">append</a>() if the append operation is performance critical. <h3 class=fn>bool <a name="isModified"></a>TQTextEdit::isModified () const </h3><p>Returns TRUE if the document has been modified by the user; otherwise returns FALSE. See the <a href="ntqtextedit.html#modified-prop">"modified"</a> property for details. <h3 class=fn>bool <a name="isOverwriteMode"></a>TQTextEdit::isOverwriteMode () const </h3><p>Returns the text edit's overwrite mode. See the <a href="ntqtextedit.html#overwriteMode-prop">"overwriteMode"</a> property for details. <h3 class=fn>bool <a name="isReadOnly"></a>TQTextEdit::isReadOnly () const </h3><p>Returns TRUE if the text edit is read-only; otherwise returns FALSE. See the <a href="ntqtextedit.html#readOnly-prop">"readOnly"</a> property for details. <h3 class=fn>bool <a name="isRedoAvailable"></a>TQTextEdit::isRedoAvailable () const </h3> Returns TRUE if redo is available; otherwise returns FALSE. <h3 class=fn>bool <a name="isUndoAvailable"></a>TQTextEdit::isUndoAvailable () const </h3> Returns TRUE if undo is available; otherwise returns FALSE. <h3 class=fn>bool <a name="isUndoRedoEnabled"></a>TQTextEdit::isUndoRedoEnabled () const </h3><p>Returns TRUE if undo/redo is enabled; otherwise returns FALSE. See the <a href="ntqtextedit.html#undoRedoEnabled-prop">"undoRedoEnabled"</a> property for details. <h3 class=fn>bool <a name="italic"></a>TQTextEdit::italic () const </h3> Returns TRUE if the current format is italic; otherwise returns FALSE. <p> <p>See also <a href="#setItalic">setItalic</a>(). <h3 class=fn>void <a name="keyPressEvent"></a>TQTextEdit::keyPressEvent ( <a href="qkeyevent.html">TQKeyEvent</a> * e )<tt> [virtual protected]</tt> </h3> Processes the key event, <em>e</em>. By default key events are used to provide keyboard navigation and text editing. <p>Reimplemented from <a href="ntqwidget.html#keyPressEvent">TQWidget</a>. <p>Reimplemented in <a href="ntqtextbrowser.html#keyPressEvent">TQTextBrowser</a>. <h3 class=fn>int <a name="length"></a>TQTextEdit::length () const </h3><p>Returns the number of characters in the text. See the <a href="ntqtextedit.html#length-prop">"length"</a> property for details. <h3 class=fn>int <a name="lineOfChar"></a>TQTextEdit::lineOfChar ( int para, int index ) </h3> Returns the line number of the line in paragraph <em>para</em> in which the character at position <em>index</em> appears. The <em>index</em> position is relative to the beginning of the paragraph. If there is no such paragraph or no such character at the <em>index</em> position (e.g. the index is out of range) -1 is returned. <h3 class=fn>int <a name="lines"></a>TQTextEdit::lines () const </h3> Returns the number of lines in the text edit; this could be 0. <p> <b>Warning:</b> This function may be slow. Lines change all the time during word wrapping, so this function has to iterate over all the paragraphs and get the number of lines from each one individually. <h3 class=fn>int <a name="linesOfParagraph"></a>TQTextEdit::linesOfParagraph ( int para ) const </h3> Returns the number of lines in paragraph <em>para</em>, or -1 if there is no paragraph with index <em>para</em>. <h3 class=fn>bool <a name="linkUnderline"></a>TQTextEdit::linkUnderline () const </h3><p>Returns TRUE if hypertext links will be underlined; otherwise returns FALSE. See the <a href="ntqtextedit.html#linkUnderline-prop">"linkUnderline"</a> property for details. <h3 class=fn>int <a name="maxLogLines"></a>TQTextEdit::maxLogLines ()<tt> [slot]</tt> </h3> Returns the maximum number of lines TQTextEdit can hold in <a href="ntqt.html#TextFormat-enum">LogText</a> mode. By default the number of lines is unlimited, which is signified by a value of -1. <h3 class=fn><a href="qmimesourcefactory.html">TQMimeSourceFactory</a> * <a name="mimeSourceFactory"></a>TQTextEdit::mimeSourceFactory () const </h3> Returns the <a href="qmimesourcefactory.html">TQMimeSourceFactory</a> which is being used by this text edit. <p> <p>See also <a href="#setMimeSourceFactory">setMimeSourceFactory</a>(). <p>Examples: <a href="qaction-application-example.html#x1166">action/application.cpp</a>, <a href="simple-application-example.html#x1584">application/application.cpp</a>, <a href="helpviewer-example.html#x1030">helpviewer/helpwindow.cpp</a>, <a href="mdi-example.html#x2070">mdi/application.cpp</a>, and <a href="qdir-example.html#x1844">qdir/qdir.cpp</a>. <h3 class=fn>void <a name="modificationChanged"></a>TQTextEdit::modificationChanged ( bool m )<tt> [signal]</tt> </h3> <p> This signal is emitted when the modification status of the document has changed. If <em>m</em> is TRUE, the document was modified, otherwise the modification state has been reset to unmodified. <p> <p>See also <a href="#modified-prop">modified</a>. <h3 class=fn>void <a name="moveCursor"></a>TQTextEdit::moveCursor ( <a href="ntqtextedit.html#CursorAction-enum">CursorAction</a> action, bool select )<tt> [virtual slot]</tt> </h3> Moves the text cursor according to <em>action</em>. This is normally used by some key event handler. <em>select</em> specifies whether the text between the current cursor position and the new position should be selected. <h3 class=fn><a href="ntqbrush.html">TQBrush</a> <a name="paper"></a>TQTextEdit::paper () const </h3><p>Returns the background (paper) brush. See the <a href="ntqtextedit.html#paper-prop">"paper"</a> property for details. <h3 class=fn>int <a name="paragraphAt"></a>TQTextEdit::paragraphAt ( const <a href="ntqpoint.html">TQPoint</a> & pos ) const </h3> Returns the paragraph which is at position <em>pos</em> (in contents coordinates). <h3 class=fn><a href="ntqcolor.html">TQColor</a> <a name="paragraphBackgroundColor"></a>TQTextEdit::paragraphBackgroundColor ( int para ) const </h3> Returns the background color of the paragraph <em>para</em> or an invalid color if <em>para</em> is out of range or the paragraph has no background set <h3 class=fn>int <a name="paragraphLength"></a>TQTextEdit::paragraphLength ( int para ) const </h3> Returns the length of the paragraph <em>para</em> (i.e. the number of characters), or -1 if there is no paragraph with index <em>para</em>. <p> This function ignores newlines. <h3 class=fn><a href="ntqrect.html">TQRect</a> <a name="paragraphRect"></a>TQTextEdit::paragraphRect ( int para ) const </h3> Returns the rectangle of the paragraph <em>para</em> in contents coordinates, or an invalid rectangle if <em>para</em> is out of range. <h3 class=fn>int <a name="paragraphs"></a>TQTextEdit::paragraphs () const </h3> Returns the number of paragraphs in the text; an empty textedit is always considered to have one paragraph, so 1 is returned in this case. <h3 class=fn>void <a name="paste"></a>TQTextEdit::paste ()<tt> [virtual slot]</tt> </h3> Pastes the text from the clipboard into the text edit at the current cursor position. Only plain text is pasted. <p> If there is no text in the clipboard nothing happens. <p> <p>See also <a href="#pasteSubType">pasteSubType</a>(), <a href="#cut">cut</a>(), and <a href="#copy">TQTextEdit::copy</a>(). <h3 class=fn>void <a name="pasteSubType"></a>TQTextEdit::pasteSubType ( const <a href="ntqcstring.html">TQCString</a> & subtype )<tt> [virtual slot]</tt> </h3> Pastes the text with format <em>subtype</em> from the clipboard into the text edit at the current cursor position. The <em>subtype</em> can be "plain" or "html". <p> If there is no text with format <em>subtype</em> in the clipboard nothing happens. <p> <p>See also <a href="#paste">paste</a>(), <a href="#cut">cut</a>(), and <a href="#copy">TQTextEdit::copy</a>(). <h3 class=fn>void <a name="placeCursor"></a>TQTextEdit::placeCursor ( const <a href="ntqpoint.html">TQPoint</a> & pos, TQTextCursor * c = 0 )<tt> [virtual slot]</tt> </h3> Places the cursor <em>c</em> at the character which is closest to position <em>pos</em> (in contents coordinates). If <em>c</em> is 0, the default text cursor is used. <p> <p>See also <a href="#setCursorPosition">setCursorPosition</a>(). <h3 class=fn>int <a name="pointSize"></a>TQTextEdit::pointSize () const </h3> Returns the point size of the font of the current format. <p> <p>See also <a href="#setFamily">setFamily</a>(), <a href="#setCurrentFont">setCurrentFont</a>(), and <a href="#setPointSize">setPointSize</a>(). <h3 class=fn>void <a name="redo"></a>TQTextEdit::redo ()<tt> [virtual slot]</tt> </h3> Redoes the last operation. <p> If there is no operation to redo, i.e. there is no redo step in the undo/redo history, nothing happens. <p> <p>See also <a href="#redoAvailable">redoAvailable</a>(), <a href="#undo">undo</a>(), and <a href="#undoDepth-prop">undoDepth</a>. <h3 class=fn>void <a name="redoAvailable"></a>TQTextEdit::redoAvailable ( bool yes )<tt> [signal]</tt> </h3> <p> This signal is emitted when the availability of redo changes. If <em>yes</em> is TRUE, then <a href="#redo">redo</a>() will work until <a href="#redoAvailable">redoAvailable</a>( FALSE ) is next emitted. <p> <p>See also <a href="#redo">redo</a>() and <a href="#undoDepth-prop">undoDepth</a>. <h3 class=fn>void <a name="removeParagraph"></a>TQTextEdit::removeParagraph ( int para )<tt> [virtual slot]</tt> </h3> Removes the paragraph <em>para</em>. <h3 class=fn>void <a name="removeSelectedText"></a>TQTextEdit::removeSelectedText ( int selNum = 0 )<tt> [virtual slot]</tt> </h3> Deletes the text of selection <em>selNum</em> (by default, the default selection, 0). If there is no selected text nothing happens. <p> <p>See also <a href="#selectedText-prop">selectedText</a> and <a href="#removeSelection">removeSelection</a>(). <h3 class=fn>void <a name="removeSelection"></a>TQTextEdit::removeSelection ( int selNum = 0 )<tt> [virtual slot]</tt> </h3> Removes the selection <em>selNum</em> (by default 0). This does not remove the selected text. <p> <p>See also <a href="#removeSelectedText">removeSelectedText</a>(). <h3 class=fn>void <a name="repaintChanged"></a>TQTextEdit::repaintChanged ()<tt> [protected]</tt> </h3> Repaints any paragraphs that have changed. <p> Although used extensively internally you shouldn't need to call this yourself. <h3 class=fn>void <a name="returnPressed"></a>TQTextEdit::returnPressed ()<tt> [signal]</tt> </h3> <p> This signal is emitted if the user pressed the Return or the Enter key. <h3 class=fn>void <a name="scrollToAnchor"></a>TQTextEdit::scrollToAnchor ( const <a href="ntqstring.html">TQString</a> & name )<tt> [virtual slot]</tt> </h3> Scrolls the text edit to make the text at the anchor called <em>name</em> visible, if it can be found in the document. If the anchor isn't found no scrolling will occur. An anchor is defined using the HTML anchor tag, e.g. <tt><a name="target"></tt>. <h3 class=fn>void <a name="scrollToBottom"></a>TQTextEdit::scrollToBottom ()<tt> [virtual slot]</tt> </h3> Scrolls to the bottom of the document and does formatting if required. <h3 class=fn>void <a name="selectAll"></a>TQTextEdit::selectAll ( bool select = TRUE )<tt> [virtual slot]</tt> </h3> If <em>select</em> is TRUE (the default), all the text is selected as selection 0. If <em>select</em> is FALSE any selected text is unselected, i.e. the default selection (selection 0) is cleared. <p> <p>See also <a href="#selectedText-prop">selectedText</a>. <h3 class=fn><a href="ntqstring.html">TQString</a> <a name="selectedText"></a>TQTextEdit::selectedText () const </h3><p>Returns the selected text (from selection 0) or an empty string if there is no currently selected text (in selection 0). See the <a href="ntqtextedit.html#selectedText-prop">"selectedText"</a> property for details. <h3 class=fn>void <a name="selectionChanged"></a>TQTextEdit::selectionChanged ()<tt> [signal]</tt> </h3> <p> This signal is emitted whenever the selection changes. <p> <p>See also <a href="#setSelection">setSelection</a>() and <a href="#copyAvailable">copyAvailable</a>(). <h3 class=fn>void <a name="setAlignment"></a>TQTextEdit::setAlignment ( int a )<tt> [virtual slot]</tt> </h3> Sets the alignment of the current paragraph to <em>a</em>. Valid alignments are <a href="ntqt.html#AlignmentFlags-enum">TQt::AlignLeft</a>, <a href="ntqt.html#AlignmentFlags-enum">TQt::AlignRight</a>, <a href="ntqt.html#AlignmentFlags-enum">TQt::AlignJustify</a> and <a href="ntqt.html#AlignmentFlags-enum">TQt::AlignCenter</a> (which centers horizontally). <p>Reimplemented in <a href="ntqmultilineedit.html#setAlignment">TQMultiLineEdit</a>. <h3 class=fn>void <a name="setAutoFormatting"></a>TQTextEdit::setAutoFormatting ( uint features ) </h3><p>Sets the enabled set of auto formatting features to <em>features</em>. See the <a href="ntqtextedit.html#autoFormatting-prop">"autoFormatting"</a> property for details. <h3 class=fn>void <a name="setBold"></a>TQTextEdit::setBold ( bool b )<tt> [virtual slot]</tt> </h3> If <em>b</em> is TRUE sets the current format to bold; otherwise sets the current format to non-bold. <p> <p>See also <a href="#bold">bold</a>(). <h3 class=fn>void <a name="setColor"></a>TQTextEdit::setColor ( const <a href="ntqcolor.html">TQColor</a> & c )<tt> [virtual slot]</tt> </h3> Sets the color of the current format, i.e. of the text, to <em>c</em>. <p> <p>See also <a href="#color">color</a>() and <a href="#paper-prop">paper</a>. <h3 class=fn>void <a name="setCurrentFont"></a>TQTextEdit::setCurrentFont ( const <a href="ntqfont.html">TQFont</a> & f )<tt> [virtual slot]</tt> </h3> <p> Sets the font of the current format to <em>f</em>. <p> If the widget is in <a href="ntqt.html#TextFormat-enum">LogText</a> mode this function will do nothing. Use <a href="ntqwidget.html#setFont">setFont</a>() instead. <p> <p>See also <a href="#currentFont">currentFont</a>(), <a href="#setPointSize">setPointSize</a>(), and <a href="#setFamily">setFamily</a>(). <h3 class=fn>void <a name="setCursorPosition"></a>TQTextEdit::setCursorPosition ( int para, int index )<tt> [virtual slot]</tt> </h3> Sets the cursor to position <em>index</em> in paragraph <em>para</em>. <p> <p>See also <a href="#getCursorPosition">getCursorPosition</a>(). <h3 class=fn>void <a name="setFamily"></a>TQTextEdit::setFamily ( const <a href="ntqstring.html">TQString</a> & fontFamily )<tt> [virtual slot]</tt> </h3> Sets the font family of the current format to <em>fontFamily</em>. <p> <p>See also <a href="#family">family</a>() and <a href="#setCurrentFont">setCurrentFont</a>(). <h3 class=fn>void <a name="setItalic"></a>TQTextEdit::setItalic ( bool b )<tt> [virtual slot]</tt> </h3> If <em>b</em> is TRUE sets the current format to italic; otherwise sets the current format to non-italic. <p> <p>See also <a href="#italic">italic</a>(). <h3 class=fn>void <a name="setLinkUnderline"></a>TQTextEdit::setLinkUnderline ( bool )<tt> [virtual slot]</tt> </h3><p>Sets whether hypertext links will be underlined. See the <a href="ntqtextedit.html#linkUnderline-prop">"linkUnderline"</a> property for details. <h3 class=fn>void <a name="setMaxLogLines"></a>TQTextEdit::setMaxLogLines ( int limit )<tt> [slot]</tt> </h3> Sets the maximum number of lines a TQTextEdit can hold in <a href="ntqt.html#TextFormat-enum">LogText</a> mode to <em>limit</em>. If <em>limit</em> is -1 (the default), this signifies an unlimited number of lines. <p> <b>Warning:</b> Never use formatting tags that span more than one line when the maximum log lines is set. When lines are removed from the top of the buffer it could result in an unbalanced tag pair, i.e. the left formatting tag is removed before the right one. <h3 class=fn>void <a name="setMimeSourceFactory"></a>TQTextEdit::setMimeSourceFactory ( <a href="qmimesourcefactory.html">TQMimeSourceFactory</a> * factory )<tt> [virtual slot]</tt> </h3> Sets the text edit's mimesource factory to <em>factory</em>. See <a href="qmimesourcefactory.html">TQMimeSourceFactory</a> for further details. <p> <p>See also <a href="#mimeSourceFactory">mimeSourceFactory</a>(). <h3 class=fn>void <a name="setModified"></a>TQTextEdit::setModified ( bool m )<tt> [virtual slot]</tt> </h3><p>Sets whether the document has been modified by the user to <em>m</em>. See the <a href="ntqtextedit.html#modified-prop">"modified"</a> property for details. <h3 class=fn>void <a name="setOverwriteMode"></a>TQTextEdit::setOverwriteMode ( bool b )<tt> [virtual slot]</tt> </h3><p>Sets the text edit's overwrite mode to <em>b</em>. See the <a href="ntqtextedit.html#overwriteMode-prop">"overwriteMode"</a> property for details. <h3 class=fn>void <a name="setPaper"></a>TQTextEdit::setPaper ( const <a href="ntqbrush.html">TQBrush</a> & pap )<tt> [virtual slot]</tt> </h3><p>Sets the background (paper) brush to <em>pap</em>. See the <a href="ntqtextedit.html#paper-prop">"paper"</a> property for details. <h3 class=fn>void <a name="setParagraphBackgroundColor"></a>TQTextEdit::setParagraphBackgroundColor ( int para, const <a href="ntqcolor.html">TQColor</a> & bg )<tt> [virtual slot]</tt> </h3> Sets the background color of the paragraph <em>para</em> to <em>bg</em>. <h3 class=fn>void <a name="setPointSize"></a>TQTextEdit::setPointSize ( int s )<tt> [virtual slot]</tt> </h3> Sets the point size of the current format to <em>s</em>. <p> Note that if <em>s</em> is zero or negative, the behaviour of this function is not defined. <p> <p>See also <a href="#pointSize">pointSize</a>(), <a href="#setCurrentFont">setCurrentFont</a>(), and <a href="#setFamily">setFamily</a>(). <h3 class=fn>void <a name="setReadOnly"></a>TQTextEdit::setReadOnly ( bool b )<tt> [virtual slot]</tt> </h3><p>Sets whether the text edit is read-only to <em>b</em>. See the <a href="ntqtextedit.html#readOnly-prop">"readOnly"</a> property for details. <h3 class=fn>void <a name="setSelection"></a>TQTextEdit::setSelection ( int paraFrom, int indexFrom, int paraTo, int indexTo, int selNum = 0 )<tt> [virtual slot]</tt> </h3> Sets a selection which starts at position <em>indexFrom</em> in paragraph <em>paraFrom</em> and ends at position <em>indexTo</em> in paragraph <em>paraTo</em>. <p> Any existing selections which have a different id (<em>selNum</em>) are left alone, but if an existing selection has the same id as <em>selNum</em> it is removed and replaced by this selection. <p> Uses the selection settings of selection <em>selNum</em>. If <em>selNum</em> is 0, this is the default selection. <p> The cursor is moved to the end of the selection if <em>selNum</em> is 0, otherwise the cursor position remains unchanged. <p> <p>See also <a href="#getSelection">getSelection</a>() and <a href="#selectedText-prop">selectedText</a>. <h3 class=fn>void <a name="setSelectionAttributes"></a>TQTextEdit::setSelectionAttributes ( int selNum, const <a href="ntqcolor.html">TQColor</a> & back, bool invertText )<tt> [virtual slot]</tt> </h3> Sets the background color of selection number <em>selNum</em> to <em>back</em> and specifies whether the text of this selection should be inverted with <em>invertText</em>. <p> This only works for <em>selNum</em> > 0. The default selection (<em>selNum</em> == 0) gets its attributes from the text edit's <a href="ntqwidget.html#colorGroup">colorGroup</a>(). <h3 class=fn>void <a name="setStyleSheet"></a>TQTextEdit::setStyleSheet ( <a href="ntqstylesheet.html">TQStyleSheet</a> * styleSheet )<tt> [virtual slot]</tt> </h3> Sets the stylesheet to use with this text edit to <em>styleSheet</em>. Changes will only take effect for new text added with <a href="#setText">setText</a>() or <a href="#append">append</a>(). <p> <p>See also <a href="#styleSheet">styleSheet</a>(). <h3 class=fn>void <a name="setTabChangesFocus"></a>TQTextEdit::setTabChangesFocus ( bool b )<tt> [slot]</tt> </h3><p>Sets whether TAB changes focus or is accepted as input to <em>b</em>. See the <a href="ntqtextedit.html#tabChangesFocus-prop">"tabChangesFocus"</a> property for details. <h3 class=fn>void <a name="setTabStopWidth"></a>TQTextEdit::setTabStopWidth ( int ts )<tt> [virtual slot]</tt> </h3><p>Sets the tab stop width in pixels to <em>ts</em>. See the <a href="ntqtextedit.html#tabStopWidth-prop">"tabStopWidth"</a> property for details. <h3 class=fn>void <a name="setText"></a>TQTextEdit::setText ( const <a href="ntqstring.html">TQString</a> & txt )<tt> [slot]</tt> </h3><p>Sets the text edit's text to <em>txt</em>. See the <a href="ntqtextedit.html#text-prop">"text"</a> property for details. <h3 class=fn>void <a name="setText-2"></a>TQTextEdit::setText ( const <a href="ntqstring.html">TQString</a> & text, const <a href="ntqstring.html">TQString</a> & context )<tt> [virtual slot]</tt> </h3> This is an overloaded member function, provided for convenience. It behaves essentially like the above function. <p> Changes the text of the text edit to the string <em>text</em> and the context to <em>context</em>. Any previous text is removed. <p> <em>text</em> may be interpreted either as plain text or as rich text, depending on the <a href="#textFormat">textFormat</a>(). The default setting is <a href="ntqt.html#TextFormat-enum">AutoText</a>, i.e. the text edit auto-detects the format from <em>text</em>. <p> For rich text the rendering style and available tags are defined by a <a href="#styleSheet">styleSheet</a>(); see <a href="ntqstylesheet.html">TQStyleSheet</a> for details. <p> The optional <em>context</em> is a path which the text edit's <a href="qmimesourcefactory.html">TQMimeSourceFactory</a> uses to resolve the locations of files and images. (See <a href="#TQTextEdit">TQTextEdit::TQTextEdit</a>().) It is passed to the text edit's TQMimeSourceFactory when quering data. <p> Note that the undo/redo history is cleared by this function. <p> <p>See also <a href="#text-prop">text</a> and <a href="#textFormat-prop">textFormat</a>. <h3 class=fn>void <a name="setTextFormat"></a>TQTextEdit::setTextFormat ( <a href="ntqt.html#TextFormat-enum">TextFormat</a> f )<tt> [virtual slot]</tt> </h3><p>Sets the text format: rich text, plain text, log text or auto text to <em>f</em>. See the <a href="ntqtextedit.html#textFormat-prop">"textFormat"</a> property for details. <h3 class=fn>void <a name="setUnderline"></a>TQTextEdit::setUnderline ( bool b )<tt> [virtual slot]</tt> </h3> If <em>b</em> is TRUE sets the current format to underline; otherwise sets the current format to non-underline. <p> <p>See also <a href="#underline">underline</a>(). <h3 class=fn>void <a name="setUndoDepth"></a>TQTextEdit::setUndoDepth ( int d )<tt> [virtual slot]</tt> </h3><p>Sets the depth of the undo history to <em>d</em>. See the <a href="ntqtextedit.html#undoDepth-prop">"undoDepth"</a> property for details. <h3 class=fn>void <a name="setUndoRedoEnabled"></a>TQTextEdit::setUndoRedoEnabled ( bool b )<tt> [virtual slot]</tt> </h3><p>Sets whether undo/redo is enabled to <em>b</em>. See the <a href="ntqtextedit.html#undoRedoEnabled-prop">"undoRedoEnabled"</a> property for details. <h3 class=fn>void <a name="setVerticalAlignment"></a>TQTextEdit::setVerticalAlignment ( <a href="ntqtextedit.html#VerticalAlignment-enum">VerticalAlignment</a> a )<tt> [virtual slot]</tt> </h3> Sets the vertical alignment of the current format, i.e. of the text, to <em>a</em>. <p> <p>See also <a href="#color">color</a>() and <a href="#paper-prop">paper</a>. <h3 class=fn>void <a name="setWordWrap"></a>TQTextEdit::setWordWrap ( <a href="ntqtextedit.html#WordWrap-enum">WordWrap</a> mode )<tt> [virtual slot]</tt> </h3><p>Sets the word wrap mode to <em>mode</em>. See the <a href="ntqtextedit.html#wordWrap-prop">"wordWrap"</a> property for details. <h3 class=fn>void <a name="setWrapColumnOrWidth"></a>TQTextEdit::setWrapColumnOrWidth ( int )<tt> [virtual slot]</tt> </h3><p>Sets the position (in pixels or columns depending on the wrap mode) where text will be wrapped. See the <a href="ntqtextedit.html#wrapColumnOrWidth-prop">"wrapColumnOrWidth"</a> property for details. <h3 class=fn>void <a name="setWrapPolicy"></a>TQTextEdit::setWrapPolicy ( <a href="ntqtextedit.html#WrapPolicy-enum">WrapPolicy</a> policy )<tt> [virtual slot]</tt> </h3><p>Sets the word wrap policy, at whitespace or anywhere to <em>policy</em>. See the <a href="ntqtextedit.html#wrapPolicy-prop">"wrapPolicy"</a> property for details. <h3 class=fn><a href="ntqstylesheet.html">TQStyleSheet</a> * <a name="styleSheet"></a>TQTextEdit::styleSheet () const </h3> Returns the <a href="ntqstylesheet.html">TQStyleSheet</a> which is being used by this text edit. <p> <p>See also <a href="#setStyleSheet">setStyleSheet</a>(). <p>Examples: <a href="qaction-application-example.html#x1169">action/application.cpp</a>, <a href="simple-application-example.html#x1587">application/application.cpp</a>, <a href="helpviewer-example.html#x1031">helpviewer/helpwindow.cpp</a>, and <a href="mdi-example.html#x2072">mdi/application.cpp</a>. <h3 class=fn>void <a name="sync"></a>TQTextEdit::sync ()<tt> [virtual slot]</tt> </h3> TQTextEdit is optimized for large amounts text. One of its optimizations is to format only the visible text, formatting the rest on demand, e.g. as the user scrolls, so you don't usually need to call this function. <p> In some situations you may want to force the whole text to be formatted. For example, if after calling <a href="#setText">setText</a>(), you wanted to know the height of the document (using <a href="ntqscrollview.html#contentsHeight">contentsHeight</a>()), you would call this function first. <h3 class=fn><a href="ntqsyntaxhighlighter.html">TQSyntaxHighlighter</a> * <a name="syntaxHighlighter"></a>TQTextEdit::syntaxHighlighter () const </h3> Returns the <a href="ntqsyntaxhighlighter.html">TQSyntaxHighlighter</a> set on this TQTextEdit. 0 is returned if no syntax highlighter is set. <h3 class=fn>bool <a name="tabChangesFocus"></a>TQTextEdit::tabChangesFocus () const </h3><p>Returns TRUE if TAB changes focus or is accepted as input; otherwise returns FALSE. See the <a href="ntqtextedit.html#tabChangesFocus-prop">"tabChangesFocus"</a> property for details. <h3 class=fn>int <a name="tabStopWidth"></a>TQTextEdit::tabStopWidth () const </h3><p>Returns the tab stop width in pixels. See the <a href="ntqtextedit.html#tabStopWidth-prop">"tabStopWidth"</a> property for details. <h3 class=fn><a href="ntqstring.html">TQString</a> <a name="text"></a>TQTextEdit::text () const </h3><p>Returns the text edit's text. See the <a href="ntqtextedit.html#text-prop">"text"</a> property for details. <h3 class=fn><a href="ntqstring.html">TQString</a> <a name="text-2"></a>TQTextEdit::text ( int para ) const </h3> This is an overloaded member function, provided for convenience. It behaves essentially like the above function. <p> Returns the text of paragraph <em>para</em>. <p> If <a href="#textFormat">textFormat</a>() is <a href="ntqt.html#TextFormat-enum">RichText</a> the text will contain HTML formatting tags. <h3 class=fn>void <a name="textChanged"></a>TQTextEdit::textChanged ()<tt> [signal]</tt> </h3> <p> This signal is emitted whenever the text in the text edit changes. <p> <p>See also <a href="#text-prop">text</a> and <a href="#append">append</a>(). <p>Examples: <a href="qwerty-example.html#x400">qwerty/qwerty.cpp</a> and <a href="rot-example.html#x1375">rot13/rot13.cpp</a>. <h3 class=fn>TQTextCursor * <a name="textCursor"></a>TQTextEdit::textCursor () const<tt> [protected]</tt> </h3> <p> Returns the text edit's text cursor. <p> <b>Warning:</b> TQTextCursor is not in the public API, but in special circumstances you might wish to use it. <h3 class=fn><a href="ntqt.html#TextFormat-enum">TextFormat</a> <a name="textFormat"></a>TQTextEdit::textFormat () const </h3><p>Returns the text format: rich text, plain text, log text or auto text. See the <a href="ntqtextedit.html#textFormat-prop">"textFormat"</a> property for details. <h3 class=fn>bool <a name="underline"></a>TQTextEdit::underline () const </h3> Returns TRUE if the current format is underlined; otherwise returns FALSE. <p> <p>See also <a href="#setUnderline">setUnderline</a>(). <h3 class=fn>void <a name="undo"></a>TQTextEdit::undo ()<tt> [virtual slot]</tt> </h3> Undoes the last operation. <p> If there is no operation to undo, i.e. there is no undo step in the undo/redo history, nothing happens. <p> <p>See also <a href="#undoAvailable">undoAvailable</a>(), <a href="#redo">redo</a>(), and <a href="#undoDepth-prop">undoDepth</a>. <h3 class=fn>void <a name="undoAvailable"></a>TQTextEdit::undoAvailable ( bool yes )<tt> [signal]</tt> </h3> <p> This signal is emitted when the availability of undo changes. If <em>yes</em> is TRUE, then <a href="#undo">undo</a>() will work until <a href="#undoAvailable">undoAvailable</a>( FALSE ) is next emitted. <p> <p>See also <a href="#undo">undo</a>() and <a href="#undoDepth-prop">undoDepth</a>. <h3 class=fn>int <a name="undoDepth"></a>TQTextEdit::undoDepth () const </h3><p>Returns the depth of the undo history. See the <a href="ntqtextedit.html#undoDepth-prop">"undoDepth"</a> property for details. <h3 class=fn><a href="ntqtextedit.html#WordWrap-enum">WordWrap</a> <a name="wordWrap"></a>TQTextEdit::wordWrap () const </h3><p>Returns the word wrap mode. See the <a href="ntqtextedit.html#wordWrap-prop">"wordWrap"</a> property for details. <h3 class=fn>int <a name="wrapColumnOrWidth"></a>TQTextEdit::wrapColumnOrWidth () const </h3><p>Returns the position (in pixels or columns depending on the wrap mode) where text will be wrapped. See the <a href="ntqtextedit.html#wrapColumnOrWidth-prop">"wrapColumnOrWidth"</a> property for details. <h3 class=fn><a href="ntqtextedit.html#WrapPolicy-enum">WrapPolicy</a> <a name="wrapPolicy"></a>TQTextEdit::wrapPolicy () const </h3><p>Returns the word wrap policy, at whitespace or anywhere. See the <a href="ntqtextedit.html#wrapPolicy-prop">"wrapPolicy"</a> property for details. <h3 class=fn>void <a name="zoomIn"></a>TQTextEdit::zoomIn ( int range )<tt> [virtual slot]</tt> </h3> Zooms in on the text by making the base font size <em>range</em> points larger and recalculating all font sizes to be the new size. This does not change the size of any images. <p> <p>See also <a href="#zoomOut">zoomOut</a>(). <h3 class=fn>void <a name="zoomIn-2"></a>TQTextEdit::zoomIn ()<tt> [virtual slot]</tt> </h3> <p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function. <p> Zooms in on the text by making the base font size one point larger and recalculating all font sizes to be the new size. This does not change the size of any images. <p> <p>See also <a href="#zoomOut">zoomOut</a>(). <h3 class=fn>void <a name="zoomOut"></a>TQTextEdit::zoomOut ( int range )<tt> [virtual slot]</tt> </h3> Zooms out on the text by making the base font size <em>range</em> points smaller and recalculating all font sizes to be the new size. This does not change the size of any images. <p> <p>See also <a href="#zoomIn">zoomIn</a>(). <h3 class=fn>void <a name="zoomOut-2"></a>TQTextEdit::zoomOut ()<tt> [virtual slot]</tt> </h3> <p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function. <p> Zooms out on the text by making the base font size one point smaller and recalculating all font sizes to be the new size. This does not change the size of any images. <p> <p>See also <a href="#zoomIn">zoomIn</a>(). <h3 class=fn>void <a name="zoomTo"></a>TQTextEdit::zoomTo ( int size )<tt> [virtual slot]</tt> </h3> Zooms the text by making the base font size <em>size</em> points and recalculating all font sizes to be the new size. This does not change the size of any images. <hr><h2>Property Documentation</h2> <h3 class=fn><a href="ntqtextedit.html#AutoFormatting-enum">AutoFormatting</a> <a name="autoFormatting-prop"></a>autoFormatting</h3> <p>This property holds the enabled set of auto formatting features. <p>The value can be any combination of the values in the <a href="#AutoFormatting-enum">AutoFormatting</a> enum. The default is <a href="#AutoFormatting-enum">AutoAll</a>. Choose <a href="#AutoFormatting-enum">AutoNone</a> to disable all automatic formatting. <p> Currently, the only automatic formatting feature provided is <a href="#AutoFormatting-enum">AutoBulletList</a>; future versions of TQt may offer more. <p>Set this property's value with <a href="#setAutoFormatting">setAutoFormatting</a>() and get this property's value with <a href="#autoFormatting">autoFormatting</a>(). <h3 class=fn><a href="ntqstring.html">TQString</a> <a name="documentTitle-prop"></a>documentTitle</h3> <p>This property holds the title of the document parsed from the text. <p>For <a href="ntqt.html#TextFormat-enum">PlainText</a> the title will be an empty string. For <a href="ntqt.html#TextFormat-enum">RichText</a> the title will be the text between the <tt><title></tt> tags, if present, otherwise an empty string. <p>Get this property's value with <a href="#documentTitle">documentTitle</a>(). <h3 class=fn>bool <a name="hasSelectedText-prop"></a>hasSelectedText</h3> <p>This property holds whether some text is selected in selection 0. <p> <p>Get this property's value with <a href="#hasSelectedText">hasSelectedText</a>(). <h3 class=fn>int <a name="length-prop"></a>length</h3> <p>This property holds the number of characters in the text. <p> <p>Get this property's value with <a href="#length">length</a>(). <h3 class=fn>bool <a name="linkUnderline-prop"></a>linkUnderline</h3> <p>This property holds whether hypertext links will be underlined. <p>If TRUE (the default) hypertext links will be displayed underlined. If FALSE links will not be displayed underlined. <p>Set this property's value with <a href="#setLinkUnderline">setLinkUnderline</a>() and get this property's value with <a href="#linkUnderline">linkUnderline</a>(). <h3 class=fn>bool <a name="modified-prop"></a>modified</h3> <p>This property holds whether the document has been modified by the user. <p> <p>Set this property's value with <a href="#setModified">setModified</a>() and get this property's value with <a href="#isModified">isModified</a>(). <h3 class=fn>bool <a name="overwriteMode-prop"></a>overwriteMode</h3> <p>This property holds the text edit's overwrite mode. <p>If FALSE (the default) characters entered by the user are inserted with any characters to the right being moved out of the way. If TRUE, the editor is in overwrite mode, i.e. characters entered by the user overwrite any characters to the right of the cursor position. <p>Set this property's value with <a href="#setOverwriteMode">setOverwriteMode</a>() and get this property's value with <a href="#isOverwriteMode">isOverwriteMode</a>(). <h3 class=fn><a href="ntqbrush.html">TQBrush</a> <a name="paper-prop"></a>paper</h3> <p>This property holds the background (paper) brush. <p>The brush that is currently used to draw the background of the text edit. The initial setting is an empty brush. <p>Set this property's value with <a href="#setPaper">setPaper</a>() and get this property's value with <a href="#paper">paper</a>(). <h3 class=fn>bool <a name="readOnly-prop"></a>readOnly</h3> <p>This property holds whether the text edit is read-only. <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> This property's default is FALSE. <p>Set this property's value with <a href="#setReadOnly">setReadOnly</a>() and get this property's value with <a href="#isReadOnly">isReadOnly</a>(). <h3 class=fn><a href="ntqstring.html">TQString</a> <a name="selectedText-prop"></a>selectedText</h3> <p>This property holds the selected text (from selection 0) or an empty string if there is no currently selected text (in selection 0). <p>The text is always returned as <a href="ntqt.html#TextFormat-enum">PlainText</a> if the <a href="#textFormat">textFormat</a>() is <a href="ntqt.html#TextFormat-enum">PlainText</a> or <a href="ntqt.html#TextFormat-enum">AutoText</a>, otherwise it is returned as HTML. <p> <p>See also <a href="#hasSelectedText-prop">hasSelectedText</a>. <p>Get this property's value with <a href="#selectedText">selectedText</a>(). <h3 class=fn>bool <a name="tabChangesFocus-prop"></a>tabChangesFocus</h3> <p>This property holds whether TAB changes focus or is accepted as input. <p>In some occasions text edits should not allow the user to input tabulators or change indentation using the TAB key, as this breaks the focus chain. The default is FALSE. <p> <p>Set this property's value with <a href="#setTabChangesFocus">setTabChangesFocus</a>() and get this property's value with <a href="#tabChangesFocus">tabChangesFocus</a>(). <h3 class=fn>int <a name="tabStopWidth-prop"></a>tabStopWidth</h3> <p>This property holds the tab stop width in pixels. <p> <p>Set this property's value with <a href="#setTabStopWidth">setTabStopWidth</a>() and get this property's value with <a href="#tabStopWidth">tabStopWidth</a>(). <h3 class=fn><a href="ntqstring.html">TQString</a> <a name="text-prop"></a>text</h3> <p>This property holds the text edit's text. <p>There is no default text. <p> On setting, any previous text is deleted. <p> The text may be interpreted either as plain text or as rich text, depending on the <a href="#textFormat">textFormat</a>(). The default setting is <a href="ntqt.html#TextFormat-enum">AutoText</a>, i.e. the text edit auto-detects the format of the text. <p> For richtext, calling <a href="#text">text</a>() on an editable TQTextEdit will cause the text to be regenerated from the textedit. This may mean that the <a href="ntqstring.html">TQString</a> returned may not be exactly the same as the one that was set. <p> <p>See also <a href="#textFormat-prop">textFormat</a>. <p>Set this property's value with <a href="#setText">setText</a>() and get this property's value with <a href="#text">text</a>(). <h3 class=fn><a href="ntqt.html#TextFormat-enum">TextFormat</a> <a name="textFormat-prop"></a>textFormat</h3> <p>This property holds the text format: rich text, plain text, log text or auto text. <p>The text format is one of the following: <ul> <li> PlainText - all characters, except newlines, are displayed verbatim, including spaces. Whenever a newline appears in the text the text edit inserts a hard line break and begins a new paragraph. <li> RichText - rich text rendering. The available styles are defined in the default stylesheet <a href="ntqstylesheet.html#defaultSheet">TQStyleSheet::defaultSheet</a>(). <li> LogText - optimized mode for very large texts. Supports a very limited set of formatting tags (color, bold, underline and italic settings). <li> AutoText - this is the default. The text edit autodetects which rendering style is best, <a href="ntqt.html#TextFormat-enum">PlainText</a> or <a href="ntqt.html#TextFormat-enum">RichText</a>. This is done by using the <a href="ntqstylesheet.html#mightBeRichText">TQStyleSheet::mightBeRichText</a>() function. </ul> <p>Set this property's value with <a href="#setTextFormat">setTextFormat</a>() and get this property's value with <a href="#textFormat">textFormat</a>(). <h3 class=fn>int <a name="undoDepth-prop"></a>undoDepth</h3> <p>This property holds the depth of the undo history. <p>The maximum number of steps in the undo/redo history. The default is 100. <p> <p>See also <a href="#undo">undo</a>() and <a href="#redo">redo</a>(). <p>Set this property's value with <a href="#setUndoDepth">setUndoDepth</a>() and get this property's value with <a href="#undoDepth">undoDepth</a>(). <h3 class=fn>bool <a name="undoRedoEnabled-prop"></a>undoRedoEnabled</h3> <p>This property holds whether undo/redo is enabled. <p>When changing this property, the undo/redo history is cleared. <p> The default is TRUE. <p>Set this property's value with <a href="#setUndoRedoEnabled">setUndoRedoEnabled</a>() and get this property's value with <a href="#isUndoRedoEnabled">isUndoRedoEnabled</a>(). <h3 class=fn><a href="ntqtextedit.html#WordWrap-enum">WordWrap</a> <a name="wordWrap-prop"></a>wordWrap</h3> <p>This property holds the word wrap mode. <p>The default mode is <a href="#WordWrap-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="#setWrapPolicy">setWrapPolicy</a>(). If you set a wrap mode of <a href="#WordWrap-enum">FixedPixelWidth</a> or <a href="#WordWrap-enum">FixedColumnWidth</a> you should also call <a href="#setWrapColumnOrWidth">setWrapColumnOrWidth</a>() with the width you want. <p> <p>See also <a href="#WordWrap-enum">WordWrap</a>, <a href="#wrapColumnOrWidth-prop">wrapColumnOrWidth</a>, and <a href="#wrapPolicy-prop">wrapPolicy</a>. <p>Set this property's value with <a href="#setWordWrap">setWordWrap</a>() and get this property's value with <a href="#wordWrap">wordWrap</a>(). <h3 class=fn>int <a name="wrapColumnOrWidth-prop"></a>wrapColumnOrWidth</h3> <p>This property holds the position (in pixels or columns depending on the wrap mode) where text will be wrapped. <p>If the wrap mode is <a href="#WordWrap-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="#WordWrap-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>See also <a href="#wordWrap-prop">wordWrap</a>. <p>Set this property's value with <a href="#setWrapColumnOrWidth">setWrapColumnOrWidth</a>() and get this property's value with <a href="#wrapColumnOrWidth">wrapColumnOrWidth</a>(). <h3 class=fn><a href="ntqtextedit.html#WrapPolicy-enum">WrapPolicy</a> <a name="wrapPolicy-prop"></a>wrapPolicy</h3> <p>This property holds the word wrap policy, at whitespace or anywhere. <p>Defines where text can be wrapped when word wrap mode is not <a href="#WordWrap-enum">NoWrap</a>. The choices are <a href="#WrapPolicy-enum">AtWordBoundary</a> (the default), <a href="#WrapPolicy-enum">Anywhere</a> and <a href="#WrapPolicy-enum">AtWordOrDocumentBoundary</a> <p> <p>See also <a href="#wordWrap-prop">wordWrap</a>. <p>Set this property's value with <a href="#setWrapPolicy">setWrapPolicy</a>() and get this property's value with <a href="#wrapPolicy">wrapPolicy</a>(). <!-- eof --> <hr><p> This file is part of the <a href="index.html">TQt toolkit</a>. Copyright © 1995-2007 <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center> <table width=100% cellspacing=0 border=0><tr> <td>Copyright © 2007 <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a> <td align=right><div align=right>TQt 3.3.8</div> </table></div></address></body> </html>