diff options
author | Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> | 2021-10-11 12:56:09 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-10-12 12:08:08 +0000 |
commit | 371516653982fe6672fff3d294b2742c60ea9183 (patch) | |
tree | f715b9474db58f284dd8cb7f2c87a838fa90742e /src/corelib/doc/snippets | |
parent | e05e3c776256d35798f451f31cd71e809786ed78 (diff) |
QPoint: Don't claim that QPoint[F]::dotProduct() produces length squared
The documentation snippets name the result of dotProduct()
"lengthSquared", but it is just a coincidence, not the property of dot
product of two different points. Just name the result `dotProduct`
without claiming any properties.
Also fix the type of the result in the QPointF case.
Fixes: QTBUG-94979
Change-Id: I4c337dd8335953489eac86c07a219c0a2d232369
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/doc/snippets')
-rw-r--r-- | src/corelib/doc/snippets/code/src_corelib_tools_qpoint.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qpoint.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qpoint.cpp index fd4db5580f..7171f4b2ea 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qpoint.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qpoint.cpp @@ -92,7 +92,7 @@ p *= 2.5; // p becomes (-3, 10) //! [16] QPoint p( 3, 7); QPoint q(-1, 4); -int lengthSquared = QPoint::dotProduct(p, q); // lengthSquared becomes 25 +int dotProduct = QPoint::dotProduct(p, q); // dotProduct becomes 25 //! [16] @@ -169,5 +169,5 @@ p /= 2.5; // p becomes (-1.1, 4.1) //! [17] QPointF p( 3.1, 7.1); QPointF q(-1.0, 4.1); -int lengthSquared = QPointF::dotProduct(p, q); // lengthSquared becomes 26.01 +qreal dotProduct = QPointF::dotProduct(p, q); // dotProduct becomes 26.01 //! [17] |