summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Wicking <paul.wicking@qt.io>2021-01-11 13:24:00 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-01-11 16:57:49 +0000
commitcf5439c59a134de57f47bfa4e310035d9347d62f (patch)
treef96acac2ad12a1460cfd8c009f6093d95e8e7c8c
parent87b261a67088901191cb7747248ee37270e6ed18 (diff)
Doc: Explain how boundingRect handles null QRectF
Fixes: QTBUG-87107 Change-Id: Ib7f9bd58b0f3454167dc61f95e0d8e6dec52a5ed Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 149ad1e615bf0974e52a681af73e9fb04bc1c762) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/gui/text/qfontmetrics.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 8f3aa62842..341fd2a0e7 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -1480,7 +1480,9 @@ QRectF QFontMetricsF::boundingRect(QChar ch) const
Returns the bounding rectangle of the characters in the given \a text.
This is the set of pixels the text would cover if drawn when constrained
- to the bounding rectangle specified by \a rect.
+ to the bounding rectangle specified by \a rect. If \a rect is a reference
+ to a \nullptr object, e.g. when passing a default constructed QRectF, the
+ bounding rectangle will not constrain itself to the size.
The \a flags argument is the bitwise OR of the following flags:
\list