Implements the FontMetrics interface for the Qt rendering backend.
More...
#include <QtFontMetrics.hpp>
Implements the FontMetrics interface for the Qt rendering backend.
QtFontMetrics is implemented by wrapping a corresponding QFontMetrics instance created for the font specified by setFont(). For more information about QFontMetrics and the Qt Toolkit see [QTDOC].
◆ QtFontMetrics() [1/2]
| CDPL::Vis::QtFontMetrics::QtFontMetrics |
( |
QPaintDevice * |
paint_dev = 0 | ) |
|
Constructs a font metrics object for Qt's default font and the given paint device.
- Parameters
-
| paint_dev | A pointer to the Qt paint device, or null if unspecified. |
◆ QtFontMetrics() [2/2]
| CDPL::Vis::QtFontMetrics::QtFontMetrics |
( |
const QtFontMetrics & |
| ) |
|
|
delete |
◆ ~QtFontMetrics()
| CDPL::Vis::QtFontMetrics::~QtFontMetrics |
( |
| ) |
|
◆ operator=()
◆ setFont()
| void CDPL::Vis::QtFontMetrics::setFont |
( |
const Font & |
font | ) |
|
|
virtual |
Specifies the font to use for the calculation of text metrics.
- Parameters
-
| font | The font used for the calculation of text metrics. |
Implements CDPL::Vis::FontMetrics.
◆ getAscent()
| double CDPL::Vis::QtFontMetrics::getAscent |
( |
| ) |
const |
|
virtual |
Returns the ascent of the current font.
- Returns
- The ascent of the current font.
Implements CDPL::Vis::FontMetrics.
◆ getDescent()
| double CDPL::Vis::QtFontMetrics::getDescent |
( |
| ) |
const |
|
virtual |
Returns the descent of the current font.
- Returns
- The descent of the current font.
Implements CDPL::Vis::FontMetrics.
◆ getHeight()
| double CDPL::Vis::QtFontMetrics::getHeight |
( |
| ) |
const |
|
virtual |
Returns the height of the current font.
- Returns
- The height of the current font.
Implements CDPL::Vis::FontMetrics.
◆ getLeading()
| double CDPL::Vis::QtFontMetrics::getLeading |
( |
| ) |
const |
|
virtual |
Returns the leading of the current font.
- Returns
- The leading of the current font.
Implements CDPL::Vis::FontMetrics.
◆ getWidth() [1/2]
| double CDPL::Vis::QtFontMetrics::getWidth |
( |
const std::string & |
str | ) |
const |
|
virtual |
Returns the total advance width of the rendered string str in the current font.
- Parameters
-
| str | The string for which to retrieve the total advance width. |
- Returns
- The total advance width of str.
Implements CDPL::Vis::FontMetrics.
◆ getWidth() [2/2]
| double CDPL::Vis::QtFontMetrics::getWidth |
( |
char |
ch | ) |
const |
|
virtual |
Returns the advance width of the rendered character ch in the current font.
- Parameters
-
| ch | The character for which to retrieve the advance width. |
- Returns
- The advance width of ch.
Implements CDPL::Vis::FontMetrics.
◆ getBounds() [1/2]
| void CDPL::Vis::QtFontMetrics::getBounds |
( |
const std::string & |
str, |
|
|
Rectangle2D & |
bounds |
|
) |
| const |
|
virtual |
Computes the tight bounding rectangle of the rendered string str in the current font.
- Parameters
-
| str | The string for which to compute the bounding rectangle. |
| bounds | The Rectangle2D instance receiving the result. |
Implements CDPL::Vis::FontMetrics.
◆ getBounds() [2/2]
| void CDPL::Vis::QtFontMetrics::getBounds |
( |
char |
ch, |
|
|
Rectangle2D & |
bounds |
|
) |
| const |
|
virtual |
Computes the tight bounding rectangle of the rendered character ch in the current font.
- Parameters
-
| ch | The character for which to compute the bounding rectangle. |
| bounds | The Rectangle2D instance receiving the result. |
Implements CDPL::Vis::FontMetrics.
The documentation for this class was generated from the following file: