Public Member Functions | Protected Member Functions

QwtTextEngine Class Reference

Abstract base class for rendering text strings. More...

#include <qwt_text_engine.h>

Inheritance diagram for QwtTextEngine:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~QwtTextEngine ()
 Destructor.
virtual int heightForWidth (const QFont &font, int flags, const QString &text, int width) const =0
virtual QSize textSize (const QFont &font, int flags, const QString &text) const =0
virtual bool mightRender (const QString &text) const =0
virtual void textMargins (const QFont &font, const QString &text, int &left, int &right, int &top, int &bottom) const =0
virtual void draw (QPainter *painter, const QRect &rect, int flags, const QString &text) const =0

Protected Member Functions

 QwtTextEngine ()
 Constructor.

Detailed Description

Abstract base class for rendering text strings.

A text engine is responsible for rendering texts for a specific text format. They are used by QwtText to render a text.

QwtPlainTextEngine and QwtRichTextEngine are part of the Qwt library.

QwtMathMLTextEngine can be found in Qwt MathML extension, that needs the MathML renderer of the Qt solutions package. Unfortunately it is only available with a commercial Qt license.

See also:
QwtText::setTextEngine()

Definition at line 38 of file qwt_text_engine.h.


Constructor & Destructor Documentation

QwtTextEngine::~QwtTextEngine (  ) [virtual]

Destructor.

Definition at line 175 of file qwt_text_engine.cpp.

{
}
QwtTextEngine::QwtTextEngine (  ) [protected]

Constructor.

Definition at line 170 of file qwt_text_engine.cpp.

{
}

Member Function Documentation

virtual void QwtTextEngine::draw ( QPainter *  painter,
const QRect &  rect,
int  flags,
const QString &  text 
) const [pure virtual]

Draw the text in a clipping rectangle

Parameters:
painterPainter
rectClipping rectangle
flagsBitwise OR of the flags like in for QPainter::drawText
textText to be rendered

Implemented in QwtPlainTextEngine, and QwtRichTextEngine.

Referenced by QwtText::draw().

virtual int QwtTextEngine::heightForWidth ( const QFont &  font,
int  flags,
const QString &  text,
int  width 
) const [pure virtual]

Find the height for a given width

Parameters:
fontFont of the text
flagsBitwise OR of the flags used like in QPainter::drawText
textText to be rendered
widthWidth
Returns:
Calculated height

Implemented in QwtPlainTextEngine, and QwtRichTextEngine.

Referenced by QwtText::heightForWidth().

virtual bool QwtTextEngine::mightRender ( const QString &  text ) const [pure virtual]

Test if a string can be rendered by this text engine

Parameters:
textText to be tested
Returns:
true, if it can be rendered

Implemented in QwtPlainTextEngine, and QwtRichTextEngine.

Referenced by QwtTextEngineDict::textEngine().

virtual void QwtTextEngine::textMargins ( const QFont &  font,
const QString &  text,
int &  left,
int &  right,
int &  top,
int &  bottom 
) const [pure virtual]

Return margins around the texts

The textSize might include margins around the text, like QFontMetrics::descent. In situations where texts need to be aligend in detail, knowing these margins might improve the layout calculations.

Parameters:
fontFont of the text
textText to be rendered
leftReturn value for the left margin
rightReturn value for the right margin
topReturn value for the top margin
bottomReturn value for the bottom margin

Implemented in QwtPlainTextEngine, and QwtRichTextEngine.

Referenced by QwtText::draw(), QwtText::heightForWidth(), and QwtText::textSize().

virtual QSize QwtTextEngine::textSize ( const QFont &  font,
int  flags,
const QString &  text 
) const [pure virtual]

Returns the size, that is needed to render text

Parameters:
fontFont of the text
flagsBitwise OR of the flags like in for QPainter::drawText
textText to be rendered
Returns:
Caluclated size

Implemented in QwtPlainTextEngine, and QwtRichTextEngine.

Referenced by QwtText::textSize().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines