From 371516653982fe6672fff3d294b2742c60ea9183 Mon Sep 17 00:00:00 2001 From: Ievgenii Meshcheriakov Date: Mon, 11 Oct 2021 12:56:09 +0200 Subject: [PATCH] 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 --- src/corelib/doc/snippets/code/src_corelib_tools_qpoint.cpp | 4 ++-- 1 file 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]