diff options
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/positioning/locationsingleton.cpp | 26 | ||||
-rw-r--r-- | src/imports/positioning/locationsingleton.h | 4 | ||||
-rw-r--r-- | src/imports/positioning/positioning.cpp | 3 |
3 files changed, 33 insertions, 0 deletions
diff --git a/src/imports/positioning/locationsingleton.cpp b/src/imports/positioning/locationsingleton.cpp index f12486b0..a48c1a96 100644 --- a/src/imports/positioning/locationsingleton.cpp +++ b/src/imports/positioning/locationsingleton.cpp @@ -179,6 +179,19 @@ QGeoCircle LocationSingleton::circle(const QGeoCoordinate ¢er, qreal radius) } /*! + \qmlmethod geopath QtPositioning::path() const + + Constructs an empty geopath. + + \sa {geopath} + \since 5.9 +*/ +QGeoPath LocationSingleton::path() const +{ + return QGeoPath(); +} + +/*! \qmlmethod geocircle QtPositioning::shapeToCircle(geoshape shape) const Converts \a shape to a geocircle. @@ -204,3 +217,16 @@ QGeoRectangle LocationSingleton::shapeToRectangle(const QGeoShape &shape) const return QGeoRectangle(shape); } +/*! + \qmlmethod geopath QtPositioning::shapeToPath(geoshape shape) const + + Converts \a shape to a geopath. + + \sa {geopath} + \since 5.9 +*/ +QGeoPath LocationSingleton::shapeToPath(const QGeoShape &shape) const +{ + return QGeoPath(shape); +} + diff --git a/src/imports/positioning/locationsingleton.h b/src/imports/positioning/locationsingleton.h index cc4ea5ce..9a5320e0 100644 --- a/src/imports/positioning/locationsingleton.h +++ b/src/imports/positioning/locationsingleton.h @@ -46,6 +46,7 @@ #include <QtPositioning/QGeoShape> #include <QtPositioning/QGeoRectangle> #include <QtPositioning/QGeoCircle> +#include <QtPositioning/QGeoPath> #include <QVariant> class LocationSingleton : public QObject @@ -71,8 +72,11 @@ public: Q_INVOKABLE QGeoCircle circle() const; Q_INVOKABLE QGeoCircle circle(const QGeoCoordinate ¢er, qreal radius = -1.0) const; + Q_INVOKABLE QGeoPath path() const; + Q_INVOKABLE QGeoCircle shapeToCircle(const QGeoShape &shape) const; Q_INVOKABLE QGeoRectangle shapeToRectangle(const QGeoShape &shape) const; + Q_INVOKABLE QGeoPath shapeToPath(const QGeoShape &shape) const; }; #endif // LOCATIONSINGLETON_H diff --git a/src/imports/positioning/positioning.cpp b/src/imports/positioning/positioning.cpp index 4c54c211..b7914e5d 100644 --- a/src/imports/positioning/positioning.cpp +++ b/src/imports/positioning/positioning.cpp @@ -55,6 +55,7 @@ #include <QtPositioning/QGeoRectangle> #include <QtPositioning/QGeoCircle> +#include <QtPositioning/QGeoPath> #include <QtPositioning/QGeoLocation> #include <QtCore/QDebug> @@ -527,6 +528,8 @@ public: QMetaType::registerEqualsComparator<QGeoRectangle>(); qRegisterMetaType<QGeoCircle>(); QMetaType::registerEqualsComparator<QGeoCircle>(); + qRegisterMetaType<QGeoPath>(); + QMetaType::registerEqualsComparator<QGeoPath>(); qRegisterMetaType<QGeoLocation>(); qRegisterMetaType<QGeoShape>(); QMetaType::registerEqualsComparator<QGeoShape>(); |