Qtopia Home - Classes - Hierachy - Annotated - Functions - Licenses - Reference |
|
A sophisticated single-page rich text viewer. More...
#include <qtextview.h>
Inherits QScrollView.
Inherited by QTextBrowser.
Unlike QSimpleRichText, which merely draws small pieces of rich text, a QTextView is a real widget, with scrollbars when necessary, for showing large text documents.
The rendering style and available tags are defined by a styleSheet(). Custom tags can be created and placed in a custom style sheet. Change the style sheet with setStyleSheet(); see QStyleSheet for details. Currently, a small XML/CSS1 subset including embedded images and tables is supported. See QStyleSheet for details. Possible images within the text document are resolved by using a QMimeSourceFactory. See setMimeSourceFactory() for details.
Using QTextView is quite similar to QLabel. It's mainly a call to setText() to set the contents. Setting the background color is slightly different from other widgets, since a text view is a scrollable widget that naturally provides a scrolling background. You can specify the colorgroup of the displayed text with setPaperColorGroup() or directly define the paper background with setPaper(). QTextView supports both plain color and complex pixmap backgrounds.
Note that we do not intend to add a full-featured web browser widget to Qt (since that would easily double Qt's size and only few applications would benefit from it). In particular, the rich text support in Qt is supposed to provide a fast, portable and sufficient way to add reasonable online help facilities to applications. We will, however, extend it to some degree in future versions of Qt.
For even more, like hypertext capabilities, see QTextBrowser.
See also
Useful for log viewers.
Warning: This function has known problems (incorrect painting and layouting). If this problem occures to you, use setText( text() + theNewText ) instead. The new richtext engine, which is part of Qt 3.0, is able to handle append(), insert(), etc. properly.
See also text() and setText().
See also selectedText().
Reimplemented from QWidget.
Reimplemented from QWidget.
Reimplemented in QTextBrowser.
The color may either have been set with setLinkColor() or stem from the document's body tag.
See also setLinkColor().
See also setMimeSourceFactory().
See also setPaperColorGroup() and setPaper().
See also hasSelectedText().
See also linkColor().
Ownership of factory is not transferred to make it possible for several text view widgets to share the same mime source.
See also mimeSourceFactory().
This may be a nice parchment or marble pixmap or simply another plain color.
Technically, setPaper() is just a convenience function to set the base brush of the paperColorGroup().
See also paper().
See also paperColorGroup() and setPaper().
See also styleSheet().
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 view autodetects the format from text.
For rich text the rendering style and available tags are defined by a styleSheet(); see QStyleSheet for details.
The optional context is used to resolve references within the text document, for example image sources. It is passed directly to the mimeSourceFactory() when quering data.
See also text() and setTextFormat().
Reimplemented in QTextBrowser.
Changes the contents of the view to the string text.
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 view autodetects the format from text.
This function calls setText( text, QString::null ), i.e. it sets a text without any context.
See also text() and setTextFormat().
See also setStyleSheet().
See also context() and setText().
See also setTextFormat().
This file is part of the Qtopia platform, copyright © 1995-2005 Trolltech, all rights reserved.
| Copyright © 2005 Trolltech | Trademarks | Qtopia version 2.2.0
|