Qt Components Hildon  0.20
QML components for Maemo5 with Hildon styling.
 All Classes Functions Properties Groups Pages
Properties | List of all members
TextMetrics Class Reference

Calculates various properties of a given string of text for a particular font. More...

Properties

int advanceWidth
 The advance in pixels of the characters in text.
rect boundingRect
 The bounding rectangle of the characters in the string specified by text.
enumeration elide
 Determines the position in which the string is elided.
string elidedText
 The text elided (if neccessary) according to the specified elide and elideWidth.
int elideWidth
 The largest width the text can have (in pixels) before eliding will occur.
font font
 The font used for the metrics calculations.
int height
 The height of the bounding rectangle of the characters in the string specified by text.
string text
 The text used for the metrics calculations.
rect tightBoundingRect
 The tight bounding rectangle around the characters in the string specified by text.
int width
 The width of the bounding rectangle of the characters in the string specified by text.

Detailed Description

Calculates various properties of a given string of text for a particular font.

TextMetrics provides a declarative API for the functions in FontMetrics which take arguments.

See Also
FontMetrics

Property Documentation

int TextMetrics::advanceWidth
read

The advance in pixels of the characters in text.

This is the distance from the position of the string to where the next string should be drawn.

See Also
FontMetrics::width
rect TextMetrics::boundingRect
read

The bounding rectangle of the characters in the string specified by text.

See Also
FontMetrics::boundingRect(), tightBoundingRect
enumeration TextMetrics::elide
readwrite

Determines the position in which the string is elided.

Possible values are:

Name Description
Qt.ElideNone No eliding (default).
Qt.ElideLeft For example: "...World".
Qt.ElideMiddle For example: "He...ld".
Qt.ElideRight For example: "Hello...".
See Also
elidedText, elideWidth
string TextMetrics::elidedText
read

The text elided (if neccessary) according to the specified elide and elideWidth.

See Also
elide, elideWidth, text, width
int TextMetrics::elideWidth
readwrite

The largest width the text can have (in pixels) before eliding will occur.

See Also
elide, elidedText
int TextMetrics::height
read

The height of the bounding rectangle of the characters in the string specified by text.

It is equivalent to:

textMetrics.boundingRect.height
See Also
boundingRect
rect TextMetrics::tightBoundingRect
read

The tight bounding rectangle around the characters in the string specified by text.

See Also
FontMetrics::tightBoundingRect(), boundingRect
int TextMetrics::width
read

The width of the bounding rectangle of the characters in the string specified by text.

It is equivalent to:

textMetrics.boundingRect.width
See Also
boundingRect