From 0ffb89591a9e2463b36948cdd5e2948de72e14c4 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 28 Mar 2018 16:19:15 +0200 Subject: Doc: Document QtPositioning::geopolygon QML basic type And revert the changes from commit acc8bc07 that erraneously converted references of 'geopolygon' to 'geoshape'. Change-Id: I8ad5c17b3ad3dcd3cec6d7ba49bfa078b87ad33d Reviewed-by: Paolo Angelelli --- src/imports/positioning/locationsingleton.cpp | 12 +++++----- src/imports/positioning/positioning.cpp | 33 ++++++++++++++++++++++++--- 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 coordinates) const + \qmlmethod geopolygon QtPositioning::polygon(list 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) -- cgit v1.2.1