summaryrefslogtreecommitdiff
path: root/src/imports/positioning
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/positioning')
-rw-r--r--src/imports/positioning/locationsingleton.cpp8
-rw-r--r--src/imports/positioning/positioning.cpp36
2 files changed, 37 insertions, 7 deletions
diff --git a/src/imports/positioning/locationsingleton.cpp b/src/imports/positioning/locationsingleton.cpp
index e9b58834..89b93617 100644
--- a/src/imports/positioning/locationsingleton.cpp
+++ b/src/imports/positioning/locationsingleton.cpp
@@ -236,7 +236,7 @@ QGeoPath LocationSingleton::path(const QJSValue &value, qreal width) const
/*!
\qmlmethod geopolygon QtPositioning::polygon() const
- Constructs an empty geopolygon.
+ Constructs an empty polygon.
\sa {geopolygon}
\since 5.10
@@ -249,7 +249,7 @@ QGeoPath LocationSingleton::polygon() const
/*!
\qmlmethod geopolygon QtPositioning::polygon(list<coordinate> coordinates) const
- Constructs a geopolygon from coordinates.
+ Constructs a polygon from coordinates.
\sa {geopolygon}
\since 5.10
@@ -304,9 +304,9 @@ QGeoPath LocationSingleton::shapeToPath(const QGeoShape &shape) const
}
/*!
- \qmlmethod geopath QtPositioning::shapeToPolygon(geoshape shape) const
+ \qmlmethod geopolygon QtPositioning::shapeToPolygon(geoshape shape) const
- Converts \a shape to a geopolygon.
+ Converts \a shape to a polygon.
\sa {geopolygon}
\since 5.10
diff --git a/src/imports/positioning/positioning.cpp b/src/imports/positioning/positioning.cpp
index 1f7f9498..232d2589 100644
--- a/src/imports/positioning/positioning.cpp
+++ b/src/imports/positioning/positioning.cpp
@@ -57,6 +57,7 @@
#include <QtPositioning/QGeoCircle>
#include <QtPositioning/QGeoPath>
#include <QtPositioning/QGeoLocation>
+#include <QtPositioning/QGeoPositionInfo>
#include <QtPositioning/private/qgeocoordinateobject_p.h>
#include <QtCore/QDebug>
@@ -308,9 +309,11 @@ QT_BEGIN_NAMESPACE
Returns the current type of the shape.
\list
- \li GeoShape.UnknownType - The shape's type is not known.
- \li GeoShape.RectangleType - The shape is a \l georectangle.
- \li GeoShape.CircleType - The shape is a \l geocircle.
+ \li \c GeoShape.UnknownType - The shape's type is not known.
+ \li \c GeoShape.RectangleType - The shape is a \l georectangle.
+ \li \c GeoShape.CircleType - The shape is a \l geocircle.
+ \li \c GeoShape.PathType - The shape is a \l geopath. (Since Qt 5.9)
+ \li \c GeoShape.PolygonType - The shape is a \l geopolygon. (Since Qt 5.10)
\endlist
This QML property was introduced by Qt 5.5.
@@ -528,6 +531,31 @@ QT_BEGIN_NAMESPACE
The default value for the width is 0.
*/
+/*!
+ \qmlbasictype geopolygon
+ \inqmlmodule QtPositioning
+ \ingroup qml-QtPositioning5-basictypes
+ \since 5.10
+
+ \brief The geopolygon type represents a geographic polygon.
+
+ The \c geopolygon type is a \l [QML] geoshape that represents a geographic
+ polygon. It is a direct representation of QGeoPolygon and is defined in
+ terms of a \l path which holds a list of geo coordinates in the polygon.
+
+ The polygon is considered invalid if its path holds less than three
+ coordinates.
+
+ When integrating with C++, note that any QGeoPolygon value passed into QML
+ is automatically converted into a \c geopolygon, and vice versa.
+
+ \section1 Properties
+
+ \section2 path
+
+ This property holds the list of coordinates defining the polygon.
+*/
+
static QObject *singleton_type_factory(QQmlEngine *engine, QJSEngine *jsEngine)
{
Q_UNUSED(engine)
@@ -567,6 +595,8 @@ public:
qRegisterMetaType<QGeoShape>();
QMetaType::registerEqualsComparator<QGeoShape>();
qRegisterMetaType<QGeoCoordinateObject *>();
+ qRegisterMetaType<QGeoPositionInfo>();
+ QMetaType::registerEqualsComparator<QGeoPositionInfo>();
qRegisterAnimationInterpolator<QGeoCoordinate>(q_coordinateInterpolator);