Inherits QTextEdit.
This class extends QTextEdit (in read-only mode), adding some navigation functionality so that users can follow links in hypertext documents. The contents of QTextEdit is set with setText(), but QTextBrowser has an additional function, setSource(), which makes it possible to set the text to a named document. The name is looked up in the text view's mime source factory. If a document name ends with an anchor (for example, "#anchor"), the text browser automatically scrolls to that position (using scrollToAnchor()). When the user clicks on a hyperlink, the browser will call setSource() itself, with the link's href value as argument. You can track the current source by connetion to the sourceChanged() signal.
QTextBrowser provides backward() and forward() slots which you can use to implement Back and Forward buttons. The home() slot sets the text to the very first document displayed. The linkClicked() signal is emitted when the user clicks a link.
By using QTextEdit::setMimeSourceFactory() you can provide your own subclass of QMimeSourceFactory. This makes it possible to access data from anywhere, for example from a network or from a database. See QMimeSourceFactory::data() for details.
If you intend using the mime factory to read the data directly from the file system, you may have to specify the encoding for the file extension you are using. For example:
This is to ensure that the factory is able to resolve the document names.
mimeSourceFactory()->setExtensionType("qml", "text/utf8");
QTextBrowser interprets the tags it processes in accordance with the default style sheet. Change the style sheet with setStyleSheet(); see QStyleSheet for details.
If you want to pro