summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2018-03-28 16:19:15 +0200
committerTopi Reiniƶ <topi.reinio@qt.io>2018-04-03 07:17:41 +0000
commit0ffb89591a9e2463b36948cdd5e2948de72e14c4 (patch)
tree251a626d8ff830c7835b6c62a85dc96db243788e
parent27837cdf26a2f7d83f57f55a1a4e7ce947479592 (diff)
downloadqtlocation-5.11.0-beta3.tar.gz
Doc: Document QtPositioning::geopolygon QML basic typev5.11.0-beta3
And revert the changes from commit acc8bc07 that erraneously converted references of 'geopolygon' to 'geoshape'. Change-Id: I8ad5c17b3ad3dcd3cec6d7ba49bfa078b87ad33d Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
-rw-r--r--src/imports/positioning/locationsingleton.cpp12
-rw-r--r--src/imports/positioning/positioning.cpp33
2 files changed, 36 insertions, 9 deletions
diff --git a/src/imports/positioning/locationsingleton.cpp b/src/imports/positioning/locationsingleton.cpp
index c4822bff..89b93617 100644
--- a/src/imports/positioning/locationsingleton.cpp
+++ b/src/imports/positioning/locationsingleton.cpp
@@ -234,11 +234,11 @@ QGeoPath LocationSingleton::path(const QJSValue &value, qreal width) const
}
/*!
- \qmlmethod geopath QtPositioning::polygon() const
+ \qmlmethod geopolygon QtPositioning::polygon() const
Constructs an empty polygon.
- \sa {geopath}
+ \sa {geopolygon}
\since 5.10
*/
QGeoPath LocationSingleton::polygon() const
@@ -247,11 +247,11 @@ QGeoPath LocationSingleton::polygon() const
}
/*!
- \qmlmethod geopath QtPositioning::polygon(list<coordinate> coordinates) const
+ \qmlmethod geopolygon QtPositioning::polygon(list<coordinate> coordinates) const
Constructs a polygon from coordinates.
- \sa {geopath}
+ \sa {geopolygon}
\since 5.10
*/
QGeoPath LocationSingleton::polygon(const QVariantList &coordinates) const
@@ -304,11 +304,11 @@ 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 polygon.
- \sa {geopath}
+ \sa {geopolygon}
\since 5.10
*/
QGeoPolygon LocationSingleton::shapeToPolygon(const QGeoShape &shape) const
diff --git a/src/imports/positioning/positioning.cpp b/src/imports/positioning/positioning.cpp
index fb1e987e..232d2589 100644
--- a/src/imports/positioning/positioning.cpp
+++ b/src/imports/positioning/positioning.cpp
@@ -309,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.
@@ -529,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)