qt5base-lts/tests/auto/gui/text/qfontmetrics
Eskil Abrahamsen Blomfeldt ee2ad9df70 Add QFontMetrics(F)::horizontalAdvance() function
A source of constant confusion is the QFontMetrics::width() function,
which does not return the bounding width of the text, but the advance
width. We deprecate this and add horizontalAdvance() instead, to avoid the
confusion in the future.

Note that there was an internal width() overload which was only there
for the purpose of supporting the Qt::TextBypassShaping flag. This
flag has already been replaced by public API, so no such
overload is added. Instead, we deprecate the TextBypassShaping flag
as well, which makes sense, since a replacement has been made.

Also note that there was a consistency problem with QFontMetrics and
QFontMetricsF, which are supposed to be interchangeable. The
QFontMetrics::width() functions for strings took an optional int length
argument, while the floating point version did not. This error is
corrected in the advance() functions.

[ChangeLog][QtGui][Text] Added QFontMetrics::horizontalAdvance() and
QFontMetricsF::horizontalAdvance() to replace the confusingly named
width() function. The latter has now been deprecated.

Change-Id: I0dfda43aa65c8235be32c62fade82cae05b29c79
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-11-14 16:28:45 +00:00
..
.gitignore Moved gui autotests into new directory structure 2011-09-01 10:59:49 +02:00
qfontmetrics.pro Tests: Remove CONFIG += parallel_test. 2015-09-05 07:16:50 +00:00
testfont.qrc Moved gui autotests into new directory structure 2011-09-01 10:59:49 +02:00
tst_qfontmetrics.cpp Add QFontMetrics(F)::horizontalAdvance() function 2017-11-14 16:28:45 +00:00
ucs4font.ttf Moved gui autotests into new directory structure 2011-09-01 10:59:49 +02:00