.TH "QwtText" 3 "Mon Aug 1 2011" "Version 5.2.2" "Qwt User's Guide" \" -*- nroff -*- .ad l .nh .SH NAME QwtText \- .PP A class representing a text. .SH SYNOPSIS .br .PP .PP \fC#include \fP .SS "Public Types" .in +1c .ti -1c .RI "enum \fBLayoutAttribute\fP { \fBMinimumLayout\fP = 1 }" .br .ti -1c .RI "enum \fBPaintAttribute\fP { \fBPaintUsingTextFont\fP = 1, \fBPaintUsingTextColor\fP = 2, \fBPaintBackground\fP = 4 }" .br .ti -1c .RI "enum \fBTextFormat\fP { \fBAutoText\fP = 0, \fBPlainText\fP, \fBRichText\fP, \fBMathMLText\fP, \fBTeXText\fP, \fBOtherFormat\fP = 100 }" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "QBrush \fBbackgroundBrush\fP () const " .br .ti -1c .RI "QPen \fBbackgroundPen\fP () const " .br .ti -1c .RI "QColor \fBcolor\fP () const " .br .ti -1c .RI "void \fBdraw\fP (QPainter *painter, const QRect &rect) const " .br .ti -1c .RI "QFont \fBfont\fP () const " .br .ti -1c .RI "int \fBheightForWidth\fP (int width, const QFont &=QFont()) const " .br .ti -1c .RI "bool \fBisEmpty\fP () const " .br .ti -1c .RI "bool \fBisNull\fP () const " .br .ti -1c .RI "int \fBoperator!=\fP (const \fBQwtText\fP &) const " .br .ti -1c .RI "\fBQwtText\fP & \fBoperator=\fP (const \fBQwtText\fP &)" .br .ti -1c .RI "int \fBoperator==\fP (const \fBQwtText\fP &) const " .br .ti -1c .RI "\fBQwtText\fP (const \fBQwtText\fP &)" .br .ti -1c .RI "\fBQwtText\fP (const QString &=QString::null, \fBTextFormat\fP textFormat=AutoText)" .br .ti -1c .RI "int \fBrenderFlags\fP () const " .br .ti -1c .RI "void \fBsetBackgroundBrush\fP (const QBrush &)" .br .ti -1c .RI "void \fBsetBackgroundPen\fP (const QPen &)" .br .ti -1c .RI "void \fBsetColor\fP (const QColor &)" .br .ti -1c .RI "void \fBsetFont\fP (const QFont &)" .br .ti -1c .RI "void \fBsetLayoutAttribute\fP (\fBLayoutAttribute\fP, bool on=true)" .br .ti -1c .RI "void \fBsetPaintAttribute\fP (\fBPaintAttribute\fP, bool on=true)" .br .ti -1c .RI "void \fBsetRenderFlags\fP (int flags)" .br .ti -1c .RI "void \fBsetText\fP (const QString &, \fBQwtText::TextFormat\fP textFormat=AutoText)" .br .ti -1c .RI "bool \fBtestLayoutAttribute\fP (\fBLayoutAttribute\fP) const " .br .ti -1c .RI "bool \fBtestPaintAttribute\fP (\fBPaintAttribute\fP) const " .br .ti -1c .RI "QString \fBtext\fP () const " .br .ti -1c .RI "QSize \fBtextSize\fP (const QFont &=QFont()) const " .br .ti -1c .RI "QColor \fBusedColor\fP (const QColor &) const " .br .ti -1c .RI "QFont \fBusedFont\fP (const QFont &) const " .br .ti -1c .RI "\fB~QwtText\fP ()" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static void \fBsetTextEngine\fP (\fBQwtText::TextFormat\fP, \fBQwtTextEngine\fP *)" .br .ti -1c .RI "static const \fBQwtTextEngine\fP * \fBtextEngine\fP (const QString &text, \fBQwtText::TextFormat\fP=AutoText)" .br .ti -1c .RI "static const \fBQwtTextEngine\fP * \fBtextEngine\fP (\fBQwtText::TextFormat\fP)" .br .in -1c .SH "Detailed Description" .PP A class representing a text. A \fBQwtText\fP is a text including a set of attributes how to render it. .PP .IP "\(bu" 2 Format .br A text might include control sequences (f.e tags) describing how to render it. Each format (f.e MathML, TeX, Qt Rich Text) has its own set of control sequences, that can be handles by a \fBQwtTextEngine\fP for this format. .IP "\(bu" 2 Background .br A text might have a background, defined by a QPen and QBrush to improve its visibility. .IP "\(bu" 2 Font .br A text might have an individual font. .IP "\(bu" 2 Color .br A text might have an individual color. .IP "\(bu" 2 Render Flags .br Flags from Qt::AlignmentFlag and Qt::TextFlag used like in QPainter::drawText. .PP .PP \fBSee also:\fP .RS 4 \fBQwtTextEngine\fP, \fBQwtTextLabel\fP .RE .PP .SH "Member Enumeration Documentation" .PP .SS "enum \fBQwtText::LayoutAttribute\fP" .PP Layout Attributes. The layout attributes affects some aspects of the layout of the text. .PP .IP "\(bu" 2 MinimumLayout .br Layout the text without its margins. This mode is useful if a text needs to be aligned accurately, like the tick labels of a scale. If \fBQwtTextEngine::textMargins\fP is not implemented for the format of the text, MinimumLayout has no effect. .PP .SS "enum \fBQwtText::PaintAttribute\fP" .PP Paint Attributes. Font and color and background are optional attributes of a \fBQwtText\fP. The paint attributes hold the information, if they are set. .PP .IP "\(bu" 2 PaintUsingTextFont .br The text has an individual font. .IP "\(bu" 2 PaintUsingTextColor .br The text has an individual color. .IP "\(bu" 2 PaintBackground .br The text has an individual background. .PP .SS "enum \fBQwtText::TextFormat\fP" .PP Text format. The text format defines the \fBQwtTextEngine\fP, that is used to render the text. .PP .IP "\(bu" 2 AutoText .br The text format is determined using \fBQwtTextEngine::mightRender\fP for all available text engines in increasing order > PlainText. If none of the text engines can render the text is rendered like PlainText. .IP "\(bu" 2 PlainText .br Draw the text as it is, using a \fBQwtPlainTextEngine\fP. .IP "\(bu" 2 RichText .br Use the Scribe framework (Qt Rich Text) to render the text. .IP "\(bu" 2 MathMLText .br Use a MathML (http://en.wikipedia.org/wiki/MathML) render engine to display the text. The Qwt MathML extension offers such an engine based on the MathML renderer of the Qt solutions package. Unfortunately it is only available for owners of a commercial Qt license. .IP "\(bu" 2 TeXText .br Use a TeX (http://en.wikipedia.org/wiki/TeX) render engine to display the text. .IP "\(bu" 2 OtherFormat .br The number of text formats can be extended using setTextEngine. Formats >= OtherFormat are not used by Qwt. .PP .PP \fBSee also:\fP .RS 4 \fBQwtTextEngine\fP, \fBsetTextEngine()\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "QwtText::QwtText (const QString &text = \fCQString::null\fP, \fBQwtText::TextFormat\fPtextFormat = \fCAutoText\fP)"Constructor .PP \fBParameters:\fP .RS 4 \fItext\fP Text content .br \fItextFormat\fP Text format .RE .PP .SS "QwtText::QwtText (const \fBQwtText\fP &other)" .PP Copy constructor. .SS "QwtText::~QwtText ()" .PP Destructor. .SH "Member Function Documentation" .PP .SS "QBrush QwtText::backgroundBrush () const"\fBReturns:\fP .RS 4 Background brush .RE .PP \fBSee also:\fP .RS 4 \fBsetBackgroundBrush()\fP, \fBbackgroundPen()\fP .RE .PP .SS "QPen QwtText::backgroundPen () const"\fBReturns:\fP .RS 4 Background pen .RE .PP \fBSee also:\fP .RS 4 \fBsetBackgroundPen()\fP, \fBbackgroundBrush()\fP .RE .PP .SS "QColor QwtText::color () const" .PP Return the pen color, used for painting the text. .SS "void QwtText::draw (QPainter *painter, const QRect &rect) const"Draw a text into a rectangle .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .br \fIrect\fP Rectangle .RE .PP .SS "QFont QwtText::font () const" .PP Return the font. .SS "int QwtText::heightForWidth (intwidth, const QFont &defaultFont = \fCQFont()\fP) const"Find the height for a given width .PP \fBParameters:\fP .RS 4 \fIdefaultFont\fP Font, used for the calculation if the text has no font .br \fIwidth\fP Width .RE .PP \fBReturns:\fP .RS 4 Calculated height .RE .PP .SS "bool QwtText::isEmpty () const\fC [inline]\fP"\fBReturns:\fP .RS 4 \fBtext()\fP.\fBisEmpty()\fP .RE .PP .SS "bool QwtText::isNull () const\fC [inline]\fP"\fBReturns:\fP .RS 4 \fBtext()\fP.\fBisNull()\fP .RE .PP .SS "int QwtText::operator!= (const \fBQwtText\fP &other) const" .PP Relational operator. .SS "\fBQwtText\fP & QwtText::operator= (const \fBQwtText\fP &other)" .PP Assignment operator. .SS "int QwtText::operator== (const \fBQwtText\fP &other) const" .PP Relational operator. .SS "int QwtText::renderFlags () const"\fBReturns:\fP .RS 4 Render flags .RE .PP \fBSee also:\fP .RS 4 \fBsetRenderFlags()\fP .RE .PP .SS "void QwtText::setBackgroundBrush (const QBrush &brush)"Set the background brush .PP \fBParameters:\fP .RS 4 \fIbrush\fP Background brush .RE .PP \fBSee also:\fP .RS 4 \fBbackgroundBrush()\fP, \fBsetBackgroundPen()\fP .RE .PP .SS "void QwtText::setBackgroundPen (const QPen &pen)"Set the background pen .PP \fBParameters:\fP .RS 4 \fIpen\fP Background pen .RE .PP \fBSee also:\fP .RS 4 \fBbackgroundPen()\fP, \fBsetBackgroundBrush()\fP .RE .PP .SS "void QwtText::setColor (const QColor &color)"Set the pen color used for painting the text. .PP \fBParameters:\fP .RS 4 \fIcolor\fP Color .RE .PP \fBNote:\fP .RS 4 Setting the color might have no effect, when the text contains control sequences for setting colors. .RE .PP .SS "void QwtText::setFont (const QFont &font)"Set the font. .PP \fBParameters:\fP .RS 4 \fIfont\fP Font .RE .PP \fBNote:\fP .RS 4 Setting the font might have no effect, when the text contains control sequences for setting fonts. .RE .PP .SS "void QwtText::setLayoutAttribute (\fBLayoutAttribute\fPattribute, boolon = \fCtrue\fP)"Change a layout attribute .PP \fBParameters:\fP .RS 4 \fIattribute\fP Layout attribute .br \fIon\fP On/Off .RE .PP \fBSee also:\fP .RS 4 \fBtestLayoutAttribute()\fP .RE .PP .SS "void QwtText::setPaintAttribute (\fBPaintAttribute\fPattribute, boolon = \fCtrue\fP)"Change a paint attribute .PP \fBParameters:\fP .RS 4 \fIattribute\fP Paint attribute .br \fIon\fP On/Off .RE .PP \fBNote:\fP .RS 4 Used by \fBsetFont()\fP, \fBsetColor()\fP, \fBsetBackgroundPen()\fP and \fBsetBackgroundBrush()\fP .RE .PP \fBSee also:\fP .RS 4 \fBtestPaintAttribute()\fP .RE .PP .SS "void QwtText::setRenderFlags (intrenderFlags)" .PP Change the render flags. The default setting is Qt::AlignCenter .PP \fBParameters:\fP .RS 4 \fIrenderFlags\fP Bitwise OR of the flags used like in QPainter::drawText .RE .PP \fBSee also:\fP .RS 4 \fBrenderFlags()\fP, \fBQwtTextEngine::draw()\fP .RE .PP \fBNote:\fP .RS 4 Some renderFlags might have no effect, depending on the text format. .RE .PP .SS "void QwtText::setText (const QString &text, \fBQwtText::TextFormat\fPtextFormat = \fCAutoText\fP)"Assign a new text content .PP \fBParameters:\fP .RS 4 \fItext\fP Text content .br \fItextFormat\fP Text format .RE .PP \fBSee also:\fP .RS 4 \fBtext()\fP .RE .PP .SS "void QwtText::setTextEngine (\fBQwtText::TextFormat\fPformat, \fBQwtTextEngine\fP *engine)\fC [static]\fP"Assign/Replace a text engine for a text format .PP With setTextEngine it is possible to extend Qwt with other types of text formats. .PP Owner of a commercial Qt license can build the qwtmathml library, that is based on the MathML renderer, that is included in MML Widget component of the Qt solutions package. .PP For QwtText::PlainText it is not allowed to assign a engine == NULL. .PP \fBParameters:\fP .RS 4 \fIformat\fP Text format .br \fIengine\fP Text engine .RE .PP \fBSee also:\fP .RS 4 \fBQwtMathMLTextEngine\fP .RE .PP \fBWarning:\fP .RS 4 Using QwtText::AutoText does nothing. .RE .PP .SS "bool QwtText::testLayoutAttribute (\fBLayoutAttribute\fPattribute) const"Test a layout attribute .PP \fBParameters:\fP .RS 4 \fIattribute\fP Layout attribute .RE .PP \fBReturns:\fP .RS 4 true, if attribute is enabled .RE .PP \fBSee also:\fP .RS 4 \fBsetLayoutAttribute()\fP .RE .PP .SS "bool QwtText::testPaintAttribute (\fBPaintAttribute\fPattribute) const"Test a paint attribute .PP \fBParameters:\fP .RS 4 \fIattribute\fP Paint attribute .RE .PP \fBReturns:\fP .RS 4 true, if attribute is enabled .RE .PP \fBSee also:\fP .RS 4 \fBsetPaintAttribute()\fP .RE .PP .SS "QString QwtText::text () const"Return the text. .PP \fBSee also:\fP .RS 4 \fBsetText()\fP .RE .PP .SS "const \fBQwtTextEngine\fP * QwtText::textEngine (\fBQwtText::TextFormat\fPformat)\fC [static]\fP" .PP Find the text engine for a text format. textEngine can be used to find out if a text format is supported. F.e, if one wants to use MathML labels, the MathML renderer from the commercial Qt solutions package might be required, that is not available in Qt Open Source Edition environments. .PP \fBParameters:\fP .RS 4 \fIformat\fP Text format .RE .PP \fBReturns:\fP .RS 4 The text engine, or NULL if no engine is available. .RE .PP .SS "const \fBQwtTextEngine\fP * QwtText::textEngine (const QString &text, \fBQwtText::TextFormat\fPformat = \fCAutoText\fP)\fC [static]\fP"Find the text engine for a text format .PP In case of QwtText::AutoText the first text engine (beside \fBQwtPlainTextEngine\fP) is returned, where \fBQwtTextEngine::mightRender\fP returns true. If there is none \fBQwtPlainTextEngine\fP is returnd. .PP If no text engine is registered for the format \fBQwtPlainTextEngine\fP is returnd. .PP \fBParameters:\fP .RS 4 \fItext\fP Text, needed in case of AutoText .br \fIformat\fP Text format .RE .PP .SS "QSize QwtText::textSize (const QFont &defaultFont = \fCQFont()\fP) const"Find the height for a given width .PP \fBParameters:\fP .RS 4 \fIdefaultFont\fP Font, used for the calculation if the text has no font .RE .PP \fBReturns:\fP .RS 4 Calculated height .RE .PP Returns the size, that is needed to render text .PP \fBParameters:\fP .RS 4 \fIdefaultFont\fP Font of the text .RE .PP \fBReturns:\fP .RS 4 Caluclated size .RE .PP .SS "QColor QwtText::usedColor (const QColor &defaultColor) const"Return the color of the text, if it has one. Otherwise return defaultColor. .PP \fBParameters:\fP .RS 4 \fIdefaultColor\fP Default color .RE .PP \fBSee also:\fP .RS 4 \fBsetColor()\fP, \fBcolor()\fP, PaintAttributes .RE .PP .SS "QFont QwtText::usedFont (const QFont &defaultFont) const"Return the font of the text, if it has one. Otherwise return defaultFont. .PP \fBParameters:\fP .RS 4 \fIdefaultFont\fP Default font .RE .PP \fBSee also:\fP .RS 4 \fBsetFont()\fP, \fBfont()\fP, PaintAttributes .RE .PP .SH "Author" .PP Generated automatically by Doxygen for Qwt User's Guide from the source code.