⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qtextedit.3qt

📁 linux下GUI编程工具qt的在线连接帮助手册
💻 3QT
📖 第 1 页 / 共 5 页
字号:
.SH "void QTextEdit::setReadOnly ( bool b )\fC [virtual slot]\fR"Sets whether the text edit is read-only to \fIb\fR. See the "readOnly" property for details..SH "void QTextEdit::setSelection ( int paraFrom, int indexFrom, int paraTo, int indexTo, int selNum = 0 )\fC [virtual slot]\fR"Sets a selection which starts at position \fIindexFrom\fR in paragraph \fIparaFrom\fR and ends at position \fIindexTo\fR in paragraph \fIparaTo\fR. Existing selections which have a different id (selNum) are not removed, existing selections which have the same id as \fIselNum\fR are removed..PPUses the selection settings of selection \fIselNum\fR. If \fIselNum\fR is 0, this is the default selection..PPSee also getSelection() and selectedText..SH "void QTextEdit::setSelectionAttributes ( int selNum, const QColor & back, bool invertText )\fC [virtual slot]\fR"Sets the background color of selection number \fIselNum\fR to \fIback\fR and specifies whether the text of this selection should be inverted with \fIinvertText\fR..PPThis only works for \\selNum > 0. The default selection (\\selNum == 0) gets its attributes from the colorGroup() of this widget..SH "void QTextEdit::setStyleSheet ( QStyleSheet * styleSheet )\fC [virtual slot]\fR"Sets the stylesheet to use with this text edit to \fIstyleSheet\fR. Changes will only take effect for new text added with setText() or append()..PPSee also styleSheet()..SH "void QTextEdit::setTabStopWidth ( int ts )\fC [virtual slot]\fR"Sets the tab width used by the text edit to \fIts\fR..PPSee also tabStopWidth()..SH "void QTextEdit::setText ( const QString & txt )\fC [slot]\fR"Sets the text edit's text to \fItxt\fR. See the "text" property for details..SH "void QTextEdit::setText ( const QString & text, const QString & context )\fC [virtual slot]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPChanges the text of the text edit to the string \fItext\fR and the context to \fIcontext\fR. Any previous text is removed..PP\fItext\fR may be interpreted either as plain text or as rich text, depending on the textFormat(). The default setting is AutoText, i.e. the text edit autodetects the format from \fItext\fR..PPThe optional \fIcontext\fR is a path which the text edit's QMimeSourceFactory uses to resolve the locations of files and images. (See QTextEdit::QTextEdit().) It is passed to the text edit's QMimeSourceFactory when quering data..PPSee also text and textFormat..SH "void QTextEdit::setTextFormat ( TextFormat f )\fC [virtual slot]\fR"Sets the text format: rich text, plain text or auto text to \fIf\fR. See the "textFormat" property for details..SH "void QTextEdit::setUnderline ( bool b )\fC [virtual slot]\fR"If \fIb\fR is TRUE sets the current format to underline; otherwise sets the current format to non-underline..PPSee also underline()..SH "void QTextEdit::setUndoDepth ( int d )\fC [virtual slot]\fR"Sets the depth of the undo history to \fId\fR. See the "undoDepth" property for details..SH "void QTextEdit::setUndoRedoEnabled ( bool b )\fC [virtual slot]\fR"Sets whether undo/redo is enabled to \fIb\fR. See the "undoRedoEnabled" property for details..SH "void QTextEdit::setVerticalAlignment ( VerticalAlignment a )\fC [virtual slot]\fR"Sets the vertical alignment of the current format, i.e. of the text, to \fIa\fR..PPSee also color() and paper..SH "void QTextEdit::setWordWrap ( WordWrap mode )\fC [virtual slot]\fR"Sets the word wrap mode to \fImode\fR. See the "wordWrap" property for details..SH "void QTextEdit::setWrapColumnOrWidth ( int )\fC [virtual slot]\fR"Sets the position (in pixels or columns depending on the wrap mode) where text will be wrapped. See the "wrapColumnOrWidth" property for details..SH "void QTextEdit::setWrapPolicy ( WrapPolicy policy )\fC [virtual slot]\fR"Sets the word wrap policy, at whitespace or anywhere to \fIpolicy\fR. See the "wrapPolicy" property for details..SH "QStyleSheet * QTextEdit::styleSheet () const"Returns the QStyleSheet which is currently used in this text edit..PPSee also setStyleSheet()..PPExample: helpviewer/helpwindow.cpp..SH "int QTextEdit::tabStopWidth () const"Returns the tab width used by the text edit..PPSee also setTabStopWidth()..SH "QString QTextEdit::text () const"Returns the text edit's text. See the "text" property for details..SH "QString QTextEdit::text ( int para ) const"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPReturns the text of paragraph \fIpara\fR..PPIf textFormat() is RichText the text will contain HTML formatting tags..SH "void QTextEdit::textChanged ()\fC [signal]\fR"This signal is emitted whenever the text in the text edit changes..PPSee also text and append()..PPExamples:.)l helpviewer/helpwindow.cpp, qwerty/qwerty.cpp and rot13/rot13.cpp..SH "QTextCursor * QTextEdit::textCursor () const\fC [protected]\fR"Returns the text edit's text cursor. QTextCursor is not in the public API, but in special circumstances you might wish to use it..SH "TextFormat QTextEdit::textFormat () const"Returns the text format: rich text, plain text or auto text. See the "textFormat" property for details..SH "bool QTextEdit::underline () const"Returns TRUE if the current format is underlined; otherwise returns FALSE..PPSee also setUnderline()..SH "void QTextEdit::undo ()\fC [virtual slot]\fR"Undoes the last operation..PPIf there is no operation to undo, e.g. there is no undo step in the undo/redo history, nothing happens..PPSee also undoAvailable(), redo() and undoDepth..SH "void QTextEdit::undoAvailable ( bool yes )\fC [signal]\fR"This signal is emitted when the availability of undo changes. If \fIyes\fR is TRUE, then undo() will work until undoAvailable( FALSE ) is next emitted..PPSee also undo() and undoDepth..SH "int QTextEdit::undoDepth () const"Returns the depth of the undo history. See the "undoDepth" property for details..SH "void QTextEdit::updateStyles ()\fC [protected]\fR"Updates all the rendering styles used to display the text. You will probably want to call this function after calling setStyleSheet()..SH "WordWrap QTextEdit::wordWrap () const"Returns the word wrap mode. See the "wordWrap" property for details..SH "int QTextEdit::wrapColumnOrWidth () const"Returns the position (in pixels or columns depending on the wrap mode) where text will be wrapped. See the "wrapColumnOrWidth" property for details..SH "WrapPolicy QTextEdit::wrapPolicy () const"Returns the word wrap policy, at whitespace or anywhere. See the "wrapPolicy" property for details..SH "void QTextEdit::zoomIn ( int range )\fC [virtual slot]\fR"Zooms in on the text by by making the base font size \fIrange\fR points larger and recalculating all font sizes. This does not change the size of any images..PPSee also zoomOut()..SH "void QTextEdit::zoomIn ()\fC [virtual slot]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPZooms in on the text by by making the base font size one point larger and recalculating all font sizes. This does not change the size of any images..PPSee also zoomOut()..SH "void QTextEdit::zoomOut ( int range )\fC [virtual slot]\fR"Zooms out on the text by making the base font size \fIrange\fR points smaller and recalculating all font sizes. This does not change the size of any images..PPSee also zoomIn()..SH "void QTextEdit::zoomOut ()\fC [virtual slot]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPZooms out on the text by by making the base font size one point smaller and recalculating all font sizes. This does not change the size of any images..PPSee also zoomIn()..SH "void QTextEdit::zoomTo ( int size )\fC [virtual slot]\fR"Zooms the text by making the base font size \fIsize\fR points and recalculating all font sizes. This does not change the size of any images..SS "Property Documentation".SH "QString documentTitle"This property holds the title of the document parsed from the text..PPFor PlainText the title will be an empty string. For RichText the title will be the text between the \fC<title>\fR tags, if present, otherwise an empty string..PPGet this property's value with documentTitle()..SH "bool hasSelectedText"This property holds whether some text is selected in selection 0..PPGet this property's value with hasSelectedText()..SH "int length"This property holds the number of characters in the text..PPGet this property's value with length()..SH "bool linkUnderline"This property holds whether hypertext links will be underlined..PPIf TRUE (the default) hypertext links will be displayed underlined. If FALSE links will not be displayed underlined..PPSet this property's value with setLinkUnderline() and get this property's value with linkUnderline()..SH "bool modified"This property holds whether the document has been modified by the user..PPSet this property's value with setModified() and get this property's value with isModified()..SH "bool overwriteMode"This property holds the text edit's overwrite mode..PPIf 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..PPSet this property's value with setOverwriteMode() and get this property's value with isOverwriteMode()..SH "QBrush paper"This property holds the background (paper) brush..PPThe brush that is currently used to draw the background of the text edit. The initial setting is an empty brush..PPSet this property's value with setPaper() and get this property's value with paper()..SH "bool readOnly"This property holds whether the text edit is read-only..PPIn a read-only text edit the user can only navigate through the text and select text; modifying the text is not possible..PPSet this property's value with setReadOnly() and get this property's value with isReadOnly()..SH "QString selectedText"This property holds the selected text (from selection 0) or an empty string if there is no currently selected text (in selection 0)..PPThe text is always returned as PlainText regardless of the text format. In a future version of Qt an HTML subset \fImay\fR be returned depending on the text format..PPSee also hasSelectedText..PPGet this property's value with selectedText()..SH "QString text"This property holds the text edit's text..PPThe text in the text edit..PPOn setting, any previous text is deleted..PPThe text may be interpreted either as plain text or as rich text, depending on the textFormat(). The default setting is AutoText, i.e. the text edit autodetects the format of the text..PPSee also textFormat..PPSet this property's value with setText() and get this property's value with text()..SH "TextFormat textFormat"This property holds the text format: rich text, plain text or auto text..PPThe text format is one of the following:.TPPlainText - 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..TPRichText - rich text rendering. The available styles are defined in the default stylesheet QStyleSheet::defaultSheet()..TPAutoText - this is the default. The text edit autodetects which rendering style is best, PlainText or RichText. This is done by using the QStyleSheet::mightBeRichText() function..PPSet this property's value with setTextFormat() and get this property's value with textFormat()..SH "int undoDepth"This property holds the depth of the undo history..PPThe maximum number of steps in the undo/redo history..PPSee also undo() and redo()..PPSet this property's value with setUndoDepth() and get this property's value with undoDepth()..SH "bool undoRedoEnabled"This property holds whether undo/redo is enabled..PPThe default is TRUE..PPSet this property's value with setUndoRedoEnabled() and get this property's value with isUndoRedoEnabled()..SH "WordWrap wordWrap"This property holds the word wrap mode..PPThe default mode is WidgetWidth 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 setWrapPolicy(). If you set a wrap mode of FixedPixelWidth or FixedColumnWidth you should also call setWrapColumnOrWidth() with the width you want..PPSee also WordWrap, wrapColumnOrWidth and wrapPolicy..PPSet this property's value with setWordWrap() and get this property's value with wordWrap()..SH "int wrapColumnOrWidth"This property holds the position (in pixels or columns depending on the wrap mode) where text will be wrapped..PPIf the wrap mode is FixedPixelWidth, 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 FixedColumnWidth, the value is the column number (in character columns) from the left edge of the text edit at which text should be wrapped..PPSee also wordWrap..PPSet this property's value with setWrapColumnOrWidth() and get this property's value with wrapColumnOrWidth()..SH "WrapPolicy wrapPolicy"This property holds the word wrap policy, at whitespace or anywhere..PPDefines where text can be wrapped when word wrap mode is not NoWrap. The choices are AtWhiteSpace (the default) and Anywhere..PPSee also wordWrap..PPSet this property's value with setWrapPolicy() and get this property's value with wrapPolicy()..SH "SEE ALSO".BR http://doc.trolltech.com/qtextedit.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qtextedit.3qt) and the Qtversion (3.0.0).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -