From cc473646ecaf145178b827d99afec11d3932c07f Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 14 Feb 2023 10:58:16 +0100 Subject: [PATCH] Warn that computational time follows length of text input We have no reliable way of cutting the text shorter without side- effects, so leave that to the users. Task-number: QTBUG-109838 Change-Id: I280d2dec9d6e0cd6b4d57edac231ae99420d8569 Reviewed-by: Eskil Abrahamsen Blomfeldt (cherry picked from commit bea15cdfa4de5fb9fa1614ef93b54df7139423fa) Reviewed-by: Qt Cherry-pick Bot --- src/gui/text/qfontmetrics.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp index 9df93a53ceb..cd0886440b4 100644 --- a/src/gui/text/qfontmetrics.cpp +++ b/src/gui/text/qfontmetrics.cpp @@ -486,7 +486,8 @@ static constexpr QLatin1Char s_variableLengthStringSeparator('\x9c'); /*! Returns the horizontal advance in pixels of the first \a len characters of \a text. If \a len is negative (the default), the entire string is - used. + used. The entire length of \a text is analysed even if \a len is substantially + shorter. This is the distance appropriate for drawing a subsequent character after \a text. @@ -1399,7 +1400,8 @@ qreal QFontMetricsF::rightBearing(QChar ch) const /*! Returns the horizontal advance in pixels of the first \a length characters of \a text. If \a length is negative (the default), the entire string is - used. + used. The entire length of \a text is analysed even if \a length is substantially + shorter. The advance is the distance appropriate for drawing a subsequent character after \a text.