📄 qwttext.3
字号:
.TH "QwtText" 3 "4 Nov 2003" "Qwt User's Guide" \" -*- nroff -*-.ad l.nh.SH NAMEQwtText \- .SH SYNOPSIS.br.PPInherited by \fBQwtPlainText\fP, and \fBQwtRichText\fP..PP.SH "Detailed Description".PP A virtual class to draw text. QwtText is an interface class for drawing plain and rich text. It provides also an interface for text classes that understand other text description languages such as LaTeX or LyX..PP\fBWarning:\fP.RS 4Rich text in Qt-2.3.x does not understand sub- and super-scripts. Qt-3.x.x does a better job in rendering mathematics. .RE.PP.PP.SS "Public Member Functions".in +1c.ti -1c.RI "virtual \fB~QwtText\fP ()".br.ti -1c.RI "virtual void \fBsetText\fP (const QString &)".br.ti -1c.RI "QString \fBtext\fP () const ".br.ti -1c.RI "bool \fBisNull\fP () const ".br.ti -1c.RI "bool \fBisEmpty\fP () const ".br.ti -1c.RI "bool \fBoperator!\fP () const ".br.ti -1c.RI "virtual void \fBsetFont\fP (const QFont &)".br.ti -1c.RI "QFont \fBfont\fP () const ".br.ti -1c.RI "QFontMetrics \fBfontMetrics\fP () const ".br.ti -1c.RI "virtual void \fBsetAlignment\fP (int align)".br.ti -1c.RI "int \fBalignment\fP () const ".br.ti -1c.RI "virtual void \fBsetColor\fP (const QColor &)".br.ti -1c.RI "QColor \fBcolor\fP () const ".br.ti -1c.RI "virtual void \fBsetRectPen\fP (const QPen &)".br.ti -1c.RI "QPen \fBrectPen\fP () const ".br.ti -1c.RI "virtual void \fBsetRectBrush\fP (const QBrush &)".br.ti -1c.RI "QBrush \fBrectBrush\fP () const ".br.ti -1c.RI "virtual int \fBheightForWidth\fP (int width) const =0".br.ti -1c.RI "virtual QRect \fBboundingRect\fP (QPainter *painter=0) const =0".br.ti -1c.RI "virtual void \fBdraw\fP (QPainter *painter, const QRect &rect) const =0".br.ti -1c.RI "virtual \fBQwtText\fP * \fBclone\fP () const =0".br.in -1c.SS "Static Public Member Functions".in +1c.ti -1c.RI "\fBQwtText\fP * \fBmakeText\fP (const QString &, Qt::TextFormat, int align, const QFont &, const QColor &color=QColor(), const QPen &pen=QPen(Qt::NoPen), const QBrush &brush=QBrush(Qt::NoBrush))".br.ti -1c.RI "\fBQwtText\fP * \fBmakeText\fP (const QString &, int align, const QFont &, const QColor &color=QColor(), const QPen &pen=QPen(Qt::NoPen), const QBrush &brush=QBrush(Qt::NoBrush))".br.ti -1c.RI "void \fBsetDefaultFormat\fP (Qt::TextFormat)".br.ti -1c.RI "Qt::TextFormat \fBdefaultFormat\fP ()".br.in -1c.SS "Protected Member Functions".in +1c.ti -1c.RI "\fBQwtText\fP (const QString &text, const QFont &, int align, const QColor &, const QPen &pen=QPen(Qt::NoPen), const QBrush &brush=QBrush(Qt::NoBrush))".br.in -1c.SH "Constructor & Destructor Documentation".PP .SS "QwtText::~\fBQwtText\fP ()\fC [virtual]\fP".PPDestructor. .SS "QwtText::QwtText (const QString & text, const QFont & font, int align, const QColor & color, const QPen & pen = QPen(Qt::NoPen), const QBrush & brush = QBrush(Qt::NoBrush))\fC [protected]\fP".PPConstructor. \fBParameters:\fP.RS 4\fItext\fP Text .br\fIfont\fP Font .br\fIalign\fP Alignment flags .br\fIcolor\fP Color .br\fIpen\fP Pen .br\fIbrush\fP Brush .RE.PP.SH "Member Function Documentation".PP .SS "int QwtText::alignment () const".PPGet the alignment flags. .SS "virtual QRect QwtText::boundingRect (QPainter * painter = 0) const\fC [pure virtual]\fP".PPReturns the bounding rectangle. The bounding rectangle is calculated with respect to (0, 0). The left and top border depend on the alignment flags:.IP "\(bu" 2the left border is at -width, -width/2 or 0 for Qt::AlignRight, Qt::AlignHCenter or Qt::AlignLeft respectively.IP "\(bu" 2the top border is at 0, -height/2 or -height for Qt::AlignTop, Qt::AlignVCenter or Qt::AlignBottom respectively.PP.PPUse for instance QRect::moveBy(x,y), before drawing the text into the rectangle. Implemented in \fBQwtPlainText\fP, and \fBQwtRichText\fP..SS "virtual \fBQwtText\fP* QwtText::clone () const\fC [pure virtual]\fP".PPCreate a clone Implemented in \fBQwtPlainText\fP, and \fBQwtRichText\fP..SS "QColor QwtText::color () const".PPReturn the color. .SS "Qt::TextFormat QwtText::defaultFormat ()\fC [static]\fP".PPReturn default format for the QwtText factory. .SS "virtual void QwtText::draw (QPainter * painter, const QRect & rect) const\fC [pure virtual]\fP".PPDraw the text in a clipping rectangle. \fBParameters:\fP.RS 4\fIpainter\fP Painter .br\fIrect\fP Clipping rectangle .RE.PPImplemented in \fBQwtPlainText\fP, and \fBQwtRichText\fP..SS "QFont QwtText::font () const".PPReturn the font. .SS "QFontMetrics QwtText::fontMetrics () const".PPReturn the font metrics. .SS "virtual int QwtText::heightForWidth (int width) const\fC [pure virtual]\fP".PPFind the height for a given width. \fBParameters:\fP.RS 4\fIwidth\fP Width .RE.PP\fBReturns:\fP.RS 4height Height .RE.PPImplemented in \fBQwtPlainText\fP, and \fBQwtRichText\fP..SS "\fBQwtText\fP * QwtText::makeText (const QString & text, int align, const QFont & font, const QColor & color = QColor(), const QPen & pen = QPen(Qt::NoPen), const QBrush & brush = QBrush(Qt::NoBrush))\fC [static]\fP".PPFactory function for QwtText objects. Creates a text according to \fBQwtText::defaultFormat()\fP.PP\fBParameters:\fP.RS 4\fItext\fP Contents of the text .br\fIalign\fP Or'd values of Qt::AlignmentFlags for drawing the text .br\fIfont\fP Font of the text .br\fIcolor\fP Color of the text .br\fIpen\fP Pen to draw the enclosing rectangle .br\fIbrush\fP Brush to draw the enclosing rectangle .RE.PP\fBReturns:\fP.RS 4Pointer to a new \fBQwtPlainText\fP or \fBQwtRichText\fP object .RE.PP\fBSee also:\fP.RS 4\fBQwtText::defaultFormat\fP, \fBQwtText::setDefaultFormat\fP .RE.PP.SS "\fBQwtText\fP * QwtText::makeText (const QString & text, Qt::TextFormat format, int align, const QFont & font, const QColor & color = QColor(), const QPen & pen = QPen(Qt::NoPen), const QBrush & brush = QBrush(Qt::NoBrush))\fC [static]\fP".PPFactory function for QwtText objects..PP\fBParameters:\fP.RS 4\fItext\fP Contents of the text .br\fIformat\fP Format of the text .br\fIalign\fP Or'd values of Qt::AlignmentFlags for drawing the text .br\fIfont\fP Font of the text .br\fIcolor\fP Color of the text .br\fIpen\fP Pen to draw the enclosing rectangle .br\fIbrush\fP Brush to draw the enclosing rectangle .RE.PP\fBReturns:\fP.RS 4Pointer to a new \fBQwtPlainText\fP or \fBQwtRichText\fP object .RE.PP.SS "QBrush QwtText::rectBrush () const".PPReturn the rectangle brush. .SS "QPen QwtText::rectPen () const".PPReturn the rectangle pen. .SS "void QwtText::setAlignment (int align)\fC [virtual]\fP".PPSet the alignment flags. .PP\fBParameters:\fP.RS 4\fIalign\fP Or'd Qt::Alignment flags .RE.PPReimplemented in \fBQwtRichText\fP..SS "void QwtText::setColor (const QColor &)\fC [virtual]\fP".PPSet the color. .SS "void QwtText::setDefaultFormat (Qt::TextFormat)\fC [static]\fP".PPSet the default format for the QwtText factory. .SS "void QwtText::setFont (const QFont &)\fC [virtual]\fP".PPSet the font. Reimplemented in \fBQwtRichText\fP..SS "void QwtText::setRectBrush (const QBrush &)\fC [virtual]\fP".PPSet the rectangle brush. .SS "void QwtText::setRectPen (const QPen &)\fC [virtual]\fP".PPSet the rectangle pen. .SS "void QwtText::setText (const QString &)\fC [virtual]\fP".PPSet the text. Reimplemented in \fBQwtRichText\fP..SS "QString QwtText::text () const".PPReturn the text. .SH "Author".PP Generated automatically by Doxygen for Qwt User's Guide from the source code.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -