📄 qtextview.3qt
字号:
.TH QTextView 3qt "6 July 1999" "Troll Tech AS" \" -*- nroff -*-.\" Copyright 1992-1999 Troll Tech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQTextView \- A sophisticated single-page rich text viewer.SH SYNOPSIS.br.PP\fC#include <qtextview.h>\fR.PPInherits QScrollView..PPInherited by QTextBrowser..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQTextView\fR ( QWidget * " "parent" "=0, const char * " "name" "=0 )".br.ti -1c.BI "\fBQTextView\fR ( const QString & " "text" ", const QString & context = QString::null, QWidget * " "parent" "=0, const char * " "name" "=0 )".br.ti -1c.BI "\fB~QTextView\fR ()".br.ti -1c.BI "virtual void \fBsetText\fR ( const QString & " "text" ", const QString & context = QString::null )".br.ti -1c.BI "virtual QString \fBtext\fR () const".br.ti -1c.BI "virtual QString \fBcontext\fR () const".br.ti -1c.BI "Qt::TextFormat \fBtextFormat\fR () const".br.ti -1c.BI "void \fBsetTextFormat\fR ( Qt::TextFormat )".br.ti -1c.BI "QStyleSheet* \fBstyleSheet\fR () const".br.ti -1c.BI "void \fBsetStyleSheet\fR ( QStyleSheet * styleSheet )".br.ti -1c.BI "void \fBsetPaper\fR ( const QBrush & pap )".br.ti -1c.BI "const QBrush& \fBpaper\fR ()".br.ti -1c.BI "void \fBsetPaperColorGroup\fR ( const QColorGroup & colgrp )".br.ti -1c.BI "const QColorGroup& \fBpaperColorGroup\fR () const".br.ti -1c.BI "void \fBsetLinkColor\fR ( const QColor & )".br.ti -1c.BI "const QColor& \fBlinkColor\fR () const".br.ti -1c.BI "void \fBsetLinkUnderline\fR ( bool )".br.ti -1c.BI "bool \fBlinkUnderline\fR () const".br.ti -1c.BI "void \fBsetMimeSourceFactory\fR ( QMimeSourceFactory * factory )".br.ti -1c.BI "QMimeSourceFactory* \fBmimeSourceFactory\fR () const".br.ti -1c.BI "QString \fBdocumentTitle\fR () const".br.ti -1c.BI "virtual int \fBheightForWidth\fR ( int w ) const".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual void \fBdrawContentsOffset\fR ( QPainter *, int " "ox" ", int " "oy" ", int " "cx" ", int " "cy" ", int " "cw" ", int ch )".br.ti -1c.BI "virtual void \fBresizeEvent\fR ( QResizeEvent * )".br.ti -1c.BI "virtual void \fBviewportResizeEvent\fR ( QResizeEvent * )".br.ti -1c.BI "virtual void \fBviewportMousePressEvent\fR ( QMouseEvent * )".br.ti -1c.BI "virtual void \fBviewportMouseReleaseEvent\fR ( QMouseEvent * )".br.ti -1c.BI "virtual void \fBviewportMouseMoveEvent\fR ( QMouseEvent * )".br.ti -1c.BI "virtual void \fBkeyPressEvent\fR ( QKeyEvent * )".br.ti -1c.BI "QRichText& \fBrichText\fR () const".br.ti -1c.BI "virtual void \fBpaletteChange\fR ( const QPalette & )".br.in -1c.SH DESCRIPTIONA sophisticated single-page rich text viewer..PPUnlike QSimpleRichText, which merely draws small pieces of rich text, a QTextView is a real widget, with scrollbars when necessary, for showing large text documents..PPThe rendering style and available tags are defined by a styleSheet(). Currently, a small XML/CSS1 subset including embedded images is supported. See QStyleSheet for details. Possible images within the text document are resolved by using a QMimeSourceFactory. See setMimeSourceFactory() for details..PPUsing QTextView is quite similar to QLabel. It's mainly a call to setText() to set the contents. Setting the background color is slighty different from other widgets, since a text view is a scrollable widget that naturally provies 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..PPNote 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 and sufficient way to add reasonable online help facilities to applications. We will, however, extend it to some degree in future versions of Qt. Most likely some basic table support will be put in and a new class to provide rich text input..PPFor even more, like hypertext capabilities, see QTextBrowser..PPBugs and limitations:.TPNo selection possible. No table support (yet)..SH MEMBER FUNCTION DOCUMENTATION.SH "QTextView::QTextView ( QWidget * parent=0, const char * name=0 )"Constructs an empty QTextView with the standard \fIparent\fR and \fIname\fR optional arguments..SH "QTextView::QTextView ( const QString & text, const QString & context = QString::null, QWidget * parent=0, const char * name=0 )"Constructs a QTextView displaying the contents \fItext\fR with context \fIcontext,\fR with the standard \fIparent\fR and \fIname\fR optional arguments..SH "QTextView::~QTextView ()"Destructs the view..SH "QString QTextView::context () const \fC[virtual]\fR"Returns the context of the view..PPSee also: text() and setText()..SH "QString QTextView::documentTitle () const"Returns the document title parsed from the content..SH "void QTextView::drawContentsOffset ( QPainter * p, int ox, int oy, int cx, int cy, int cw, int ch ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QScrollView..SH "int QTextView::heightForWidth ( int w ) const \fC[virtual]\fR"Returns the height of the view given a width of \fIw.\fR.PPReimplemented from QWidget..SH "void QTextView::keyPressEvent ( QKeyEvent * e ) \fC[virtual protected]\fR"Provides scrolling and paging..PPReimplemented from QWidget..SH "const QColor& QTextView::linkColor () const"Returns the current link color..PPThe color may either have been set with setLinkColor() or stem from the document's body tag..PPSee also: setLinkColor()..SH "bool QTextView::linkUnderline () const"Returns wether or not links should be displayed underlined..SH "QMimeSourceFactory* QTextView::mimeSourceFactory () const"Returns the current mime source factory for the view..PPSee also: setMimeSourceFactory()..SH "void QTextView::paletteChange ( const QPalette & p ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "const QBrush& QTextView::paper ()"Returns the brush used to paint the background..SH "const QColorGroup& QTextView::paperColorGroup () const"Returns the colorgroup of the paper..PPSee also: setPaperColorGroup() and setPaper()..SH "void QTextView::resizeEvent ( QResizeEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "QRichText& QTextView::richText () const \fC[protected]\fR"Returns the document defining the view as drawable and querable rich text object. This is not currently useful for applications..SH "void QTextView::setLinkColor ( const QColor & col )"Sets the color used to display links in the document to \fCcol.\fR.PPSee also: linkColor()..SH "void QTextView::setLinkUnderline ( bool u )"Defines wether or not links should be displayed underlined..SH "void QTextView::setMimeSourceFactory ( QMimeSourceFactory * factory )"Sets the mime source factory for the view. The factory is used to resolve named references within rich text documents. If no factory has been specified, the text view uses the default factory QMimeSourceFactory::defaultFactory()..PPOwnership of \fIfactory\fR is \fInot\fR transferred to make it possible for several text view widgets to share the same mime source..PPSee also: mimeSourceFactory()..SH "void QTextView::setPaper ( const QBrush & pap )"Sets the brush to use as the background to \fIpap.\fR.PPThis may be a nice pergament or marble pixmap or simply another plain color..PPTechnically, setPaper() is just a convenience function to set the base brush of the paperColorGroup()..PPSee also: paper()..SH "void QTextView::setPaperColorGroup ( const QColorGroup & colgrp )"Sets the full colorgroup of the paper to \fIcolgrp.\fR If not specified otherwise in the document itself, any text will use QColorGroup::text(). The background will be painted with QColorGroup::brush(QColorGroup::Base)..PPSee also: paperColorGroup() and setPaper()..SH "void QTextView::setStyleSheet ( QStyleSheet * styleSheet )"Sets the style sheet of the view..PPSee also: styleSheet()..SH "void QTextView::setText ( const QString & text, const QString & context = QString::null ) \fC[virtual]\fR"Changes the contents of the view to the string \fItext\fR and the context to \fIcontext.\fR.PP\fItext\fR may be interpreted either as plain text or as rich text, depending on the textFormat(). The default setting is \fCAutoText,\fR i.e. the text view autodetects the format from \fItext.\fR.PPThe \fIcontext\fR is used to resolve references within the text document, for example image sources. It is passed directly to the mimeSourceFactory() when quering data..PPSee also: text() and setTextFormat()..PPReimplemented in QTextBrowser..SH "void QTextView::setTextFormat ( Qt::TextFormat format )"Sets the text format to \fIformat.\fR Possible choices are.TP\fCPlainText\fR - all characters are displayed verbatimely, including all blanks and linebreaks. Word wrap is availbe with the \fCWordBreak\fR alignment flag (see setAlignment() for details)..TP\fCRichText\fR - rich text rendering. The available styles are defined in the default stylesheet QStyleSheet::defaultSheet()..TP\fCAutoText\fR - this is also the default. The label autodetects which rendering style suits best, \fCPlainText\fR or \fCRichText.\fR Technically, this is done by using the QStyleSheet::mightBeRichText() heuristic..SH "QStyleSheet* QTextView::styleSheet () const"Returns the current style sheet of the view..PPSee also: setStyleSheet()..SH "QString QTextView::text () const \fC[virtual]\fR"Returns the contents of the view..PPSee also: context() and setText()..SH "Qt::TextFormat QTextView::textFormat() const"Returns the current text format..PPSee also: setTextFormat()..SH "void QTextView::viewportMouseMoveEvent ( QMouseEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QScrollView..SH "void QTextView::viewportMousePressEvent ( QMouseEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QScrollView..SH "void QTextView::viewportMouseReleaseEvent ( QMouseEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QScrollView..SH "void QTextView::viewportResizeEvent ( QResizeEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QScrollView..SH "SEE ALSO".BR http://www.troll.no/qt/qtextview.html.SH COPYRIGHTCopyright 1992-1999 Troll Tech AS. See the license file included inthe distribution for a complete license statement..SH AUTHORGenerated automatically from the source code.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -