diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-05-18 12:58:04 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-05-20 13:34:45 +0000 |
commit | 58d8b5e84ac6952b411cff3bca7336073349290e (patch) | |
tree | b67841b21d6f524badc7dd219e693fd430b05065 /src/imports/positioning | |
parent | ac90417d676a7691c01af7730172f60bf690d4ee (diff) | |
download | qtlocation-58d8b5e84ac6952b411cff3bca7336073349290e.tar.gz |
Fix crash when initiating map flick w/o QtPositioning import
A map flick requires a QPropertyAnimation for a QGeoCoordinate. The
required animation interpolator is exported by the QtPositioning
QML plugin. In general a QML Location app should always import
QtPositioning as well. In this case the import was missing and
subsequently the interpolator for the QGeoCoordinate was never
registered.
This patch ensures that the QtLocation QML code that requires the
animation registers the interpolator in addition to the regular
QtPositioning registration.
Change-Id: I61759418f0cdf1cb30ff946cc325a112e90c1a2f
Task-number: QTBUG-46147
Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/imports/positioning')
-rw-r--r-- | src/imports/positioning/positioning.cpp | 1 | ||||
-rw-r--r-- | src/imports/positioning/qdeclarativegeocoordinateanimation.cpp | 16 | ||||
-rw-r--r-- | src/imports/positioning/qdeclarativegeocoordinateanimation_p.h | 3 |
3 files changed, 1 insertions, 19 deletions
diff --git a/src/imports/positioning/positioning.cpp b/src/imports/positioning/positioning.cpp index 2a010be7..743b73df 100644 --- a/src/imports/positioning/positioning.cpp +++ b/src/imports/positioning/positioning.cpp @@ -34,6 +34,7 @@ #include <QtPositioning/private/qdeclarativegeoaddress_p.h> #include <QtPositioning/private/qdeclarativegeolocation_p.h> +#include <QtPositioning/private/qgeoprojection_p.h> #include "qdeclarativepositionsource_p.h" #include "qdeclarativeposition_p.h" diff --git a/src/imports/positioning/qdeclarativegeocoordinateanimation.cpp b/src/imports/positioning/qdeclarativegeocoordinateanimation.cpp index 3f01cbc0..8bb677ad 100644 --- a/src/imports/positioning/qdeclarativegeocoordinateanimation.cpp +++ b/src/imports/positioning/qdeclarativegeocoordinateanimation.cpp @@ -33,7 +33,6 @@ #include "qdeclarativegeocoordinateanimation_p.h" #include <QtQuick/private/qquickanimation_p_p.h> -#include <QtPositioning/private/qgeoprojection_p.h> #include <QtPositioning/private/qdoublevector2d_p.h> QT_BEGIN_NAMESPACE @@ -94,19 +93,4 @@ void QDeclarativeGeoCoordinateAnimation::setTo(const QGeoCoordinate &t) QQuickPropertyAnimation::setTo(QVariant::fromValue(t)); } -QVariant geoCoordinateInterpolator(const QGeoCoordinate &from, const QGeoCoordinate &to, qreal progress) -{ - if (from == to) { - if (progress < 0.5) { - return QVariant::fromValue(from); - } else { - return QVariant::fromValue(to); - } - } - - QGeoCoordinate result = QGeoProjection::coordinateInterpolation(from, to, progress); - - return QVariant::fromValue(result); -} - QT_END_NAMESPACE diff --git a/src/imports/positioning/qdeclarativegeocoordinateanimation_p.h b/src/imports/positioning/qdeclarativegeocoordinateanimation_p.h index 26b6ebb6..2aafc8f6 100644 --- a/src/imports/positioning/qdeclarativegeocoordinateanimation_p.h +++ b/src/imports/positioning/qdeclarativegeocoordinateanimation_p.h @@ -39,9 +39,6 @@ QT_BEGIN_NAMESPACE - -QVariant geoCoordinateInterpolator(const QGeoCoordinate &from, const QGeoCoordinate &to, qreal progress); - class QDeclarativeGeoCoordinateAnimation : public QQuickPropertyAnimation { Q_OBJECT |