📄 qwttext.3
字号:
.TH "QwtText" 3 "16 Nov 2004" "Version 4.2.0" "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.PPDefinition at line 35 of file qwt_text.h..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 "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. .PPDefinition at line 44 of file qwt_text.cpp..SS "QwtText::QwtText (const QString & text, const QFont & font, int align, const QColor & color, const QPen & pen = \fCQPen(Qt::NoPen)\fP, const QBrush & brush = \fCQBrush(Qt::NoBrush)\fP)\fC [protected]\fP".PPConstructor. .PP\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.PPDefinition at line 31 of file qwt_text.cpp..SH "Member Function Documentation".PP .SS "int QwtText::alignment () const".PPGet the alignment flags. .PPDefinition at line 151 of file qwt_text.cpp..PPReferenced by QwtRichText::boundingRect(), QwtPlainText::boundingRect(), QwtRichText::clone(), QwtPlainText::clone(), QwtRichText::draw(), QwtPlainText::draw(), QwtScale::drawTitle(), QwtPlainText::heightForWidth(), QwtMarker::setLabel(), QwtRichText::setText(), QwtScale::setTitle(), and QwtScale::titleAlignment()..SS "virtual QRect QwtText::boundingRect (QPainter * painter = \fC0\fP) const\fC [pure virtual]\fP".PPReturns the bounding rectangle. .PPThe 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. .PPImplemented in \fBQwtPlainText\fP, and \fBQwtRichText\fP..PPReferenced by QwtMarker::draw(), QwtPicker::drawCursorLabel(), and QwtPushButton::heightForWidth()..SS "virtual \fBQwtText\fP* QwtText::clone () const\fC [pure virtual]\fP".PPCreate a clone .PPImplemented in \fBQwtPlainText\fP, and \fBQwtRichText\fP..PPReferenced by QwtMarker::operator=(), and QwtMarker::QwtMarker()..SS "QColor QwtText::color () const".PPReturn the color. .PPDefinition at line 163 of file qwt_text.cpp..PPReferenced by QwtRichText::clone(), QwtPlainText::clone(), QwtRichText::draw(), QwtPlainText::draw(), QwtMarker::labelColor(), QwtMarker::labelPen(), QwtMarker::setLabel(), QwtMarker::setLabelColor(), QwtMarker::setLabelPen(), QwtMarker::setLabelText(), QwtScale::setTitle(), and QwtScale::titleColor()..SS "Qt::TextFormat QwtText::defaultFormat ()\fC [static]\fP".PPReturn default format for the QwtText factory. .PPDefinition at line 105 of file qwt_text.cpp..SS "virtual void QwtText::draw (QPainter * painter, const QRect & rect) const\fC [pure virtual]\fP".PPDraw the text in a clipping rectangle. .PP\fBParameters:\fP.RS 4\fIpainter\fP Painter .br\fIrect\fP Clipping rectangle .RE.PP.PPImplemented in \fBQwtPlainText\fP, and \fBQwtRichText\fP..PPReferenced by QwtMarker::draw(), QwtPicker::drawCursorLabel(), QwtLegendItem::drawItem(), QwtScale::drawTitle(), and QwtPlot::printTitle()..SS "QFont QwtText::font () const".PPReturn the font. .PPDefinition at line 130 of file qwt_text.cpp..PPReferenced by QwtRichText::boundingRect(), QwtPlainText::boundingRect(), QwtRichText::clone(), QwtPlainText::clone(), QwtRichText::draw(), QwtPlainText::draw(), QwtMarker::font(), QwtRichText::heightForWidth(), QwtRichText::setAlignment(), QwtMarker::setFont(), QwtMarker::setLabel(), QwtMarker::setLabelText(), QwtRichText::setText(), QwtScale::setTitle(), QwtScale::setTitleFont(), and QwtScale::titleFont()..SS "QFontMetrics QwtText::fontMetrics () const".PPReturn the font metrics. .PPDefinition at line 136 of file qwt_text.cpp..PPReferenced by QwtPlainText::boundingRect(), and QwtPlainText::heightForWidth()..SS "virtual int QwtText::heightForWidth (int width) const\fC [pure virtual]\fP".PPFind the height for a given width. .PP\fBParameters:\fP.RS 4\fIwidth\fP Width .RE.PP\fBReturns:\fP.RS 4height Height .RE.PP.PPImplemented in \fBQwtPlainText\fP, and \fBQwtRichText\fP..PPReferenced by QwtPushButton::heightForWidth(), and QwtScale::titleHeightForWidth()..SS "\fBQwtText\fP * QwtText::makeText (const QString & text, int align, const QFont & font, const QColor & color = \fCQColor()\fP, const QPen & pen = \fCQPen(Qt::NoPen)\fP, const QBrush & brush = \fCQBrush(Qt::NoBrush)\fP)\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.PPDefinition at line 61 of file qwt_text.cpp..PPReferences makeText()..SS "\fBQwtText\fP * QwtText::makeText (const QString & text, Qt::TextFormat format, int align, const QFont & font, const QColor & color = \fCQColor()\fP, const QPen & pen = \fCQPen(Qt::NoPen)\fP, const QBrush & brush = \fCQBrush(Qt::NoBrush)\fP)\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.PPDefinition at line 81 of file qwt_text.cpp..PPReferenced by QwtPicker::drawCursorLabel(), QwtPushButton::heightForWidth(), makeText(), QwtPlot::printTitle(), QwtMarker::QwtMarker(), QwtMarker::setLabel(), QwtScale::setTitle(), QwtLegendLabel::titleText(), and QwtLegendButton::titleText()..SS "QBrush QwtText::rectBrush () const".PPReturn the rectangle brush. .PPDefinition at line 187 of file qwt_text.cpp..PPReferenced by QwtRichText::clone(), QwtPlainText::clone(), QwtRichText::draw(), QwtPlainText::draw(), QwtMarker::setLabel(), and QwtMarker::setLabelText()..SS "QPen QwtText::rectPen () const".PPReturn the rectangle pen. .PPDefinition at line 175 of file qwt_text.cpp..PPReferenced by QwtRichText::clone(), QwtPlainText::clone(), QwtRichText::draw(), QwtPlainText::draw(), QwtMarker::setLabel(), and QwtMarker::setLabelText()..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.PP.PPReimplemented in \fBQwtRichText\fP..PPDefinition at line 145 of file qwt_text.cpp..PPReferenced by QwtScale::drawTitle(), QwtRichText::setAlignment(), and QwtScale::setTitleAlignment()..SS "void QwtText::setColor (const QColor &)\fC [virtual]\fP".PPSet the color. .PPDefinition at line 157 of file qwt_text.cpp..PPReferenced by QwtMarker::setLabelColor(), QwtMarker::setLabelPen(), and QwtScale::setTitleColor()..SS "void QwtText::setDefaultFormat (Qt::TextFormat)\fC [static]\fP".PPSet the default format for the QwtText factory. .PPDefinition at line 99 of file qwt_text.cpp..SS "void QwtText::setFont (const QFont &)\fC [virtual]\fP".PPSet the font. .PPReimplemented in \fBQwtRichText\fP..PPDefinition at line 123 of file qwt_text.cpp..PPReferenced by QwtRichText::setFont(), QwtMarker::setFont(), and QwtScale::setTitleFont()..SS "void QwtText::setRectBrush (const QBrush &)\fC [virtual]\fP".PPSet the rectangle brush. .PPDefinition at line 181 of file qwt_text.cpp..SS "void QwtText::setRectPen (const QPen &)\fC [virtual]\fP".PPSet the rectangle pen. .PPDefinition at line 169 of file qwt_text.cpp..SS "void QwtText::setText (const QString &)\fC [virtual]\fP".PPSet the text. .PPReimplemented in \fBQwtRichText\fP..PPDefinition at line 111 of file qwt_text.cpp..PPReferenced by QwtRichText::setText()..SS "QString QwtText::text () const".PPReturn the text. .PPDefinition at line 117 of file qwt_text.cpp..PPReferenced by QwtPlainText::boundingRect(), QwtRichText::clone(), QwtPlainText::clone(), QwtScale::dimForLength(), QwtPlainText::draw(), QwtMarker::draw(), QwtPlainText::heightForWidth(), QwtMarker::label(), QwtRichText::setAlignment(), QwtMarker::setLabel(), and QwtScale::title()..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 + -