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>
This commit is contained in:
parent
e05e3c7762
commit
3715166539
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user