summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMatthias Rauter <matthias.rauter@qt.io>2023-06-28 12:02:29 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-06-29 07:37:21 +0000
commitfb7ca0dcd9cb614c2a5229278a21818f4d21dd25 (patch)
tree48e02e45e70137eb94a425add694707712556820 /examples
parent0e1980dfa9cfda4435ee6be0e0a1dbf3fc307caa (diff)
Remove private QWebmercator function from planespotter example
The relevant part of the used function can be easily implemented in the example. Change-Id: I5e961dcd51fffd11cf1a72a4383a1ed57537b0fa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit d8203131a573337f3329cd9ea4f2c97357e1f6f3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples')
-rw-r--r--examples/location/planespotter/CMakeLists.txt1
-rw-r--r--examples/location/planespotter/main.cpp12
-rw-r--r--examples/location/planespotter/planespotter.pro2
3 files changed, 11 insertions, 4 deletions
diff --git a/examples/location/planespotter/CMakeLists.txt b/examples/location/planespotter/CMakeLists.txt
index 13c56f04..2440d91e 100644
--- a/examples/location/planespotter/CMakeLists.txt
+++ b/examples/location/planespotter/CMakeLists.txt
@@ -30,7 +30,6 @@ target_link_libraries(planespotter PUBLIC
Qt::Gui
Qt::Location
Qt::Positioning
- Qt::PositioningPrivate
Qt::Qml
Qt::Quick
)
diff --git a/examples/location/planespotter/main.cpp b/examples/location/planespotter/main.cpp
index 4e04105c..16748fd0 100644
--- a/examples/location/planespotter/main.cpp
+++ b/examples/location/planespotter/main.cpp
@@ -10,7 +10,6 @@
#include <QDebug>
#include <QEasingCurve>
#include <QGeoCoordinate>
-#include <QtPositioning/private/qwebmercator_p.h>
#define ANIMATION_DURATION 4000
@@ -125,7 +124,7 @@ private:
progress = ((qreal)startTime.msecsTo(current) / ANIMATION_DURATION);
}
- setPosition(QWebMercator::coordinateInterpolation(
+ setPosition(coordinateInterpolation(
fromCoordinate, toCoordinate, easingCurve.valueForProgress(progress)));
if (!timer.isActive())
@@ -133,6 +132,15 @@ private:
}
//! [C++Pilot3]
+ QGeoCoordinate coordinateInterpolation(const QGeoCoordinate &from, const QGeoCoordinate &to, qreal progress)
+ {
+
+ QPointF v = QPointF(from.latitude(), from.longitude()) * (1.-progress)
+ + QPointF(to.latitude(), to.longitude()) * progress;
+
+ return QGeoCoordinate(v.x(), v.y());
+ }
+
private:
QGeoCoordinate currentPosition;
QGeoCoordinate fromCoordinate, toCoordinate;
diff --git a/examples/location/planespotter/planespotter.pro b/examples/location/planespotter/planespotter.pro
index d3be902c..5c2fa334 100644
--- a/examples/location/planespotter/planespotter.pro
+++ b/examples/location/planespotter/planespotter.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
TARGET = planespotter
-QT += qml quick positioning positioning-private location
+QT += qml quick positioning location
SOURCES += main.cpp