QTextEdit窗口部件提供了强大的单页面的多信息文本编辑器。详情请见……#includeqtextedit.h继承了QScrollView。被QMultiLineEdit、QTextBrowser和QTextView继承。所有成员函数的列表。公有成员enumWordWrap{NoWrap,WidgetWidth,FixedPixelWidth,FixedColumnWidth}enumWrapPolicy{AtWordBoundary,Anywhere,AtWhiteSpace=AtWordBoundary}enumKeyboardAction{ActionBackspace,ActionDelete,ActionReturn,ActionKill}enumCursorAction{MoveBackward,MoveForward,MoveWordBackward,MoveWordForward,MoveUp,MoveDown,MoveLineStart,MoveLineEnd,MoveHome,MoveEnd,MovePgUp,MovePgDown}enumVerticalAlignment{AlignNormal,AlignSuperScript,AlignSubScript}QTextEdit(constQString&text,constQString&context=QString::null,QWidget*parent=0,constchar*name=0)QTextEdit(QWidget*parent=0,constchar*name=0)QStringtext()constQStringtext(intpara)constTextFormattextFormat()constQStringcontext()constQStringdocumentTitle()constvoidgetSelection(int*paraFrom,int*indexFrom,int*paraTo,int*indexTo,intselNum=0)constvirtualboolfind(constQString&expr,boolcs,boolwo,boolforward=TRUE,int*para=0,int*index=0)intparagraphs()constintlines()constintlinesOfParagraph(intpara)constintlineOfChar(intpara,intindex)intlength()constQRectparagraphRect(intpara)constintparagraphAt(constQPoint&pos)constintcharAt(constQPoint&pos,int*para)constintparagraphLength(intpara)constQStyleSheet*styleSheet()constQMimeSourceFactory*mimeSourceFactory()constQBrushpaper()constboollinkUnderline()constvirtualintheightForWidth(intw)constboolhasSelectedText()constQStringselectedText()constboolisUndoAvailable()constboolisRedoAvailable()constWordWrapwordWrap()constintwrapColumnOrWidth()constWrapPolicywrapPolicy()constinttabStopWidth()constQStringanchorAt(constQPoint&pos)boolisReadOnly()constvoidgetCursorPosition(int*para,int*index)constboolisModified()constboolitalic()constboolbold()constboolunderline()constQStringfamily()constintpointSize()constQColorcolor()constQFontfont()constintalignment()constintundoDepth()constboolisOverwriteMode()constQColorparagraphBackgroundColor(intpara)constboolisUndoRedoEnabled()const公有槽virtualvoidsetMimeSourceFactory(QMimeSourceFactory*factory)virtualvoidsetStyleSheet(QStyleSheet*styleSheet)virtualvoidscrollToAnchor(constQString&name)virtualvoidsetPaper(constQBrush&pap)virtualvoidsetLinkUnderline(bool)virtualvoidsetWordWrap(WordWrapmode)virtualvoidsetWrapColumnOrWidth(int)virtualvoidsetWrapPolicy(WrapPolicypolicy)virtualvoidcopy()virtualvoidappend(constQString&text)voidsetText(constQString&txt)virtualvoidsetText(constQString&text,constQString&context)virtualvoidsetTextFormat(TextFormatf)virtualvoidselectAll(boolselect=TRUE)virtualvoidsetTabStopWidth(intts)virtualvoidzoomIn(intrange)virtualvoidzoomIn()virtualvoidzoomOut(intrange)virtualvoidzoomOut()virtualvoidzoomTo(intsize)virtualvoidsetReadOnly(boolb)virtualvoidundo()virtualvoidredo()virtualvoidcut()virtualvoidpaste()virtualvoidpasteSubType(constQCString&subtype)virtualvoidclear()virtualvoiddel()virtualvoidindent()virtualvoidsetItalic(boolb)virtualvoidsetBold(boolb)virtualvoidsetUnderline(boolb)virtualvoidsetFamily(constQString&fontFamily)virtualvoidsetPointSize(ints)virtualvoidsetColor(constQColor&c)virtualvoidsetVerticalAlignment(VerticalAlignmenta)virtualvoidsetAlignment(inta)virtualvoidsetCursorPosition(intpara,intindex)virtualvoidsetSelection(intparaFrom,intindexFrom,intparaTo,intindexTo,intselNum=0)virtualvoidsetSelectionAttributes(intselNum,constQColor&back,boolinvertText)virtualvoidsetModified(boolm)virtualvoidsetUndoDepth(intd)virtualvoidensureCursorVisible()virtualvoidplaceCursor(constQPoint&pos,QTextCursor*c=0)virtualvoidmoveCursor(CursorActionaction,boolselect)virtualvoiddoKeyboardAction(KeyboardActionaction)virtualvoidremoveSelectedText(intselNum=0)virtualvoidremoveSelection(intselNum=0)virtualvoidsetCurrentFont(constQFont&f)virtualvoidsetOverwriteMode(boolb)virtualvoidscrollToBottom()virtualvoidinsert(constQString&text,boolindent=FALSE,boolcheckNewLine=TRUE,boolremoveSelected=TRUE)virtualvoidinsertAt(constQString&text,intpara,intindex)virtualvoidremoveParagraph(intpara)virtualvoidinsertParagraph(constQString&text,intpara)virtualvoidsetParagraphBackgroundColor(intpara,constQColor&bg)virtualvoidclearParagraphBackground(intpara)virtualvoidsetUndoRedoEnabled(boolb)信号voidtextChanged()voidselectionChanged()voidcopyAvailable(boolyes)voidundoAvailable(boolyes)voidredoAvailable(boolyes)voidcurrentFontChanged(constQFont&f)voidcurrentColorChanged(constQColor&c)voidcurrentAlignmentChanged(inta)voidcurrentVerticalAlignmentChanged(VerticalAlignmenta)voidcursorPositionChanged(QTextCursor*c)voidcursorPositionChanged(intpara,intpos)voidreturnPressed()voidmodificationChanged(boolm)属性QStringdocumentTitle-从文本中分析出的文档标题(只读)boolhasSelectedText-是否有文本被选择到选择区0中(只读)intlength-文本的字符数(只读)boollinkUnderline-超文本链接是否使用下划线boolmodified-文档是否已经被用户修改booloverwriteMode-文本编辑的覆盖模式QBrushpaper-背景(纸)的画刷boolreadOnly-文本编辑是否只读QStringselectedText-被选择的文本(在选择区0中)或者如果当前没有被选择的文本(在选择区0中)就是空字符串(只读)inttabStopWidt