diff options
Diffstat (limited to 'src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp')
-rw-r--r-- | src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp b/src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp index a6654e81..a79af1cb 100644 --- a/src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp +++ b/src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp @@ -51,6 +51,8 @@ #include <QtLocation/QPlaceSearchRequest> #include <QtLocation/QPlaceContactDetail> +#include <algorithm> + QT_BEGIN_NAMESPACE namespace { @@ -204,11 +206,11 @@ void QPlaceSearchReplyMapbox::onReplyFinished() } if (request().relevanceHint() == QPlaceSearchRequest::DistanceHint) { - qSort(results.begin(), results.end(), [](const QPlaceResult &a, const QPlaceResult &b) -> bool { + std::sort(results.begin(), results.end(), [](const QPlaceResult &a, const QPlaceResult &b) -> bool { return a.distance() < b.distance(); }); } else if (request().relevanceHint() == QPlaceSearchRequest::LexicalPlaceNameHint) { - qSort(results.begin(), results.end(), [](const QPlaceResult &a, const QPlaceResult &b) -> bool { + std::sort(results.begin(), results.end(), [](const QPlaceResult &a, const QPlaceResult &b) -> bool { return a.place().name() < b.place().name(); }); } |