TextMetrics QML Type▲
-
Import Statement: import QtQuick 2.13
-
Since: Qt 5.4
-
Group: TextMetrics is part of qtquick-text-utility
Detailed Description▲
https:// calculates various properties of a given string of text for a particular font.
It provides a declarative API for the functions in QFontMetricsF which take arguments.
TextMetrics {
id: textMetrics
font.family: "Arial"
elide: Text.ElideMiddle
elideWidth: 100
text: "Hello World"
}
MyItem {
text: textMetrics.elidedText
}See Also▲
See also QFontMetricsF, https://
Property Documentation▲
advanceWidth : real▲
This property holds the advance in pixels of the characters in https://. This is the distance from the position of the string to where the next string should be drawn.
See Also▲
See also QFontMetricsF::width()
boundingRect : rect▲
This property holds the bounding rectangle of the characters in the string specified by https://.
See Also▲
See also QFontMetricsF::boundingRect(), https://
elide : enumeration▲
This property holds the elide mode of the text. This determines the position in which the string is elided. The possible values are:
-
Qt::ElideNone - No eliding; this is the default value.
-
Qt::ElideLeft - For example: "...World"
-
Qt::ElideMiddle - For example: "He...ld"
-
Qt::ElideRight - For example: "Hello..."
See Also▲
See also https://, QFontMetrics::elidedText
elideWidth : real▲
This property holds the largest width the text can have (in pixels) before eliding will occur.
See Also▲
See also https://, QFontMetrics::elidedText
elidedText : string▲
This property holds an elided version of the string (i.e., a string with "..." in it) if the string https:// is wider than https://. If the text is not wider than https://, or https:// is set to Qt::ElideNone, this property will be equal to the original string.
See Also▲
See also QFontMetricsF::elidedText()
font : font▲
This property holds the font used for the metrics calculations.
height : real▲
This property holds the height of the bounding rectangle of the characters in the string specified by https://. It is equivalent to:
textMetrics.boundingRect.heightSee Also▲
See also https://
text : string▲
This property holds the text used for the metrics calculations.
tightBoundingRect : rect▲
This property holds a tight bounding rectangle around the characters in the string specified by https://.
See Also▲
See also QFontMetricsF::tightBoundingRect(), https://
width : real▲
This property holds the width of the bounding rectangle of the characters in the string specified by https://. It is equivalent to:
textMetrics.boundingRect.widthSee Also▲
See also https://


