diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-11-03 03:01:44 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-11-03 03:01:44 +0100 |
commit | 355a82e3d3aeb470b1d3d257afd2cce24f05b110 (patch) | |
tree | d30d8debaa0a27a837fd5bc3e70da0489eaf10e2 /src/positioning | |
parent | 499f14e91e34ca78c073079f43910811d9408252 (diff) | |
parent | d64e59001884e942de087cdcd1bcef8b8e5f99e0 (diff) | |
download | qtlocation-355a82e3d3aeb470b1d3d257afd2cce24f05b110.tar.gz |
Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I219444e81a9b304b11b0cecce84415acdb3ade57
Diffstat (limited to 'src/positioning')
-rw-r--r-- | src/positioning/doc/src/qtpositioning.qdoc | 17 | ||||
-rw-r--r-- | src/positioning/qgeopath.cpp | 3 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/positioning/doc/src/qtpositioning.qdoc b/src/positioning/doc/src/qtpositioning.qdoc index f0094ff0..7c30ef07 100644 --- a/src/positioning/doc/src/qtpositioning.qdoc +++ b/src/positioning/doc/src/qtpositioning.qdoc @@ -40,12 +40,15 @@ For C++ projects include the header appropriate for the current use case, for example applications using routes may use - \code #include <QGeoCoordinate> \endcode + \code + #include <QGeoCoordinate> + \endcode The .pro file should have the \e positioning keyword added - \code QT += positioning \endcode - + \badcode + QT += positioning + \endcode See more in the \l{Qt Positioning}{Qt Positioning Overview}. @@ -87,11 +90,15 @@ To load the Qt Positioning module, add the following statement to your .qml file For C++ projects include the header appropriate for the current use case, for example applications using routes may use -\code #include <QGeoCoordinate> \endcode +\code +#include <QGeoCoordinate> +\endcode The .pro file should have the \e positioning keyword added -\code QT += positioning \endcode +\badcode +QT += positioning +\endcode \section1 Licenses diff --git a/src/positioning/qgeopath.cpp b/src/positioning/qgeopath.cpp index 35d82b5f..beb43692 100644 --- a/src/positioning/qgeopath.cpp +++ b/src/positioning/qgeopath.cpp @@ -483,6 +483,9 @@ void QGeoPathPrivate::setWidth(const qreal &width) double QGeoPathPrivate::length(int indexFrom, int indexTo) const { + if (path().isEmpty()) + return 0.0; + bool wrap = indexTo == -1; if (indexTo < 0 || indexTo >= path().size()) indexTo = path().size() - 1; |