summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2019-03-01 12:45:19 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2019-03-19 09:25:21 +0000
commit2bf874e5e2b6a08ee12d0810d67d3c7ecf1e4bfa (patch)
treed86bbec91d28ece4d239216adaa33ef55f847a59
parent0f544f67042490e2a5448616601ed28322214c57 (diff)
downloadqtlocation-2bf874e5e2b6a08ee12d0810d67d3c7ecf1e4bfa.tar.gz
Document QGeoPath::length behavior
By default, the method computes a closed-loop length. Being this public API, the only thing that can be done is to properly document the behavior. [ChangeLog][QtPositioning] Documented QGeoPath::length behavior properly. Change-Id: Ie48a51ab0d11ec68851c2ea26b8c6f6894be8b61 Fixes: QTBUG-71358 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/positioning/qgeopath.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/positioning/qgeopath.cpp b/src/positioning/qgeopath.cpp
index 0c3d0c1c..c4b13d01 100644
--- a/src/positioning/qgeopath.cpp
+++ b/src/positioning/qgeopath.cpp
@@ -292,6 +292,10 @@ QGeoPath QGeoPath::translated(double degreesLatitude, double degreesLongitude) c
/*!
Returns the length of the path, in meters, from the element \a indexFrom to the element \a indexTo.
The length is intended to be the sum of the shortest distances for each pair of adjacent points.
+
+ If \a indexTo is -1 (the default value), the length will be including the distance between last coordinate
+ and the first (closed loop).
+ To retrieve the length for the path, use 0 for \a indexFrom and \l QGeoPath::size() - 1 for \a indexTo.
*/
double QGeoPath::length(int indexFrom, int indexTo) const
{