# QwtPlainTextEngine Class Reference

Inheritance diagram for QwtPlainTextEngine:

[legend]
Collaboration diagram for QwtPlainTextEngine:

[legend]
List of all members.

## Detailed Description

A text engine for plain texts.

QwtPlainTextEngine renders texts using the basic Qt classes QPainter and QFontMetrics.

Definition at line 116 of file qwt_text_engine.h.

## Public Member Functions

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

## Constructor & Destructor Documentation

QwtPlainTextEngine::QwtPlainTextEngine | ( |  | ) |

Constructor.

Definition at line 180 of file qwt_text_engine.cpp.

QwtPlainTextEngine::~QwtPlainTextEngine | ( |  | ) | `[virtual]`

Destructor.

Definition at line 186 of file qwt_text_engine.cpp.

## Member Function Documentation

int QwtPlainTextEngine::heightForWidth | ( | const QFont & | font,
|  | int | flags,
|  | const QString & | text,
|  | int | width |
| ) |  |  | const`[virtual]`

Find the height for a given width

Parameters:

  | font | Font of the text
  | flags | Bitwise OR of the flags used like in QPainter::drawText
  | text | Text to be rendered
  | width | Width

Returns:
  Calculated height

Implements QwtTextEngine.

Definition at line 201 of file qwt_text_engine.cpp.

QSize QwtPlainTextEngine::textSize | ( | const QFont & | font,
|  | int | flags,
|  | const QString & | text |
| ) |  |  | const`[virtual]`

Returns the size, that is needed to render text

Parameters:

  | font | Font of the text
  | flags | Bitwise OR of the flags used like in QPainter::drawText
  | text | Text to be rendered

Returns:
  Caluclated size

Implements QwtTextEngine.

Definition at line 220 of file qwt_text_engine.cpp.

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

Draw the text in a clipping rectangle.

A wrapper for QPainter::drawText.

Parameters:

  | painter | Painter
  | rect | Clipping rectangle
  | flags | Bitwise OR of the flags used like in QPainter::drawText
  | text | Text to be rendered

Implements QwtTextEngine.

Definition at line 259 of file qwt_text_engine.cpp.

References QwtPainter::drawText().

bool QwtPlainTextEngine::mightRender | ( | const QString & |  | ) | const`[virtual]`

Test if a string can be rendered by this text engine.

Returns:
  Always true. All texts can be rendered by QwtPlainTextEngine

Implements QwtTextEngine.

Definition at line 269 of file qwt_text_engine.cpp.

void QwtPlainTextEngine::textMargins | ( | const QFont & | font,
|  | const QString & | ,
|  | int & | left,
|  | int & | right,
|  | int & | top,
|  | int & | bottom |
| ) |  |  | const`[virtual]`

Return margins around the texts

Parameters:

  | font | Font of the text
  | left | Return 0
  | right | Return 0
  | top | Return value for the top margin
  | bottom | Return value for the bottom margin

Implements QwtTextEngine.

Definition at line 239 of file qwt_text_engine.cpp.