diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2017-08-02 11:39:01 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2017-12-08 15:06:32 +0000 |
commit | 4d88d79aa507777bce40740b21747f656efc074d (patch) | |
tree | 0b335cac61062eaf281b5a76514f8bd74bbcaaf2 /examples/widgets/doc | |
parent | cd56e843cc53938111879c21570eaf8225719743 (diff) |
Update usage of QFontMetrics::width() to new API
QFontMetrics(F)::width() has been deprecated and is replaced by
horizontalAdvance(). This updates all usage of it in tests and
documentation.
It is worth noting that many or most of the usages of
QFontMetrics::width() probably intended to use boundingRect().width(),
but since it currently works, I have not looked into that, just
replaced the function name mechanically.
Change-Id: Iec382e5bad0b50f37a6cfff841bfb46ed4d4555f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'examples/widgets/doc')
-rw-r--r-- | examples/widgets/doc/src/wiggly.qdoc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/widgets/doc/src/wiggly.qdoc b/examples/widgets/doc/src/wiggly.qdoc index f330b016df..d70d609e2b 100644 --- a/examples/widgets/doc/src/wiggly.qdoc +++ b/examples/widgets/doc/src/wiggly.qdoc @@ -143,10 +143,10 @@ position on the wiggly line based on \c step. In addition, \c x is incremented by the character's width. - For simplicity, we assume that QFontMetrics::width(\c text) - returns the sum of the individual character widths - (QFontMetrics::width(\c text[i])). In practice, this is not - always the case because QFontMetrics::width(\c text) also takes + For simplicity, we assume that QFontMetrics::horizontalAdvance(\c text) + returns the sum of the individual character advances + (QFontMetrics::horizontalAdvance(\c text[i])). In practice, this is not + always the case because QFontMetrics::horizontalAdvance(\c text) also takes into account the kerning between certain letters (e.g., 'A' and 'V'). The result is that the text isn't perfectly centered. You can verify this by typing "AVAVAVAVAVAV" in the line edit. |