QTextBrowser类提供具有超文本导航的富文本浏览器。 更多 …
def
backwardHistoryCount
()
def
clearHistory
()
def
doSetSource
(name[, type=QTextDocument.UnknownResource])
def
forwardHistoryCount
()
def
historyTitle
(arg__1)
def
historyUrl
(arg__1)
def
isBackwardAvailable
()
def
isForwardAvailable
()
def
openExternalLinks
()
def
openLinks
()
def
searchPaths
()
def
setOpenExternalLinks
(open)
def
setOpenLinks
(open)
def
setSearchPaths
(paths)
def
source
()
def
sourceType
()
def
anchorClicked
(arg__1)
def
backwardAvailable
(arg__1)
def
forwardAvailable
(arg__1)
def
highlighted
(arg__1)
def
highlighted
(arg__1)
def
historyChanged
()
def
sourceChanged
(arg__1)
此类扩展
QTextEdit(以只读模式),添加一些导航功能,以便用户可以在超文本文档中跟随链接。If you want to provide your users with an editable rich text editor, use
QTextEdit. If you want a text browser without hypertext navigation useQTextEdit, and usesetReadOnly()to disable editing. If you just need to display a small piece of rich text useQLabel.
The contents of
QTextEditare set withsetHtml()orsetPlainText(),但QTextBrowseralso implements thesetSource()function, making it possible to use a named document as the source text. The name is looked up in a list of search paths and in the directory of the current document factory.If a document name ends with an anchor (for example, “
#anchor"), the text browser automatically scrolls to that position (usingscrollToAnchor()). When the user clicks on a hyperlink, the browser will callsetSource()itself with the link’shrefvalue as argument. You can track the current source by connecting to thesourceChanged()信号。